tripal_feature_interpro_results.tpl.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. $results = $variables['tripal_analysis_interpro']['results']['xml'];
  3. $resultsHTML = $variables['tripal_analysis_interpro']['results']['html'];
  4. $feature = $variables['node']->feature;
  5. if(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<sup>*</sup></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. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  74. if($j % 2 == 0 ){
  75. $class = 'tripal_feature-table-even-row tripal-table-even-row';
  76. }?>
  77. <tr class="<?php print $class ?>">
  78. <td><?php print $match_dbname ?></td>
  79. <td><?php print $match_id ?></td>
  80. <td><?php print $match_name ?></td>
  81. <td nowrap><?php
  82. $locations = $match['locations'];
  83. foreach($locations as $location){
  84. print $location['match_score']." [".$location['match_start']."-".$location['match_end']."] " . $location['match_status'] ."<br>";
  85. #$match_evidence = $location['match_evidence'];
  86. } ?>
  87. </td>
  88. </tr>
  89. <?php
  90. $j++;
  91. } // end foreach matches ?>
  92. <tr><td colspan="4"><sup>* score [start-end] status</sup></td></tr> <?php
  93. } // end foreach terms
  94. $i++;
  95. } // end foreach orfs ?>
  96. </table>
  97. </div> <?php
  98. } // end for each analysis
  99. } // end if
  100. if($resultsHTML){ ?>
  101. <div id="tripal_feature-interpro_results_<?php print $i?>-box" class="tripal_analysis_interpro-box tripal-info-box">
  102. <div class="tripal_feature-info-box-title tripal-info-box-title">InterPro Report <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?></div>
  103. <div class="tripal_feature-info-box-desc tripal-info-box-desc"><?php
  104. if($analysis->nid){ ?>
  105. Analysis name: <a href="<?php print url('node/'.$analysis->nid) ?>"><?php print $analysis->name?></a><?php
  106. } else { ?>
  107. Analysis name: <?php print $analysis->name;
  108. } ?><br>
  109. Date Performed: <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?>
  110. </div>
  111. <div class="tripal_feature-interpro_results_subtitle">Summary of Annotated IPR terms</div> <?php
  112. print $resultsHTML;?>
  113. </div> <?php
  114. }
  115. ?>