value); $db_id = $blastsettings [0]; // Get db 'urlprefix' $sql = "SELECT urlprefix FROM {db} WHERE db_id=%d"; $urlprefix = db_result(db_query($sql, $db_id)); // Get all analysisfeature_id's sorted by the selected header for this blast analysis $sql = "SELECT AFP.analysisfeature_id FROM {analysisfeature} AF INNER JOIN {analysisfeatureprop} AFP ON AF.analysisfeature_id = AFP.analysisfeature_id WHERE analysis_id = %d AND AFP.type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = '%s' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'tripal')) ORDER BY value "; // Convert string to number for evalue, %identity, and length before SQL sorting if ($convert == 1) { $sql .= "::numeric "; } $sql .= "$sort_key"; $result = db_query($sql, $analysis_id, $header); tripal_db_set_active($previous_db); $analysisfeatureSet = array(); // Count how many analysisfeature_id we have and store them in order in $analysisfeatureSet $counter = 0; while ($feature = db_fetch_object($result)) { $analysisfeatureSet [$counter] = $feature->analysisfeature_id; $counter ++; } // Get analysis node id $ana_nid = db_result(db_query("SELECT nid FROM {chado_analysis} WHERE analysis_id = %d", $analysis_id)); $ana_url = url("node/".$ana_nid); // Get pager info $no_page = (int) ($counter / $per_page); if ($counter % $per_page != 0) { $no_page ++; } $first_item = ($currentpage - 1)* $per_page; $url = url(drupal_get_path('theme', 'tripal')."/images/ajax-loader.gif"); $html_out .= "
"; $html_out .= ""; if ($sort == 0) {$html_out .= $symbol;} // Construct URL path for different sorting column $path = "tripal_blast_report/$analysis_id/1/0/"; if ($descending == 0 && $sort == 0) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="Query | "; if ($sort == 1) {$html_out .= $symbol;} $path = "tripal_blast_report/$analysis_id/1/1/"; if ($descending == 0 && $sort == 1) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="Match Name | "; if ($sort == 2) {$html_out .= $symbol;} $path = "tripal_blast_report/$analysis_id/1/2/"; if ($descending == 0 && $sort == 2) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="Description | "; if ($sort == 3) {$html_out .= $symbol;} $path = "tripal_blast_report/$analysis_id/1/3/"; if ($descending == 0 && $sort == 3) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="E-value | "; if ($sort == 4) {$html_out .= $symbol;} $path = "tripal_blast_report/$analysis_id/1/4/"; if ($descending == 0 && $sort == 4) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="%Identity | "; if ($sort == 5) {$html_out .= $symbol;} $path = "tripal_blast_report/$analysis_id/1/5/"; if ($descending == 0 && $sort == 5) { $path .= "1"; } else { $path .= "0"; } $path .= "/$per_page"; $url_path = url ($path); $html_out.="Length | "; $html_out .= "
---|---|---|---|---|---|
$query | $match | $desc | $evalue | $identity | $length |