5 /chado/cvterm.mas - a component for printing the cvterm page
15 CXGN::Chado::Cvterm object
23 Naama Menda <nm249@cornell.edu>
35 use CXGN::Page::FormattingHelpers qw/
40 use CXGN::Phenome::Qtl::Tools;
45 my $cvterm_id = $cvterm->cvterm_id;
46 my $db_name = $cvterm->db->name;
47 my $accession = $cvterm->accession;
48 my $cvterm_name = $cvterm->name;
49 my $definition = $cvterm->definition;
50 my $is_variable = $cvterm->is_variable;
51 my $comment = '' ;#$cvterm->comment;
52 #$stockref->{props} (hash of arrayrefs of cvtermprops. Keys = prop name, value = prop value)
53 my $editable_cvterm_props_string = $cvtermref->{editable_cvterm_props};
54 my @editable_cvterm_props = split "," , $editable_cvterm_props_string;
57 my $is_obsolete = $cvterm->is_obsolete();
58 my @synonyms = $cvterm->synonyms();
59 my @def_dbxrefs = $cvterm->def_dbxrefs();
60 my @secondary_dbxrefs = $cvterm->secondary_dbxrefs();
61 my @image_ids = $cvterm->get_image_ids;
63 my $curator = $cvtermref->{curator};
64 my $submitter = $cvtermref->{submitter};
65 my $sequencer = $cvtermref->{sequencer};
66 my $cvtermprops = $cvtermref->{props};
70 if ( scalar (@def_dbxrefs ) > 0 ) {
71 # @def_accessions = map( $_->db->name . ":" . $_->accession , @def_dbxrefs);
74 my @secondary_accessions = ();
75 foreach ( @secondary_dbxrefs) {
76 my $db_name = $_->db->name;
77 my $acc = $_->accession;
78 my $urlprefix= $_->db->urlprefix;
79 my $url = $_->db->url;
80 my $full_acc = $db_name . ":" . $acc;
83 my $xref_link = $urlprefix . $url . $acc;
84 $link = qq | <a href="$xref_link">$full_acc</a> |
86 push @secondary_accessions , $link ;
89 my @qtl_pops = CXGN::Phenome::Qtl::Tools->new()->is_from_qtl( $cvterm_id );
94 foreach my $pop (@qtl_pops)
96 my $pop_id = $pop->get_population_id();
97 my $name = $pop->get_name();
98 my $desc = $pop->get_description();
99 my $qtl_link = qq | <a href="/phenome/qtl_analysis.pl?population_id=$pop_id&cvterm_id=$cvterm_id" onClick="Qtl.waitPage()">$name</a> |;
100 push @qtl_data, [ $qtl_link, $desc ];
104 my $this_page = "/cvterm/$cvterm_id/view/";
106 " <a href=\"/image/add?type_id=$cvterm_id&type=cvterm&refering_page=$this_page\">[Add image]</a>" ;
109 my $edit_privs = $curator ;
114 <& /util/import_javascript.mas, classes => [qw [CXGN.AJAX.Ontology CXGN.Phenome.Qtl thickbox jquery jquery.dataTables] ] &>
117 <script language="javascript">
118 function recursiveAnnotations( a ) {
119 jQuery.ajax( { url: a.url+"?cvterm_id=<% $cvterm_id %>" ,
121 success: function(response) {
122 //jQuery("#"+a.content_id).html(response.html);
123 jQuery("#"+a.count_id).html( response.count + ' ' + a.inflect[ response.count == 1 ? 0 : 1 ]);
124 if( response.error ) {
125 alert(response.error);
133 <& /page/page_title.mas, title=> "$accession '$cvterm_name' " &>
136 <&| /page/info_section.mas, title=>"Cvterm details" &>
138 <tr><td>Term id</td><td><b><% $accession %></b></td></tr>
139 <tr><td>Term name</td><td><b><% $cvterm_name %></b></td></tr>
140 <tr><td>Term definition</td><td><b><% $definition %></b></td></tr>
141 <tr><td>Comment</td><td><b><% $comment %></b></td></tr>
144 % if ($is_obsolete) {
145 <b>Obsolete:</b> TRUE <br />
148 <br /><b>Synoyms</b><br />
149 % foreach my $synonym (@synonyms) {
150 <% $synonym %> <br />
153 <br /><b> Definition dbxrefs</b><br />
154 % foreach my $da (@def_accessions) {
158 <br /><b> Related dbxrefs</b><br />
159 % foreach my $sa (@secondary_accessions) {
167 % my $props_subtitle = $edit_privs ? "[<a id=\"cvterm_add_props\" href=\"javascript:cvtermprops_addPropDialog()\">Add...</a>]" : "[Add]";
169 % if ($is_variable) {
170 <&| /page/info_section.mas, title => "Trait Properties" , collapsible=> 1, is_subsection => 1, subtitle=>$props_subtitle &>
171 <& /chado/cvtermprops.mas,
172 cv_name => 'trait_property',
173 cvterm_id =>$cvterm_id,
174 props => $cvtermprops,
175 div_name => 'cvtermprops',
176 edit_privs => $edit_privs,
177 subset => \@editable_cvterm_props,
178 editable => \@editable_cvterm_props &>
183 <&| /page/info_section.mas, title => "Trait Properties" , collapsible=> 1, is_collapsed => 1, is_subsection => 1, &>
184 No properties for traits. Trait properties can be set for variables only.
189 <div id="cvterm_id" style="display:none" ><% $cvterm_name %>|<% $accession %></div>
191 <&| /page/info_section.mas, title=>"Add this term to a list", collapsible=>1, collapsed=>1 &>
192 <div id="paste_to_list">
200 addToListMenu('paste_to_list', 'cvterm_id', { listType: 'traits' } );
203 jQuery('#paste_to_list').html(" Please log in to use lists.");
211 <& /ontology/embedded_browser.mas, cvterm => $cvterm &>
215 <&| /page/info_section.mas,
216 title=> "Annotated loci",
222 <table id="loci_data" class="display">
226 <th>Locus symbol</th>
235 jQuery(document).ready(function () {
237 jQuery('#loci_data').DataTable( {
238 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_loci',
249 <&| /page/info_section.mas,
250 title=> "Annotated stocks",
257 <table id="annotated_stocks_data" class="display">
270 jQuery(document).ready(function () {
272 jQuery('#annotated_stocks_data').DataTable( {
273 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_stocks',
286 <&| /page/info_section.mas,
287 title => "QTL analysis",
290 <& /page/columnar_table.mas,
291 headings => ["Analyze QTL in population", "Population description"],
301 <&| /page/info_section.mas,
302 title => "Phenotyped accessions",
309 <table id="phen_stocks_data" class="display">
322 jQuery(document).ready(function () {
324 jQuery('#phen_stocks_data').DataTable( {
325 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/phenotyped_stocks',
336 <&| /page/info_section.mas,
337 title => "Phenotyping trials",
340 subtitle => '<span id="trial_count"></span>',
343 <script language="javascript">
344 recursiveAnnotations({
345 url: "/cvterm/"+<% $cvterm_id %>+"/datatables/direct_trials",
346 content_id: "trial_div",
347 count_id: "trial_count",
348 inflect: [ 'trial', 'trials' ],
354 <table id="trial_data" class="display">
366 jQuery(document).ready(function () {
368 jQuery('#trial_data').DataTable( {
369 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/direct_trials',
378 <&| /page/info_section.mas,
379 title => "Images and figures",
380 subtitle => $image_subtitle,
386 <& /image/print_images.mas, images => \@image_ids &>
390 <& /qtl/waitmessage.mas &>