5 /chado/cvterm.mas - a component for printing the cvterm page
15 CXGN::Chado::Cvterm object
23 Naama Menda <nm249@cornell.edu>
34 use CXGN::Page::FormattingHelpers qw/
39 use CXGN::Phenome::Qtl::Tools;
43 my $cvterm_id = $cvterm->get_cvterm_id;
44 my $db_name = $cvterm->get_db_name;
45 my $accession = $cvterm->get_accession;
46 my $cvterm_name = $cvterm->get_cvterm_name;
47 my $definition = $cvterm->get_definition;
48 my $comment = $cvterm->comment;
50 my $is_obsolete = $cvterm->get_obsolete();
51 my @synonyms = $cvterm->get_synonyms();
52 my @def_dbxrefs = $cvterm->get_def_dbxref();
53 my @secondary_dbxrefs = $cvterm->get_secondary_dbxrefs();
54 my @image_ids = $cvterm->get_image_ids;
56 my @def_accessions = map( $_->get_db_name . ":" . $_->get_accession , @def_dbxrefs);
58 my @secondary_accessions = ();
59 foreach ( @secondary_dbxrefs) {
60 my $db = $_->get_db_name;
61 my $acc = $_->get_accession;
62 my $urlprefix= $_->get_urlprefix;
63 my $url = $_->get_url;
64 my $full_acc = $db . ":" . $acc;
67 my $xref_link = $urlprefix . $url . $acc;
68 $link = qq | <a href="$xref_link">$full_acc</a> |
70 push @secondary_accessions , $link ;
73 my @qtl_pops = CXGN::Phenome::Qtl::Tools->new()->is_from_qtl( $cvterm_id );
78 foreach my $pop (@qtl_pops)
80 my $pop_id = $pop->get_population_id();
81 my $name = $pop->get_name();
82 my $desc = $pop->get_description();
83 my $qtl_link = qq | <a href="/phenome/qtl_analysis.pl?population_id=$pop_id&cvterm_id=$cvterm_id" onClick="Qtl.waitPage()">$name</a> |;
84 push @qtl_data, [ $qtl_link, $desc ];
88 my $this_page = "/cvterm/$cvterm_id/view/";
90 " <a href=\"/image/add?type_id=$cvterm_id&type=cvterm&refering_page=$this_page\">[Add image]</a>" ;
96 <& /util/import_javascript.mas, classes => [qw [CXGN.AJAX.Ontology CXGN.Phenome.Qtl thickbox jquery jquery.dataTables] ] &>
99 <script language="javascript">
100 function recursiveAnnotations( a ) {
101 jQuery.ajax( { url: a.url+"?cvterm_id=<% $cvterm_id %>" ,
103 success: function(response) {
104 //jQuery("#"+a.content_id).html(response.html);
105 jQuery("#"+a.count_id).html( response.count + ' ' + a.inflect[ response.count == 1 ? 0 : 1 ]);
106 if( response.error ) {
107 alert(response.error);
115 <& /page/page_title.mas, title=> "$db_name:$accession '$cvterm_name' " &>
118 <&| /page/info_section.mas, title=>"Cvterm details" &>
120 <tr><td>Term id</td><td><b><% $accession %></b></td></tr>
121 <tr><td>Term name</td><td><b><% $cvterm_name %></b></td></tr>
122 <tr><td>Term definition</td><td><b><% $definition %></b></td></tr>
123 <tr><td>Comment</td><td><b><% $comment %></b></td></tr>
126 % if ($is_obsolete) {
127 <b>Obsolete:</b> TRUE <br />
130 <br /><b>Synoyms</b><br />
131 % foreach my $synonym (@synonyms) {
132 <% $synonym %> <br />
135 <br /><b> Definition dbxrefs</b><br />
136 % foreach my $da (@def_accessions) {
140 <br /><b> Related dbxrefs</b><br />
141 % foreach my $sa (@secondary_accessions) {
148 <h4>Add this term to a list</h4>
150 <div id="cvterm_id" style="display:none" ><% $cvterm_name %>|<% $db_name %>:<% $accession %></div>
152 <&| /page/info_section.mas, title=>"Add to list", collapsible=>1, collapsed=>1 &>
153 <div id="paste_to_list">
161 addToListMenu('paste_to_list', 'cvterm_id', { listType: 'traits' } );
164 jQuery('#paste_to_list').html(" Please log in to use lists.");
172 <& /ontology/embedded_browser.mas, cvterm => $cvterm &>
176 <&| /page/info_section.mas,
177 title=> "Annotated loci",
183 <table id="loci_data" class="display">
187 <th>Locus symbol</th>
196 jQuery(document).ready(function () {
198 jQuery('#loci_data').DataTable( {
199 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_loci',
210 <&| /page/info_section.mas,
211 title=> "Annotated stocks",
218 <table id="annotated_stocks_data" class="display">
231 jQuery(document).ready(function () {
233 jQuery('#annotated_stocks_data').DataTable( {
234 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_stocks',
247 <&| /page/info_section.mas,
248 title => "QTL analysis",
251 <& /page/columnar_table.mas,
252 headings => ["Analyze QTL in population", "Population description"],
262 <&| /page/info_section.mas,
263 title => "Phenotyped accessions",
270 <table id="phen_stocks_data" class="display">
283 jQuery(document).ready(function () {
285 jQuery('#phen_stocks_data').DataTable( {
286 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/phenotyped_stocks',
297 <&| /page/info_section.mas,
298 title => "Phenotyping trials",
301 subtitle => '<span id="trial_count"></span>',
304 <script language="javascript">
305 recursiveAnnotations({
306 url: "/cvterm/"+<% $cvterm_id %>+"/datatables/direct_trials",
307 content_id: "trial_div",
308 count_id: "trial_count",
309 inflect: [ 'trial', 'trials' ],
315 <table id="trial_data" class="display">
327 jQuery(document).ready(function () {
329 jQuery('#trial_data').DataTable( {
330 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/direct_trials',
339 <&| /page/info_section.mas,
340 title => "Images and figures",
341 subtitle => $image_subtitle,
347 <& /image/print_images.mas, images => \@image_ids &>
351 <& /qtl/waitmessage.mas &>