5 /locus/index.mas - a page for displaying locus details
15 a hashref with all the parameters needed for printing the locus page!
21 $locusref->{curator} (boolean)
22 $locusref->{submitter} (boolean)
23 $locusref->{is_owner} (boolean)
26 locus_autocomplete_uri => '/ajax/locus/autocomplete/'
28 cvterm_autocomplete_uri => '/ajax/cvterm/autocomplete/'
34 Naama Menda <nm249@cornell.edu>
44 $locus_autocomplete_uri => undef
46 $cvterm_autocomplete_uri => undef
47 $trait_db_name => 'SP'
51 use CXGN::Sunshine::Browser;
52 use CXGN::Page::FormattingHelpers qw / html_optional_show info_table_html /;
57 my $locus = $locusref->{locus};
58 my $locus_id = $locusref->{locus_id};
59 my $action = $locusref->{action} || 'view';
60 my $person_id = $locusref->{person_id};
61 my $curator = $locusref->{curator};
62 my $submitter = $locusref->{submitter};
63 my $sequencer = $locusref->{sequencer};
64 my $is_owner = $locusref->{is_owner};
65 my $owners = $locusref->{owners};
66 my $dbh = $locusref->{dbh};
67 my $xrefs = $locusref->{xrefs};
68 my $feature = $locusref->{feature};
69 my $src_feature = $locusref->{src_feature};
72 my $pubs = $locusref->{pubs};
73 # dbxrefs, unigenes , ontology
75 my $this_page = "/locus/$locus_id/view/";
77 my $locus_xml = $locus_id ? qq |<a href = "/phenome/generic_gene_page.pl?locus_id=$locus_id">Download GMOD XML</a>|
78 : qq |<span class="ghosted">Download GMOD XML</span>|;
80 qq |<a href="/phenome/editors_note.pl">Note to Editors</a>|;
82 qq|<a href="http://docs.google.com/View?docid=ddhncntn_0cz2wj6">Annotation guidelines</a>|;
84 my $common_name = $locus->get_common_name();
85 my @owners = $locus->get_owners();
86 my $owner_objects= $locus->get_owners(1);
88 my $locus_name = $locus->get_locus_name();
90 my $registry = $locus->get_associated_registry();
91 my $registry_subtitle = $is_owner && $locus_id ? '<a href="javascript:Tools.toggleContent(\'associateRegistryForm\', \'locus_registry\')">[Associate a registry name with this locus]</a> '
92 : qq|<span class = "ghosted"> [Associate registry name]</span>| ;
94 my @synonyms = $locus->get_locus_aliases('f','f');
95 my @figures = $locus->get_figure_ids();
98 $curator || $submitter || $sequencer ?
99 " <a href=\"/image/add?type_id=$locus_id&type=locus&action=new&refering_page=$this_page\">[ Add notes, figures or images]</a>" : "<span class= \"ghosted\">[Add notes, figures or images]</span> " ;
101 my $stock_subtitle = $curator || $submitter || $sequencer ?
102 '<a href="javascript:Tools.toggleContent(\'associateStockForm\', \'locus_accessions\')">[Associate accession]</a> ' : '<span class= "ghosted">[Associate accession]</span> ';
104 my $accessions = $locus->get_stock_ids;
106 my @alleles = $locus->get_alleles(); #array of allele objects
108 my $allele_subtitle = $curator || $submitter || $sequencer ?
109 "<a href=\"/phenome/allele.pl?locus_id=$locus_id&action=new\">[Add new allele]</a>" :
110 '<span class="ghosted">[Add new Allele]</span>' ;
112 my $al_subtitle = $curator || $submitter || $sequencer ?
113 '<a href="javascript:Tools.toggleContent(\'associateLocusForm\', \'locus_network\');Tools.getOrganisms()">[Associate new locus]</a> ' :
114 '<span class="ghosted">[Associate new locus]</span>' ;
116 my $collapsed = $locus->count_associated_loci() ? 1 : 0 ;
118 my $network_sub = $collapsed ?
119 "View <b>$locus_name</b> relationships in the stand-alone <a href=\"/tools/networkbrowser/?type=locus&name=$locus_id\">network browser</a>" : '';
121 my $new_unigene_link = $curator || $submitter || $sequencer ?
122 '<a href="javascript:Tools.toggleContent(\'associateUnigeneForm\', \'locus_unigenes\' )">[Associate new unigene]</a>' :
123 '<span class= "ghosted">[Associate new unigene]</span> ';
124 my $new_genbank_link = qq | <a href="/chado/add_feature.pl?type=locus;type_id=$locus_id;refering_page=$this_page;action=new">[Associate new genbank sequence]</a> | ;
125 my %dbxrefs = $locus->get_all_dbxrefs();
128 foreach ( @{ $dbxrefs{'tgrc'} } ) {
129 if ( $_->[1] eq '0' ) {
130 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
131 my $accession = $_->[0]->get_accession();
133 qq|<br>$locus_name is a <a href="$url$accession" target="blank">TGRC gene</a><br />|;
137 foreach ( @{ $dbxrefs{'TAIR locus'} } ) {
138 if ( $_->[1] eq '0' ) {
139 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
140 my $accession = $_->[0]->get_accession();
142 qq|<br>$locus_name is a <a href="$url$accession" target="blank">TAIR locus</a><br />|;
146 my @sorted_pubs = $dbxrefs{PMID} ? sort { $a->[0]->get_accession() <=> $b->[0]->get_accession() } @{ $dbxrefs{PMID} } : () ;
148 my @sgn_ref = $dbxrefs{SGN_ref} ? @{ $dbxrefs{SGN_ref} } : () ;
150 @sorted_pubs = ( @sorted_pubs, @sgn_ref );
151 my $pub_count = scalar (@sorted_pubs) ;
153 my $pub_subtitle = $curator || $submitter || $sequencer ?
154 qq|<a href="/chado/add_publication.pl?type=locus&type_id=$locus_id&refering_page=$this_page&action=new"> [Associate publication] </a>| :
155 qq|<span class=\"ghosted\">[Associate publication]</span>|;
158 qq | <a href="javascript:void(0)"onclick="window.open('/phenome/locus_pub_rank.pl?locus_id=$locus_id','publication_list','width=600,height=400,status=1,location=1,scrollbars=1')">[Matching publications]</a> |;
160 my ($genbank, $gb_count);
161 foreach my $g ( @{ $dbxrefs{'DB:GenBank_GI'} } ) {
162 if ( $g->[1] eq '0' ) {
163 my $url = $g->[0]->get_urlprefix() . $g->[0]->get_url();
164 my $feature = CXGN::Chado::Feature->new_with_accession($dbh, $g->[0]->get_accession);
165 my $gb_accession = $feature->get_name;
166 my $description = $g->[0]->get_description();
167 my $feature_seq = $feature->get_residues;
168 my $blast_link = qq |
169 <form style="display: inline" method="post" action="/tools/blast"><input type="hidden" name="seq" value=">$gb_accession ($description)\n$feature_seq" /><input style="padding: 1px; line-height: 0.8" type="submit" value="BLAST" /></form>
173 qq|<a href="$url$gb_accession" target="blank">$gb_accession</a> $description $blast_link<br />|;
177 my $ont_count = $locus->count_ontology_annotations();
179 my $ontology_subtitle = $curator || $submitter || $sequencer ?
180 qq|<a href="javascript:Tools.toggleContent('associate_cvterm_form', 'locus_ontology')">[Add ontology annotations]</a> | :
181 qq |<span class = "ghosted"> [Add ontology annotations]</span> |;
186 <& /util/import_javascript.mas, classes => ["jquery","jqueryui", "thickbox", "CXGN.Phenome.Locus", "CXGN.Phenome.Tools", "CXGN.Sunshine.NetworkBrowser"] &>
189 <script language="javascript">
191 jQuery(document).ready(function() {
192 jQuery("#genome_locus").autocomplete({
193 source: '/ajax/locus/genome_autocomplete'
200 <& /page/page_title.mas, title=> "$common_name locus ".$locus->get_locus_name &>
203 <&| /page/info_section.mas, title=>"Locus details" , subtitle => "$locus_xml | $editor_note | $guide_html" &>
207 object_type => 'locus',
208 object_id => "$locus_id",
209 form_name => 'locus_form',
210 server_side_script => '/jsforms/locus_ajax_form.pl',
211 form_div_name => 'locus_details',
212 js_object_name => 'locusForm',
213 page_url => "/locus/$locus_id/view/",
214 alternate_new_button => '<a href ="/locus/0/new">[New]</a>'
221 <& /locus/synonym.mas , locus_id=>"$locus_id" , synonyms=>\@synonyms &>
228 <& /phenome/display_owners.mas,
229 object_id => $locus_id,
230 object_type => "locus"
234 <& /phenome/assign_owner.mas,
235 object_id => $locus_id,
236 object_type => "locus",
237 owner_add_uri => "/ajax/locus/assign_owner",
238 show_form => $curator
243 <a href="/phenome/claim_locus_ownership.pl?locus_id=<% $locus_id %>&action=confirm"> [Request editor privileges]</a><br /><br />
245 <& /locus/edits_info.mas, locus=>$locus &>
250 <& /locus/map_location.mas, person_id=>"$person_id", locus=>$locus &>
251 </td></tr></table></td></tr>
259 <&| /page/info_section.mas,
260 title => "Registry name: $registry",
261 subtitle => $registry_subtitle,
262 id => "locus_registry",
266 <& /locus/registry.mas , person_id=>"$person_id", locus_id=>"$locus_id", registry => $registry , is_owner => $is_owner &>
270 <&| /page/info_section.mas, title=>"Locus history", collapsible=>1, collapsed=>1 &>
271 <& /locus/history.mas, locus=>$locus &>
275 % if ( $locus_name && $curator ) {
276 <&| /page/info_section.mas, title=>"Curator tools", collapsible=>1, collapsed=>1 &>
277 <& /locus/merge_locus.mas , locus_id=>"$locus_id" , common_name=>"$common_name" &>
282 <&| /page/info_section.mas, title=>"Notes and figures (" . scalar(@figures) . ")", subtitle => "$figure_subtitle", collapsible=>1, collapsed=>1 &>
283 <& /image/print_images.mas , images=>\@figures , dbh=>$dbh &>
287 %#<&| /page/info_section.mas, title=>"eFP Browser links" &>
289 %# <& /locus/efp_browser_links.mas, locus => $locus &>
293 <&| /page/info_section.mas, title=>"Accessions and images (" . scalar(@$accessions) . ")", subtitle => "$stock_subtitle", id=>"locus_accessions", collapsible=>1, collapsed=>1 &>
294 <& /phenome/associate_accession_form.mas , locus_id=>$locus_id, person_id=>$person_id &>
295 <& /phenome/associated_accessions.mas , accessions=>$accessions, dbh=>$dbh &>
299 <&| /page/info_section.mas, title=>"Alleles (" . scalar(@alleles) . ")", subtitle => "$allele_subtitle", collapsible=>1, collapsed=>1 &>
301 <& /phenome/allele.mas, alleles=>\@alleles, user_id=>$person_id, curator=>$curator &>
306 <&| /page/info_section.mas,
307 title => "Associated loci (" . $locus->count_associated_loci() . ")",
308 subtitle => "$al_subtitle",
309 id =>"locus_network",
313 <& /locus/associate_locus.mas, locus_id=>$locus_id &>
314 <& /locus/network.mas , locus_id => $locus_id &>
318 <&| /page/info_section.mas,
319 title => "Associated loci - graphical view",
320 subtitle => $network_sub,
322 collapsed => $collapsed,
323 id => "graphic_locus_network" &>
325 % print CXGN::Sunshine::Browser::include_on_page( 'locus', $locus_id ) if $network_sub ;
330 <&| /page/info_section.mas,
331 title => "SolCyc links",
332 id => "solcyc_links",
336 % ## solcyc links are generated from the unigenes function in the ajax/locus controller ##
337 <div id="solcyc" >[loading...]</div>
341 <&| /page/info_section.mas, title=>"Sequence annotations" , collapsible=>1, collapsed=>0 &>
343 <&| /page/info_section.mas, title => "Gene model matches",
348 <& /feature/jbrowse_exact_match.mas, feature=> $feature, src_feature=> $src_feature &>
351 <&| /page/info_section.mas, title => "SGN Unigenes",
352 id => 'locus_unigenes',
353 subtitle => $new_unigene_link,
358 <& /locus/associate_unigene.mas,
359 locus_id => $locus_id,
360 common_name => $common_name,
363 <& /locus/locus_unigenes.mas, locus_id => $locus_id &>
366 <&| /page/info_section.mas, title => "GenBank accessions",
367 subtitle => $new_genbank_link,
375 <&| /page/info_section.mas,
376 title => "Other genome matches",
382 <& /locus/locus_genomic_annotations.mas, locus => $locus &>
388 <&| /page/info_section.mas, title=>"Literature annotations ($pub_count)" , subtitle=>$pub_subtitle, id=>"publications" , collapsible=>1, collapsed=>1 &>
391 % foreach my $d ( @sorted_pubs ) {
392 % if ( $d->[1] eq '0') { #if the dbxref is not obsolete
393 % my $pub = CXGN::Chado::Publication->new($dbh, $d->[0]->get_publication()->get_pub_id() );
394 % my $doi_dbxref_id = $pub->get_dbxref_id_by_db("DOI");
396 % if ( $doi_dbxref_id) {
397 % my $dbxref = CXGN::Chado::Dbxref->new($dbh, $doi_dbxref_id);
398 % my $doi_accession = $dbxref->get_accession;
399 % $doi = "<a href= \"http://doi.org/$doi_accession\">DOI:$doi_accession </a> ";
401 <& /chado/publication.mas, pub=>$pub, doi=>$doi, db=>$d->[0]->get_db_name(), accession=>$d->[0]->get_accession() &>
409 <&| /page/info_section.mas,
410 title =>"Ontology annotations ($ont_count)",
411 id => "locus_ontology",
414 subtitle => $ontology_subtitle &>
415 <& /ontology/associate_ontology.mas,
416 trait_db_name => $trait_db_name,
417 object_id => $locus_id ,
418 object_name => "locus",
419 cvterm_add_uri=> $cvterm_add_uri,
420 ontology_url => "/locus/$locus_id/ontologies/",
421 reference_uri => "/locus/$locus_id/references",
422 evidence_with_uri => "/locus/$locus_id/evidences",
423 show_form => $is_owner &>
426 <&| /page/info_section.mas,
427 title => 'Related views',
431 <& /sitefeatures/mixed/xref_set/link.mas,
432 xrefs => [ grep { $_->feature->feature_name ne 'gbrowse2' } @$xrefs ],
437 <& /page/comments.mas, object_type=>'locus', object_id=>$locus_id, referer=>$this_page &>