function get_data_total($path, $dbpass)
{
    $file_count = 0;
    $file_size = 0;
    $countQuery = "SELECT count(*) as dbcount from Genomes.xGDB_Log where {$path} !='' AND {$path} LIKE '/xGDBvm/data%' AND Status='Development'";
    # non-example data paths
    $get_count = $countQuery;
    $check_get_count = mysql_query($get_count);
    $count = $check_get_count;
    $row = mysql_fetch_assoc($count);
    $gdb_count = $row['dbcount'];
    $gdbQuery = "SELECT DISTINCT {$path} from Genomes.xGDB_Log where {$path} !='' AND {$path} LIKE '/xGDBvm/data%' AND Status='Development'";
    # non-example data paths
    $get_gdb = $gdbQuery;
    $check_get_gdb = mysql_query($get_gdb);
    $result = $check_get_gdb;
    $n = 0;
    while ($row = mysql_fetch_assoc($result)) {
        $input_path = $row[$path];
        if ($path == "Input_Data_Path" || $path == "Update_Data_Path") {
            $gdb_input = create_file_list($input_path, "dir", $input_path, "", 0, $dbpass);
            // returns array($file_list_formatted, $n, $total_size, $file_list)
            #				$gdb_input=	create_file_list("/xGDBvm/examples/example2/new_data", "dir", "", "", 0); // requires ($input, $type, $path, $title, $cutoff); returns array($file_list_formatted, $n, $total_size, $file_list)
            $file_count = $file_count + $gdb_input[1];
            // number of valid files
            $file_size = $file_size + $gdb_input[2];
            // number of MB
            break;
        } elseif ($path == "CpGAT_ReferenceProt_File" || $path == "RepeatMask_File") {
            $gdb_cpgat = validate_refpro($input_path);
            // returns array($file_list, $n, $total_size)
            $file_count = $file_count + $gdb_cpgat[1];
            // number of valid files
            $file_size = $file_size + $gdb_cpgat[2];
            // number of MB
        }
        $n = $n + 1;
    }
    return array($file_count, $file_size, $gdb_count);
    // file count and MB size for all validated data of the specified class (input, update, cpgat, mask)
}
Example #2
0
     $validRefPro = $CpGAT_ReferenceProt_File;
     //We don't store validated file other than user input. It is by definition validated or the process would not have run!
 } elseif ($g_exists != "Yes" && mysql_select_db("{$DBid}")) {
     $database_message = "<span class=\"alertnotice largerfont\">Warning: A MySQL database exists for {$DBid} but <pre>/{$XGDB_DATADIR}{$DBid}/</pre> is missing. </span>";
     $create = "display_off";
     // disable create button
     #### End GDB Exists ####
 } else {
     ############ GDB Database Not Yet Created (Status='Development').#############
     $archive_dirlist = archive_dir_dropdown($dataDir, "ArchiveGDB");
     #this is a list of any ArchiveGDB datasets that are available. Updated 1-28-16 to include dataDir param.
     $display_load_archive = $archive_dirlist == "" ? "display_off" : "{$display_load_archive}";
     #don't display the dropdown if there are no archives.
     $archive_dirlist_display = $archive_dirlist == "" ? "<option value=\"none\">-none-</option>" : $archive_dirlist;
     ######### Validate user-proposed Input Data Path files (note - these functions are also called elsewhere in this script for "Current" GDB. ######
     $arrayList = create_file_list($Input_Data_Path, "dir", $Input_Data_Path, "Input Directory", "2", $dbpass);
     //create validated, formatted file list based on dir path - conf_functions.inc.php
     $validList = $arrayList[0];
     //formatted
     $validCount = $arrayList[1];
     $validSize = $arrayList[2];
     # total bytes from valid files
     $validGB = round($validSize / 1000000000, 3);
     $validRefPro = $CpGAT_Status == "Yes" ? validate_library($CpGAT_ReferenceProt_File, "Reference Protein Library", $dbpass) : "";
     //from conf_functions.inc.php
     $validRepMask = $RepeatMask_Status == "Yes" ? validate_library($RepeatMask_File, "Repeat Mask Library", $dbpass) : "";
     //from conf_functions.inc.php
     $file_codes = $arrayList[4];
     #single-letter code string
     $input_errors = input_errors($file_codes);
     $input_warnings = input_warnings($Input_Data_Path);
Example #3
0
 $Gth_Species_Model = $data["Gth_Species_Model"];
 ######## CpGAT ########
 $CpGAT_Status = $data["CpGAT_Status"];
 $CpGAT_ReferenceProt_File = $data["CpGAT_ReferenceProt_File"];
 $CpGAT_BGF = $data["CpGAT_BGF"];
 $CpGAT_Augustus = $data["CpGAT_Augustus"];
 $CpGAT_GeneMark = $data["CpGAT_GeneMark"];
 $CpGAT_Skip_Mask = $data["CpGAT_Skip_Mask"];
 $CpGAT_Relax_UniRef = $data["CpGAT_Relax_UniRef"];
 $CpGAT_Skip_PASA = $data["CpGAT_Skip_PASA"];
 $CpGAT_Filter_Genes = $data["CpGAT_Filter_Genes"];
 $Update_Data_CpGAT = $data["Update_Data_CpGAT"];
 $Update_Status = $data["Update_Status"];
 ####### Database Update #######
 ####### Get snapshot of input files (valid list) #####
 $arrayList = create_file_list($Input_Data_Path, "dir", "", "", 2, $dbpass);
 //from conf_functions.inc.php  create_file_list($input, $type, $path, $title, $cutoff)
 $validList = $arrayList[3];
 # not formatted, just the raw list (what we will store)
 ####### Set up Computer Resources Parameter String (GSQ) #######
 $GSQ_CompResParameter = " Local ";
 // Default arguments.
 if ($GSQ_CompResources == "Remote") {
     //require correct config.
     $remote = true;
     $username = $_SESSION['username'];
     // the user's iPlant login
     $refresh_token = $_SESSION['refresh_token'];
     // obtained from iPlant authentication URL
     $server = $_SERVER['SERVER_NAME'];
     // required for callback URL