tripal_feature_blast_results.tpl.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. $feature = $variables['node']->feature;
  3. $blast_results_list = $variables['tripal_analysis_blast']['blast_results_list'];
  4. ?>
  5. <div id="tripal_ajaxLoading" style="display:none">
  6. <div id="loadingText">Loading...</div>
  7. <img src="sites/all/themes/theme_tripal/images/ajax-loader.gif">
  8. </div>
  9. <?php
  10. if(count($blast_results_list) > 0){
  11. foreach ($blast_results_list as $blast_result) {
  12. $hits_array = $blast_result->hits_array;
  13. $db = $blast_result->db;
  14. $analysis = $blast_result->analysis;
  15. ?>
  16. <div id="blast_db_<?php print $db->db_id ?>">
  17. <div id="tripal_analysis_blast-results-<?php print "$db->db_id" ?>-box" class="tripal_analysis_blast-box tripal-info-box">
  18. <div class="tripal-info-box-title tripal_analysis_blast-info-box-title"><?php print $db->name ?> Homologs</div>
  19. <div class="tripal-info-box-desc tripal_analysis_blast-info-box-desc">
  20. <strong>Analysis Date: </strong><?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted) . " (<a href=".url("node/$analysis->nid").">$analysis->name</a>)"?><br>
  21. <!--Query: <?php print "$blast_result->xml_tag"?><br>-->
  22. <?php
  23. if($blast_result->max != 10){
  24. $url = url("tripal_top_blast/$feature->feature_id/$db->db_id/10");
  25. ?><span><a onclick="return tripal_update_blast(this,<?php print $db->db_id?>)" href="<?php print $url ?>">Show Best 10 Hits</a></span><?php
  26. } else {
  27. ?><span>Best 10 Hits Shown</span><?php
  28. }
  29. if($blast_result->number_hits <= 10){
  30. }
  31. else if ($blast_result->max != 25) {
  32. $url = url("tripal_top_blast/$feature->feature_id/$db->db_id/25");
  33. ?><span> | <a onclick="return tripal_update_blast(this,<?php print"$db->db_id"?>)" href="<?php print $url ?>">Show Best 25 Hits</a></span><?php
  34. }else {
  35. ?><span> | Best 25 Hits Shown</span><?php
  36. }
  37. if($blast_result->number_hits <= 25){
  38. }
  39. else if ($blast_result->max != 0) {
  40. $url = url("tripal_top_blast/$feature->feature_id/$db->db_id/all");
  41. ?><span> | <a onclick="return tripal_update_blast(this, <?php print $db->db_id ?>)" href="<?php print $url ?>">Show All Hits</a> </span><?php
  42. } else {
  43. ?><span> | All Hits Shown</span><?php
  44. }
  45. ?>
  46. <br><br><span>Click a description for more details</span>
  47. </div>
  48. <table id="tripal_analysis_blast-table" class="tripal-table tripal-table-horz tripal_analysis_blast-table">
  49. <tr>
  50. <th>&nbsp;</th>
  51. <th nowrap>Match Name</th>
  52. <th nowrap>E value</th>
  53. <th nowrap>Identity</th>
  54. <th nowrap>Description</th>
  55. </tr>
  56. <?php
  57. $i = 0;
  58. foreach($hits_array AS $hit) {
  59. $class = 'tripal-table-odd-row tripal_analysis_blast-table-odd-row';
  60. if($i % 2 == 0 ){
  61. $class = 'tripal-table-even-row tripal_analysis_blast-table-odd-row';
  62. }?>
  63. <tr class="<?php print $class ?> tripal_analysis_blast-result-first-row">
  64. <td><?php print $i+1 ?>.</td>
  65. <?php if ($hit['hit_url']) { ?>
  66. <td><a href="<?php print $hit['hit_url']?>" target="_blank"><?php print $hit['hit_name']?></a></td>
  67. <?php } else {?>
  68. <td><?php print $hit['hit_name'] ?></td>
  69. <?php } ?>
  70. <td nowrap><?php print $hit['best_evalue']?></td>
  71. <td nowrap><?php print $hit['percent_identity']?></td>
  72. <td><?php print $hit['description']?></td>
  73. </tr>
  74. <tr class="<?php print $class ?>">
  75. <td colspan=5>
  76. <a class="blast-hit-arrow-icon" onclick="return tripal_blast_toggle_alignment(<?php print $analysis->analysis_id ?>,<?php print $i?>)"><img id="tripal_analysis_blast-info-toggle-image-<?php print $analysis->analysis_id ?>-<?php print $i?>" src=<?php print $hit['arrowr_url']?> align="top"> View Alignment</a>
  77. <div class="tripal_analysis_blast-info-hsp-title"></div>
  78. </td>
  79. </tr>
  80. <tr class="<?php print $class ?> tripal_analysis_blast-result-last-row">
  81. <td colspan=5>
  82. <?php
  83. $hsps_array = $hit['hsp'];
  84. foreach ($hsps_array AS $hsp) { ?>
  85. <div class="tripal_analysis_blast-info-hsp-desc" id="tripal_analysis_blast-info-hsp-desc-<?php print $analysis->analysis_id ?>-<?php print $i?>">
  86. &nbsp;HSP <?php print $hsp['hsp_num'] ?>
  87. <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>
  88. </div>
  89. <?php } ?>
  90. </td>
  91. </tr>
  92. <?php $i++;
  93. } ?>
  94. </table>
  95. </div>
  96. </div>
  97. <?php } ?>
  98. <?php } ?>