node-chado_analysis_blast.tpl.php 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. //
  3. // Copyright 2009 Clemson University
  4. //
  5. ?>
  6. <?php if ($picture) {
  7. print $picture;
  8. }?>
  9. <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
  10. <?php if ($page == 0) { ?><h2 class="nodeTitle"><a href="<?php print $node_url?>"><?php print $title?></a>
  11. <?php global $base_url;
  12. if ($sticky) { print '<img src="'.base_path(). drupal_get_path('theme','sanqreal').'/img/sticky.gif" alt="sticky icon" class="sticky" />'; } ?>
  13. </h2><?php }; ?>
  14. <?php if (!$teaser): ?>
  15. <?php if ($submitted): ?>
  16. <div class="metanode"><p><?php print t('') .'<span class="author">'. theme('username', $node).'</span>' . t(' - Posted on ') . '<span class="date">'.format_date($node->created, 'custom', "d F Y").'</span>'; ?></p></div>
  17. <?php endif; ?>
  18. <div>
  19. <!-- tripal_analysis_blast theme -->
  20. <table>
  21. <tr><th>Name</th><td><?php print $node->analysisname;?></td></tr>
  22. <tr><th>Program (version)</th><td><?php print $node->program.' ('.$node->programversion.')';?></td></tr>
  23. <?php
  24. $ver = $node->sourceversion;
  25. if ($node->sourceversion) {
  26. $ver = "($node->sourceversion)";
  27. }
  28. $date = preg_replace("/^(\d+-\d+-\d+) .*/","$1",$node->timeexecuted);
  29. ?>
  30. <tr><th>Source (version)</th><td><?php print $node->sourcename.' '.$ver;?></td></tr>
  31. <tr><th>Source URI</th><td><?php print $node->sourceuri;?></td></tr>
  32. <tr><th>Executed</th><td><?php print $date?></td></tr>
  33. <tr><th>Description</th><td><?php print $node->description?></td></tr>
  34. <tr><th>Blast Settings</th>
  35. <td>
  36. <b>Database:</b>
  37. <?php
  38. // We want to show database name instead of database id
  39. $previous_db = db_set_active('chado');
  40. $sql = "SELECT name FROM db WHERE db_id = %d";
  41. $dbname = db_result(db_query($sql, $node->blastdb));
  42. print $dbname;
  43. db_set_active($previous_db);
  44. ?><br>
  45. <b>File:</b>
  46. <?php print preg_replace("/.*\/(.*)/", "$1", $node->blastfile); ?><br>
  47. <b>Parameters:</b>
  48. <?php print $node->blastparameters?><br>
  49. <?php if ($node->blastjob) {
  50. print "A job for parsing blast xml output will be submitted.";
  51. }
  52. ?>
  53. </td>
  54. </tr>
  55. <tr><th>Report</th>
  56. <?php
  57. $sql = "SELECT AFP.analysisfeature_id
  58. FROM {analysisfeature} AF
  59. INNER JOIN {analysisfeatureprop} AFP ON AF.analysisfeature_id = AFP.analysisfeature_id
  60. WHERE analysis_id = %d
  61. AND AFP.type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = '%s' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'tripal'))";
  62. $previous_db = db_set_active('chado');
  63. $exists = db_result(db_query($sql, $node->analysis_id, 'analysis_blast_besthit_query'));
  64. db_set_active($previous_db);
  65. if ($exists) {
  66. $report_url = url("tripal_blast_report/".$node->analysis_id."/1/0/0/20");
  67. print "<td><a href=$report_url>View the best hit homology report</a></td>";
  68. } else {
  69. print "<td>The homology report is not available. Please submit a job to parse the best hit first.</td>";
  70. }
  71. ?>
  72. </tr>
  73. </table>
  74. <!-- End of tripal_analysis_blast theme-->
  75. </div>
  76. <?php endif; ?>
  77. <div class="content"><?php print $content?></div>
  78. <?php if (!$teaser): ?>
  79. <?php if ($links) { ?><div class="links"><?php print $links?></div><?php }; ?>
  80. <?php endif; ?>
  81. <?php if ($teaser): ?>
  82. <?php if ($links) { ?><div class="linksteaser"><div class="links"><?php print $links?></div></div><?php }; ?>
  83. <?php endif; ?>
  84. <?php if (!$teaser): ?>
  85. <?php if ($terms) { ?><div class="taxonomy"><span><?php print t('tags') ?></span> <?php print $terms?></div><?php } ?>
  86. <?php endif; ?>
  87. </div>