tripal_analysis_blast_results.tpl.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. $blast_object_array = $variables['blast_object'];
  3. ?>
  4. <div id="tripal_ajaxLoading" style="display:none">
  5. <div id="loadingText">Loading...</div>
  6. <img src="sites/all/themes/theme_tripal/images/ajax-loader.gif">
  7. </div>
  8. <?php
  9. if($blast_object_array){
  10. foreach ($blast_object_array as $blast_object) {
  11. $hits_array = $blast_object->hits_array;
  12. $db = $blast_object->db;
  13. ?>
  14. <div id="tripal_analysis_blast-results-box" class="tripal_analysis_blast-box tripal-info-box">
  15. <div class="tripal_analysis_blast-info-box-title tripal-info-box-title"><h3><?php print $blast_object->title ?></h3></div>
  16. <div class="tripal_analysis_blast-info-box-desc tripal-info-box-desc" id="blast_db_<?php print "$db->db_id" ?>">
  17. <strong>Analysis Date: </strong><?php print "$blast_object->ana_time (<a href=node/$blast_object->ana_nid>$blast_object->ana_name</a>)"?><br>
  18. Query: <?php print "$blast_object->xml_tag"?><br>
  19. <?php if($blast_object->max != 10){ ?>
  20. <span><a onclick="return tripal_update_blast(this,<?php print $db->db_id?>)" href="tripal_top_blast/<?php print "$blast_object->feature_id/$db->db_id/10" ?>>Show Best 10 Hits</a></span>";
  21. <?php } else { ?>
  22. <span>Best 10 Hits Shown</span>
  23. <?php } ?>
  24. <?php if($blast_object->number_hits <= 10){ ?>
  25. <?php } else if ($blast_object->max != 25) { ?>
  26. <span> | <a onclick="return tripal_update_blast(this,<?php print"$db->db_id"?>)" href="tripal_top_blast/<?php print "$blast_object->feature_id/$db->db_id/25"?>">Show Best 25 Hits</a></span>
  27. <?php }else { ?>
  28. <span> | Best 25 Hits Shown</span>
  29. <?php } ?>
  30. <?php if($blast_object->number_hits <= 25){ ?>
  31. <?php } else if ($blast_object->max != 0) {
  32. $url = url("tripal_top_blast/$feature_id/$db->db_id/0");
  33. ?>
  34. <span> | <a onclick="return tripal_update_blast(this, <?php print $db->db_id ?>)" href="<?php print "tripal_top_blast/$blast_object->feature_id/$db->db_id/0"?>">Show All Hits</a> </span>
  35. <?php } else { ?>
  36. <span> | All Hits Shown</span>
  37. <?php } ?>
  38. <br><span><i>Note:</i> Click a description for more details</span>
  39. <span>
  40. <table class="tripal_analysis_blast-table">
  41. <tr>
  42. <th nowrap>Match Name</th>
  43. <th nowrap>E value</th>
  44. <th nowrap>Identity</th>
  45. <th nowrap>Description</th>
  46. </tr>
  47. <?php
  48. foreach($hits_array AS $hit) {
  49. ?>
  50. <tr>
  51. <?php if ($hit['hit_url']) { ?>
  52. <td><a href="<?php print $hit['hit_url']?>" target="_blank"><?php print $hit['hit_name']?></a></td>
  53. <?php } else {?>
  54. <td><?php print $hit['hit_name'] ?></td>
  55. <?php } ?>
  56. <td nowrap><?php print $hit['best_evalue']?></td>
  57. <td nowrap><?php print $hit['percent_identity']?></td>
  58. <td nowrap><?php print $hit['description']?></td>
  59. </tr>
  60. <tr>
  61. <td colspan=4>
  62. <a class="blast-hit-arrow-icon"><img src=<?php print $hit['arrowr_url']?> align="top"> View Alignment</a>
  63. <div class="tripal_analysis_blast-info-hsp-title"></div>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td colspan=4>
  68. <?php
  69. $hsps_array = $hit['hsp'];
  70. foreach ($hsps_array AS $hsp) { ?>
  71. <div class="tripal_analysis_blast-info-hsp-desc">
  72. <b>HSP <?php print $hsp['hsp_num'] ?></b>
  73. <pre>Score: <?php print $hsp['bit_score'] ?> bits (<?php print $hsp['score'] ?>), Expect = <?php print $hsp['evalue'] ?><br>Identity = <?php print sprintf("%d/%d (%.2f%%)", $hsp['identity'], $hsp['align_len'], $hsp['identity']/$hsp['align_len']*100) ?>, Postives = <?php print sprintf("%d/%d (%.2f%%)", $hsp['positive'], $hsp['align_len'], $hsp['positive']/$hsp['align_len']*100)?>, Query Frame = <?php print $hsp['query_frame']?></a><br><br></a>Query: <?php print sprintf("%4d", $hsp['query_from'])?> <?php print $hsp['qseq'] ?> <?php print sprintf("%d", $hsp['query_to']); ?><br> <?php print $hsp['midline'] ?><br>Sbjct: <?php print sprintf("%4d", $hsp['hit_from']) ?> <?php print $hsp['hseq']?> <?php print sprintf("%d",$hsp['hit_to']) ?></pre><br>
  74. </div>
  75. <?php } ?>
  76. </td>
  77. </tr>
  78. <?php } ?>
  79. </table>
  80. </span>
  81. </div>
  82. </div>
  83. <?php } ?>
  84. <?php } ?>