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);
59 my @qtl_pops = CXGN::Phenome::Qtl::Tools->new()->is_from_qtl( $cvterm_id );
64 foreach my $pop (@qtl_pops)
66 my $pop_id = $pop->get_population_id();
67 my $name = $pop->get_name();
68 my $desc = $pop->get_description();
69 my $qtl_link = qq | <a href="/phenome/qtl_analysis.pl?population_id=$pop_id&cvterm_id=$cvterm_id" onClick="Qtl.waitPage()">$name</a> |;
70 push @qtl_data, [ $qtl_link, $desc ];
74 my $this_page = "/cvterm/$cvterm_id/view/";
76 " <a href=\"/image/add?type_id=$cvterm_id&type=cvterm&refering_page=$this_page\">[Add image]</a>" ;
82 <& /util/import_javascript.mas, classes => [qw [CXGN.AJAX.Ontology CXGN.Phenome.Qtl thickbox jquery jquery.dataTables] ] &>
85 <script language="javascript">
86 function recursiveAnnotations( a ) {
87 jQuery.ajax( { url: a.url+"?cvterm_id=<% $cvterm_id %>" ,
89 success: function(response) {
90 //jQuery("#"+a.content_id).html(response.html);
91 jQuery("#"+a.count_id).html( response.count + ' ' + a.inflect[ response.count == 1 ? 0 : 1 ]);
92 if( response.error ) {
93 alert(response.error);
101 <& /page/page_title.mas, title=> "$db_name:$accession '$cvterm_name' " &>
104 <&| /page/info_section.mas, title=>"Cvterm details" &>
106 <tr><td>Term id</td><td><b><% $accession %></b></td></tr>
107 <tr><td>Term name</td><td><b><% $cvterm_name %></b></td></tr>
108 <tr><td>Term definition</td><td><b><% $definition %></b></td></tr>
109 <tr><td>Comment</td><td><b><% $comment %></b></td></tr>
112 % if ($is_obsolete) {
113 <b>Obsolete:</b> TRUE <br />
116 <br /><b>Synoyms</b><br />
117 % foreach my $synonym (@synonyms) {
118 <% $synonym %> <br />
121 <br /><b> Definition dbxrefs</b><br />
122 % foreach my $da (@def_accessions) {
126 <br /><b> Definition dbxrefs</b><br />
127 % foreach my $ds (@secondary_dbxrefs) {
134 <h4>Add this term to a list</h4>
136 <div id="cvterm_id" style="display:none" ><% $cvterm_name %>|<% $db_name %>:<% $accession %></div>
138 <&| /page/info_section.mas, title=>"Add to list", collapsible=>1, collapsed=>1 &>
139 <div id="paste_to_list">
147 addToListMenu('paste_to_list', 'cvterm_id', { listType: 'traits' } );
150 jQuery('#paste_to_list').html(" Please log in to use lists.");
158 <& /ontology/embedded_browser.mas, cvterm => $cvterm &>
162 <&| /page/info_section.mas,
163 title=> "Annotated loci",
169 <table id="loci_data" class="display">
173 <th>Locus symbol</th>
182 jQuery(document).ready(function () {
184 jQuery('#loci_data').DataTable( {
185 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_loci',
196 <&| /page/info_section.mas,
197 title=> "Annotated stocks",
204 <table id="annotated_stocks_data" class="display">
217 jQuery(document).ready(function () {
219 jQuery('#annotated_stocks_data').DataTable( {
220 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_stocks',
233 <&| /page/info_section.mas,
234 title => "QTL analysis",
237 <& /page/columnar_table.mas,
238 headings => ["Analyze QTL in population", "Population description"],
248 <&| /page/info_section.mas,
249 title => "Phenotyped accessions",
256 <table id="phen_stocks_data" class="display">
269 jQuery(document).ready(function () {
271 jQuery('#phen_stocks_data').DataTable( {
272 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/phenotyped_stocks',
283 <&| /page/info_section.mas,
284 title => "Phenotyping trials",
287 subtitle => '<span id="trial_count"></span>',
290 <script language="javascript">
291 recursiveAnnotations({
292 url: "/cvterm/"+<% $cvterm_id %>+"/datatables/direct_trials",
293 content_id: "trial_div",
294 count_id: "trial_count",
295 inflect: [ 'trial', 'trials' ],
301 <table id="trial_data" class="display">
313 jQuery(document).ready(function () {
315 jQuery('#trial_data').DataTable( {
316 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/direct_trials',
325 <&| /page/info_section.mas,
326 title => "Images and figures",
327 subtitle => $image_subtitle,
333 <& /image/print_images.mas, images => \@image_ids &>
337 <& /qtl/waitmessage.mas &>