tripal_feature_interpro_results.tpl.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. $results = $variables['tripal_analysis_interpro']['results'];
  3. $feature = $variables['node']->feature;
  4. //dpm($results);
  5. if($feature->cvname != 'gene' and count($results) > 0){
  6. $i = 0;
  7. foreach($results as $analysis_id => $analysisprops){
  8. $analysis = $analysisprops['analysis'];
  9. $protein_ORFs = $analysisprops['protein_ORFs'];
  10. $terms = $analysisprops['allterms'];
  11. ?>
  12. <div id="tripal_feature-interpro_results_<?php print $i?>-box" class="tripal_analysis_interpro-box tripal-info-box">
  13. <div class="tripal_feature-info-box-title tripal-info-box-title">InterPro Report <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?></div>
  14. <div class="tripal_feature-info-box-desc tripal-info-box-desc"><?php
  15. if($analysis->nid){ ?>
  16. Analysis name: <a href="<?php print url('node/'.$analysis->nid) ?>"><?php print $analysis->name?></a><?php
  17. } else { ?>
  18. Analysis name: <?php print $analysis->name;
  19. } ?><br>
  20. Date Performed: <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?>
  21. </div>
  22. <div class="tripal_feature-interpro_results_subtitle">Summary of Annotated IPR terms</div>
  23. <table id="tripal_feature-interpro_summary-<?php $i ?>-table" class="tripal_analysis_interpro-summary-table tripal-table tripal-table-horz">
  24. <tr>
  25. <th>Term</td>
  26. <th>Name</td>
  27. </tr>
  28. <?php
  29. $j=0;
  30. foreach($terms as $term){
  31. $ipr_id = $term[0];
  32. $ipr_name = $term[1];
  33. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  34. if($j % 2 == 0 ){
  35. $class = 'tripal_feature-table-even-row tripal-table-even-row';
  36. }?>
  37. <tr class="<?php print $class ?>">
  38. <td><?php print $ipr_id ?></td>
  39. <td><?php print $ipr_name ?></td>
  40. </tr>
  41. <?php
  42. $j++;
  43. } ?>
  44. </table>
  45. <br><br>
  46. <div class="tripal_feature-interpro_results_subtitle">Analysis Details</div>
  47. <table id="tripal_feature-interpro_results-<?php $i ?>-table" class="tripal-table tripal_feature_interpro-results-table tripal-table-horz" style="border-top: 0px; border-bottom: 0px">
  48. <?php
  49. foreach($protein_ORFs as $orf){
  50. $terms = $orf['terms'];
  51. $orf = $orf['orf'];
  52. ?>
  53. <?php foreach($terms as $term){
  54. $matches = $term['matches'];
  55. $ipr_id = $term['ipr_id'];
  56. $ipr_name = $term['ipr_name'];
  57. $ipr_type = $term['ipr_type']; ?>
  58. <tr>
  59. <td colspan="4" style="padding-left: 0px">ORF: <?php print $orf['orf_id'] ?>, Length: <?php print $orf['orf_length'] ?> <br>
  60. IPR Term: <?php print "$ipr_id $ipr_name ($ipr_type)"; ?></th>
  61. </tr>
  62. <tr style="border-top: solid 1px;">
  63. <th>Method</th>
  64. <th>Identifier</th>
  65. <th>Description</th>
  66. <th>Matches</th>
  67. </tr>
  68. <?php $j = 0;
  69. foreach ($matches as $match){
  70. $match_id = $match['match_id'];
  71. $match_name = $match['match_name'];
  72. $match_dbname = $match['match_dbname'];
  73. $match_start = $match['match_start'];
  74. $match_end = $match['match_end'];
  75. $match_score = $match['match_score'];
  76. $match_status = $match['match_status'];
  77. $match_evidence = $match['match_evidence'];
  78. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  79. if($j % 2 == 0 ){
  80. $class = 'tripal_feature-table-even-row tripal-table-even-row';
  81. }?>
  82. <tr class="<?php print $class ?>">
  83. <td><?php print $match_dbname ?></td>
  84. <td><?php print $match_id ?></td>
  85. <td><?php print $match_name ?></td>
  86. <td nowrap>Score: <?php print $match_score ?> <br>
  87. Position: <?php print $match_start ?>..<?php print $match_end ?><br>
  88. Status: <?php print $match_status ?></td>
  89. </tr>
  90. <?php
  91. $j++;
  92. } // end foreach matches ?>
  93. <tr><td colspan="4">&nbsp;</td></tr> <?php
  94. } // end foreach terms
  95. $i++;
  96. } // end foreach orfs ?>
  97. </table>
  98. </div> <?php
  99. } // end for each analysis
  100. } // end if
  101. ?>