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 $comment = '' ;#$cvterm->comment;
51 #$stockref->{props} (hash of arrayrefs of cvtermprops. Keys = prop name, value = prop value)
52 my $editable_cvterm_props_string = $cvtermref->{editable_cvterm_props};
53 my @editable_cvterm_props = split "," , $editable_cvterm_props_string;
56 my $is_obsolete = $cvterm->is_obsolete();
57 my @synonyms = $cvterm->synonyms();
58 my @def_dbxrefs = $cvterm->def_dbxrefs();
59 my @secondary_dbxrefs = $cvterm->secondary_dbxrefs();
60 my @image_ids = $cvterm->get_image_ids;
62 my $curator = $cvtermref->{curator};
63 my $submitter = $cvtermref->{submitter};
64 my $sequencer = $cvtermref->{sequencer};
65 my $cvtermprops = $cvtermref->{props};
69 if ( scalar (@def_dbxrefs ) > 0 ) {
70 # @def_accessions = map( $_->db->name . ":" . $_->accession , @def_dbxrefs);
73 my @secondary_accessions = ();
74 foreach ( @secondary_dbxrefs) {
75 my $db_name = $_->db->name;
76 my $acc = $_->accession;
77 my $urlprefix= $_->db->urlprefix;
78 my $url = $_->db->url;
79 my $full_acc = $db_name . ":" . $acc;
82 my $xref_link = $urlprefix . $url . $acc;
83 $link = qq | <a href="$xref_link">$full_acc</a> |
85 push @secondary_accessions , $link ;
88 my @qtl_pops = CXGN::Phenome::Qtl::Tools->new()->is_from_qtl( $cvterm_id );
93 foreach my $pop (@qtl_pops)
95 my $pop_id = $pop->get_population_id();
96 my $name = $pop->get_name();
97 my $desc = $pop->get_description();
98 my $qtl_link = qq | <a href="/phenome/qtl_analysis.pl?population_id=$pop_id&cvterm_id=$cvterm_id" onClick="Qtl.waitPage()">$name</a> |;
99 push @qtl_data, [ $qtl_link, $desc ];
103 my $this_page = "/cvterm/$cvterm_id/view/";
105 " <a href=\"/image/add?type_id=$cvterm_id&type=cvterm&refering_page=$this_page\">[Add image]</a>" ;
108 my $edit_privs = $curator || $submitter || $sequencer;
113 <& /util/import_javascript.mas, classes => [qw [CXGN.AJAX.Ontology CXGN.Phenome.Qtl thickbox jquery jquery.dataTables] ] &>
116 <script language="javascript">
117 function recursiveAnnotations( a ) {
118 jQuery.ajax( { url: a.url+"?cvterm_id=<% $cvterm_id %>" ,
120 success: function(response) {
121 //jQuery("#"+a.content_id).html(response.html);
122 jQuery("#"+a.count_id).html( response.count + ' ' + a.inflect[ response.count == 1 ? 0 : 1 ]);
123 if( response.error ) {
124 alert(response.error);
132 <& /page/page_title.mas, title=> "$accession '$cvterm_name' " &>
135 <&| /page/info_section.mas, title=>"Cvterm details" &>
137 <tr><td>Term id</td><td><b><% $accession %></b></td></tr>
138 <tr><td>Term name</td><td><b><% $cvterm_name %></b></td></tr>
139 <tr><td>Term definition</td><td><b><% $definition %></b></td></tr>
140 <tr><td>Comment</td><td><b><% $comment %></b></td></tr>
143 % if ($is_obsolete) {
144 <b>Obsolete:</b> TRUE <br />
147 <br /><b>Synoyms</b><br />
148 % foreach my $synonym (@synonyms) {
149 <% $synonym %> <br />
152 <br /><b> Definition dbxrefs</b><br />
153 % foreach my $da (@def_accessions) {
157 <br /><b> Related dbxrefs</b><br />
158 % foreach my $sa (@secondary_accessions) {
166 % my $props_subtitle = $edit_privs ? "[<a id=\"cvterm_add_props\" href=\"javascript:cvtermprops_addPropDialog()\">Add...</a>]" : "[Add]";
168 <&| /page/info_section.mas, title => "Trait Properties" , collapsible=> 1, is_subsection => 1, subtitle=>$props_subtitle &>
169 <& /chado/cvtermprops.mas,
170 cv_name => 'trait_property',
171 cvterm_id =>$cvterm_id,
172 props => $cvtermprops,
173 div_name => 'cvtermprops',
174 edit_privs => $edit_privs,
175 subset => \@editable_cvterm_props,
176 editable => \@editable_cvterm_props &>
179 <h4>Add this term to a list</h4>
181 <div id="cvterm_id" style="display:none" ><% $cvterm_name %>|<% $accession %></div>
183 <&| /page/info_section.mas, title=>"Add to list", collapsible=>1, collapsed=>1 &>
184 <div id="paste_to_list">
192 addToListMenu('paste_to_list', 'cvterm_id', { listType: 'traits' } );
195 jQuery('#paste_to_list').html(" Please log in to use lists.");
203 <& /ontology/embedded_browser.mas, cvterm => $cvterm &>
207 <&| /page/info_section.mas,
208 title=> "Annotated loci",
214 <table id="loci_data" class="display">
218 <th>Locus symbol</th>
227 jQuery(document).ready(function () {
229 jQuery('#loci_data').DataTable( {
230 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_loci',
241 <&| /page/info_section.mas,
242 title=> "Annotated stocks",
249 <table id="annotated_stocks_data" class="display">
262 jQuery(document).ready(function () {
264 jQuery('#annotated_stocks_data').DataTable( {
265 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/annotated_stocks',
278 <&| /page/info_section.mas,
279 title => "QTL analysis",
282 <& /page/columnar_table.mas,
283 headings => ["Analyze QTL in population", "Population description"],
293 <&| /page/info_section.mas,
294 title => "Phenotyped accessions",
301 <table id="phen_stocks_data" class="display">
314 jQuery(document).ready(function () {
316 jQuery('#phen_stocks_data').DataTable( {
317 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/phenotyped_stocks',
328 <&| /page/info_section.mas,
329 title => "Phenotyping trials",
332 subtitle => '<span id="trial_count"></span>',
335 <script language="javascript">
336 recursiveAnnotations({
337 url: "/cvterm/"+<% $cvterm_id %>+"/datatables/direct_trials",
338 content_id: "trial_div",
339 count_id: "trial_count",
340 inflect: [ 'trial', 'trials' ],
346 <table id="trial_data" class="display">
358 jQuery(document).ready(function () {
360 jQuery('#trial_data').DataTable( {
361 'ajax': '/cvterm/'+ <% $cvterm_id %> + '/datatables/direct_trials',
370 <&| /page/info_section.mas,
371 title => "Images and figures",
372 subtitle => $image_subtitle,
378 <& /image/print_images.mas, images => \@image_ids &>
382 <& /qtl/waitmessage.mas &>