|
@@ -58,14 +58,6 @@ function tripal_analysis_init() {
|
|
|
* @ingroup tripal_analysis
|
|
|
*/
|
|
|
function tripal_analysis_menu() {
|
|
|
- // Display available analyses
|
|
|
- $items['analyses'] = array(
|
|
|
- 'menu_name' => ('primary-links'), //Enable the 'Analysis' primary link
|
|
|
- 'title' => 'Analyses',
|
|
|
- 'page callback' => 'tripal_analysis_show_analyses',
|
|
|
- 'access arguments' => array('access chado_analysis content'),
|
|
|
- 'type' => MENU_NORMAL_ITEM
|
|
|
- );
|
|
|
//Sync analysis
|
|
|
$items['chado_sync_analyses'] = array(
|
|
|
'title' => 'Sync Data',
|
|
@@ -95,26 +87,6 @@ function tripal_analysis_menu() {
|
|
|
return $items;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * Display the summary view of analyses when click on the 'Analyses'
|
|
|
- * primary-link
|
|
|
- *
|
|
|
- * @ingroup tripal_analysis
|
|
|
- */
|
|
|
-function tripal_analysis_show_analyses() {
|
|
|
- // Show libraries stored in Drupal's {chado_analysis} table
|
|
|
- $sql = "SELECT COUNT(analysis_id) FROM {chado_analysis}";
|
|
|
- $no_ana = db_result(db_query($sql));
|
|
|
- if ($no_ana != 0) {
|
|
|
- $analyses = get_chado_analyses();
|
|
|
- return theme('tripal_analysis_analysis_page', $analyses);
|
|
|
- }
|
|
|
- else {
|
|
|
- return t("No analysis available at this time.");
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Provide information to drupal about the node types that we're creating
|
|
|
* in this module
|
|
@@ -349,39 +321,39 @@ function chado_analysis_form($node) {
|
|
|
if (!$analysis_id) {
|
|
|
$analysis_id = $analysis->analysis_id;
|
|
|
}
|
|
|
- $analysisname = $node->analysisname;
|
|
|
+ $analysisname = $node->analysisname;
|
|
|
if (!$analysisname) {
|
|
|
$analysisname = $analysis->name;
|
|
|
}
|
|
|
- $program = $node->program;
|
|
|
+ $program = $node->program;
|
|
|
if (!$program) {
|
|
|
$program = $analysis->program;
|
|
|
}
|
|
|
- $programversion = $node->programversion;
|
|
|
+ $programversion = $node->programversion;
|
|
|
if (!$programversion) {
|
|
|
$programversion = $analysis->programversion;
|
|
|
}
|
|
|
- $algorithm = $node->algorithm;
|
|
|
+ $algorithm = $node->algorithm;
|
|
|
if (!$algorithm) {
|
|
|
$algorithm = $analysis->algorithm;
|
|
|
}
|
|
|
- $sourcename = $node->sourcename;
|
|
|
+ $sourcename = $node->sourcename;
|
|
|
if (!$sourcename) {
|
|
|
$sourcename = $analysis->sourcename;
|
|
|
}
|
|
|
- $sourceversion = $node->sourceversion;
|
|
|
+ $sourceversion = $node->sourceversion;
|
|
|
if (!$sourceversion) {
|
|
|
$sourceversion = $analysis->sourceversion;
|
|
|
}
|
|
|
- $sourceuri = $node->sourceuri;
|
|
|
+ $sourceuri = $node->sourceuri;
|
|
|
if (!$sourceuri) {
|
|
|
$sourceuri = $analysis->sourceuri;
|
|
|
}
|
|
|
- $timeexecuted = $node->timeexecuted;
|
|
|
+ $timeexecuted = $node->timeexecuted;
|
|
|
if (!$timeexecuted) {
|
|
|
$timeexecuted = $analysis->timeexecuted;
|
|
|
}
|
|
|
- $description = $node->description;
|
|
|
+ $description = $node->description;
|
|
|
if (!$description) {
|
|
|
$description = $analysis->description;
|
|
|
}
|
|
@@ -811,9 +783,6 @@ function tripal_analysis_perm() {
|
|
|
*/
|
|
|
function tripal_analysis_theme() {
|
|
|
return array(
|
|
|
- 'tripal_analysis_analysis_page' => array(
|
|
|
- 'arguments' => array('analyses'),
|
|
|
- ),
|
|
|
'tripal_analysis_base' => array(
|
|
|
'arguments' => array('node' => NULL),
|
|
|
'template' => 'tripal_analysis_base',
|
|
@@ -893,64 +862,6 @@ function get_chado_analyses() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * Theme the List Analysis page
|
|
|
- *
|
|
|
- * @param $analyses
|
|
|
- * An array of analyses to list
|
|
|
- *
|
|
|
- * @ingroup tripal_analysis
|
|
|
- */
|
|
|
-function theme_tripal_analysis_analysis_page($analyses) {
|
|
|
-
|
|
|
- $output = "<br />Analyses are listed in the descending order of their execution time.<br /><a id=\"tripal_expandableBox_toggle_button\" onClick=\"toggleExpandableBoxes()\">[-] Collapse All</a>";
|
|
|
-
|
|
|
- foreach ($analyses as $analysis) {
|
|
|
- // Prepare information for html output
|
|
|
- $ana_node_url = url("node/$analysis->node_id");
|
|
|
- if ($analysis->sourceversion) {
|
|
|
- $ver = "($analysis->sourceversion)";
|
|
|
- }
|
|
|
- $date = preg_replace("/^(\d+-\d+-\d+) .*/", "$1", $analysis->timeexecuted);
|
|
|
-
|
|
|
- // Generate html output
|
|
|
- $output .= "<div class=\"tripal_chado_analysis-info-box\" style=\"padding:5px\">
|
|
|
- <div class=\"tripal_expandableBox\">
|
|
|
- <h3>$analysis->name ($date)</h3>
|
|
|
- </div>
|
|
|
- <div class=\"tripal_expandableBoxContent\">
|
|
|
- <span>
|
|
|
- <table class=\"tripal_chado_analysis_content\">
|
|
|
- <tr><td>
|
|
|
- Name: <a href=\"$ana_node_url\">$analysis->name</a>
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Program: $analysis->program ($analysis->programversion)
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Algorithm: $analysis->algorithm
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Source: $analysis->sourcename $ver
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Source URI: $analysis->sourceuri
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Executed Time:$date
|
|
|
- </td></tr>
|
|
|
- <tr><td>
|
|
|
- Description: $analysis->description
|
|
|
- </td></tr>
|
|
|
- </table>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>";
|
|
|
- }
|
|
|
-
|
|
|
- return $output;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Remove orphaned drupal nodes or chado analysis
|
|
|
*
|