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'
48 $blast_url => '/tools/blast/'
52 use CXGN::Sunshine::Browser;
53 use CXGN::Page::FormattingHelpers qw / html_optional_show info_table_html /;
58 my $locus = $locusref->{locus};
59 my $locus_id = $locusref->{locus_id};
60 my $action = $locusref->{action} || 'view';
61 my $person_id = $locusref->{person_id};
62 my $curator = $locusref->{curator};
63 my $submitter = $locusref->{submitter};
64 my $sequencer = $locusref->{sequencer};
65 my $is_owner = $locusref->{is_owner};
66 my $owners = $locusref->{owners};
67 my $dbh = $locusref->{dbh};
68 my $xrefs = $locusref->{xrefs};
69 my $feature = $locusref->{feature};
70 my $src_feature = $locusref->{src_feature};
71 my $dbxrefs = $locusref->{dbxrefs};
72 my $pubs = $locusref->{pubs};
75 # dbxrefs, unigenes , ontology
77 my $this_page = "/locus/$locus_id/view/";
79 my $locus_xml = $locus_id ? qq |<a href = "/phenome/generic_gene_page.pl?locus_id=$locus_id">Download GMOD XML</a>|
80 : qq |<span class="ghosted">Download GMOD XML</span>|;
82 qq |<a href="/phenome/editors_note.pl">Note to Editors</a>|;
84 qq|<a href="http://docs.google.com/View?docid=ddhncntn_0cz2wj6">Annotation guidelines</a>|;
86 my $common_name = $locus->get_common_name();
87 my @owners = $locus->get_owners();
88 my $owner_objects= $locus->get_owners(1);
90 my $locus_name = $locus->get_locus_name();
92 my $registry = $locus->get_associated_registry();
93 my $registry_subtitle = $is_owner && $locus_id ? '<a href="javascript:Tools.toggleContent(\'associateRegistryForm\', \'locus_registry\')">[Associate a registry name with this locus]</a> '
94 : qq|<span class = "ghosted"> [Associate registry name]</span>| ;
96 my @synonyms = $locus->get_locus_aliases('f','f');
97 my @figures = $locus->get_figure_ids();
100 $curator || $submitter || $sequencer ?
101 " <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> " ;
103 my $stock_subtitle = $curator || $submitter || $sequencer ?
104 '<a href="javascript:Tools.toggleContent(\'associateStockForm\', \'locus_accessions\')">[Associate accession]</a> ' : '<span class= "ghosted">[Associate accession]</span> ';
106 my $accessions = $locus->get_stock_ids;
108 my @alleles = $locus->get_alleles(); #array of allele objects
110 my $allele_subtitle = $curator || $submitter || $sequencer ?
111 "<a href=\"/phenome/allele.pl?locus_id=$locus_id&action=new\">[Add new allele]</a>" :
112 '<span class="ghosted">[Add new Allele]</span>' ;
114 my $al_subtitle = $curator || $submitter || $sequencer ?
115 '<a href="javascript:Tools.toggleContent(\'associateLocusForm\', \'locus_network\');Tools.getOrganisms()">[Associate new locus]</a> ' :
116 '<span class="ghosted">[Associate new locus]</span>' ;
118 my $collapsed = $locus->count_associated_loci() ? 1 : 0 ;
120 my $network_sub = $collapsed ?
121 "View <b>$locus_name</b> relationships in the stand-alone <a href=\"/tools/networkbrowser/?type=locus&name=$locus_id\">network browser</a>" : '';
123 my $new_unigene_link = $curator || $submitter || $sequencer ?
124 '<a href="javascript:Tools.toggleContent(\'associateUnigeneForm\', \'locus_unigenes\' )">[Associate new unigene]</a>' :
125 '<span class= "ghosted">[Associate new unigene]</span> ';
126 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> | ;
127 my %dbxrefs = $locus->get_all_dbxrefs();
130 foreach ( @{ $dbxrefs{'tgrc'} } ) {
131 if ( $_->[1] eq '0' ) {
132 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
133 my $accession = $_->[0]->get_accession();
135 qq|<br>$locus_name is a <a href="$url$accession" target="blank">TGRC gene</a><br />|;
139 foreach ( @{ $dbxrefs{'TAIR locus'} } ) {
140 if ( $_->[1] eq '0' ) {
141 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
142 my $accession = $_->[0]->get_accession();
144 qq|<br>$locus_name is a <a href="$url$accession" target="blank">TAIR locus</a><br />|;
149 foreach ( @{ $dbxrefs{'PhyloGenes'} } ) {
150 if ( $_->[1] eq '0' ) {
151 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
152 my $accession = $_->[0]->get_accession();
154 qq|<br>$locus_name is on <a href="$url$accession" target="blank">PhyloGenes</a><br />|;
158 my $pub_subtitle = $curator || $submitter || $sequencer ?
159 qq|<a href="/chado/add_publication.pl?type=locus&type_id=$locus_id&refering_page=$this_page&action=new"> [Associate publication] </a>| :
160 qq|<span class=\"ghosted\">[Associate publication]</span>|;
163 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> |;
165 my ($genbank, $gb_count);
166 foreach my $g ( @{ $dbxrefs{'DB:GenBank_GI'} } ) {
167 if ( $g->[1] eq '0' ) {
168 my $url = $g->[0]->get_urlprefix() . $g->[0]->get_url();
169 my $feature = CXGN::Chado::Feature->new_with_accession($dbh, $g->[0]->get_accession);
170 my $gb_accession = $feature->get_name;
171 my $description = $g->[0]->get_description();
172 my $feature_seq = $feature->get_residues;
173 my $blast_link = qq |
174 <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>
178 qq|<a href="$url$gb_accession" target="blank">$gb_accession</a> $description $blast_link<br />|;
182 my $ont_count = $locus->count_ontology_annotations();
184 my $ontology_subtitle = $curator || $submitter || $sequencer ?
185 qq|<a href="javascript:Tools.toggleContent('associate_cvterm_form', 'locus_ontology')">[Add ontology annotations]</a> | :
186 qq |<span class = "ghosted"> [Add ontology annotations]</span> |;
191 <& /util/import_javascript.mas, classes => ["jquery","jqueryui", "thickbox", "CXGN.Phenome.Locus", "CXGN.Phenome.Tools", "CXGN.Sunshine.NetworkBrowser"] &>
194 <script language="javascript">
196 jQuery(document).ready(function() {
197 jQuery("#genome_locus").autocomplete({
198 source: '/ajax/locus/genome_autocomplete'
205 <& /page/page_title.mas, title=> "$common_name locus ".$locus->get_locus_name &>
208 <&| /page/info_section.mas, title=>"Locus details" , subtitle => "$locus_xml | $editor_note | $guide_html" &>
212 object_type => 'locus',
213 object_id => "$locus_id",
214 form_name => 'locus_form',
215 server_side_script => '/jsforms/locus_ajax_form.pl',
216 form_div_name => 'locus_details',
217 js_object_name => 'locusForm',
218 page_url => "/locus/$locus_id/view/",
219 alternate_new_button => '<a class="btn btn-sm btn-default" href ="/locus/0/new">New</a>'
225 <& /locus/synonym.mas , locus_id=>"$locus_id" , synonyms=>\@synonyms &>
229 <& /phenome/display_owners.mas,
230 object_id => $locus_id,
231 object_type => "locus"
235 <& /phenome/assign_owner.mas,
236 object_id => $locus_id,
237 object_type => "locus",
238 owner_add_uri => "/ajax/locus/assign_owner",
239 show_form => $curator
243 % if ($locus_id && $person_id) {
244 <a href="/phenome/claim_locus_ownership.pl?locus_id=<% $locus_id %>&action=confirm"> [Request editor privileges]</a><br /><br />
245 % } elsif ( $locus_id ) {
246 <span class="ghosted">[log-in to request editor privileges]</span><br />
248 <& /locus/edits_info.mas, locus=>$locus &>
253 <& /locus/map_location.mas, person_id=>"$person_id", locus=>$locus &>
254 </td></tr></table></td></tr>
263 <&| /page/info_section.mas,
264 title => "Links to external databases",
266 id => "locus_dbxrefs",
277 <&| /page/info_section.mas,
278 title => "Registry name: $registry",
279 subtitle => $registry_subtitle,
280 id => "locus_registry",
284 <& /locus/registry.mas , person_id=>"$person_id", locus_id=>"$locus_id", registry => $registry , is_owner => $is_owner &>
288 <&| /page/info_section.mas, title=>"Locus history", collapsible=>1, collapsed=>1 &>
289 <& /locus/history.mas, locus=>$locus &>
293 % if ( $locus_name && $curator ) {
294 <&| /page/info_section.mas, title=>"Curator tools", collapsible=>1, collapsed=>1 &>
295 <& /locus/merge_locus.mas , locus_id=>"$locus_id" , common_name=>"$common_name" &>
300 <&| /page/info_section.mas, title=>"Notes and figures (" . scalar(@figures) . ")", subtitle => "$figure_subtitle", collapsible=>1, collapsed=>1 &>
301 <& /image/print_images.mas , images=>\@figures , dbh=>$dbh &>
305 %#<&| /page/info_section.mas, title=>"eFP Browser links" &>
307 %# <& /locus/efp_browser_links.mas, locus => $locus &>
311 <&| /page/info_section.mas, title=>"Accessions and images (" . scalar(@$accessions) . ")", subtitle => "$stock_subtitle", id=>"locus_accessions", collapsible=>1, collapsed=>1 &>
312 <& /phenome/associate_accession_form.mas , locus_id=>$locus_id, person_id=>$person_id &>
313 <& /phenome/associated_accessions.mas , accessions=>$accessions, dbh=>$dbh &>
317 <&| /page/info_section.mas, title=>"Alleles (" . scalar(@alleles) . ")", subtitle => "$allele_subtitle", collapsible=>1, collapsed=>1 &>
319 <& /phenome/allele.mas, alleles=>\@alleles, user_id=>$person_id, curator=>$curator &>
324 <&| /page/info_section.mas,
325 title => "Associated loci (" . $locus->count_associated_loci() . ")",
326 subtitle => "$al_subtitle",
327 id =>"locus_network",
331 <& /locus/associate_locus.mas, locus_id=>$locus_id &>
332 <& /locus/network.mas , locus_id => $locus_id &>
336 <&| /page/info_section.mas,
337 title => "Associated loci - graphical view",
338 subtitle => $network_sub,
340 collapsed => $collapsed,
341 id => "graphic_locus_network" &>
343 % print CXGN::Sunshine::Browser::include_on_page( 'locus', $locus_id ) if $network_sub ;
348 <&| /page/info_section.mas,
349 title => "SolCyc links",
350 id => "solcyc_links",
354 % ## solcyc links are generated from the unigenes function in the ajax/locus controller ##
355 <div id="solcyc" >[loading...]</div>
359 <&| /page/info_section.mas, title=>"Sequence annotations" , collapsible=>1, collapsed=>0 &>
360 <&| /page/info_section.mas, title => "Genome features",
366 <& /locus/print_mrna_features.mas,
368 blast_url => $blast_url,
373 <&| /page/info_section.mas, title => "Gene model matches",
378 <& /feature/jbrowse_exact_match.mas, feature=> $feature, src_feature=> $src_feature &>
381 <&| /page/info_section.mas, title => "SGN Unigenes",
382 id => 'locus_unigenes',
383 subtitle => $new_unigene_link,
388 <& /locus/associate_unigene.mas,
389 locus_id => $locus_id,
390 common_name => $common_name,
393 <& /locus/locus_unigenes.mas, locus_id => $locus_id &>
396 <&| /page/info_section.mas, title => "GenBank accessions",
397 subtitle => $new_genbank_link,
405 <&| /page/info_section.mas,
406 title => "Other genome matches",
412 <& /locus/locus_genomic_annotations.mas, locus => $locus &>
418 <&| /page/info_section.mas, title=>"Literature annotations [" . scalar(@$pubs) ."]" , subtitle=>$pub_subtitle, id=>"publications" , collapsible=>1, collapsed=>1 &>
420 % foreach my $pub ( @$pubs ) {
421 <& /chado/publication.mas, pub=>$pub &>
428 <&| /page/info_section.mas,
429 title =>"Ontology annotations ($ont_count)",
430 id => "locus_ontology",
433 subtitle => $ontology_subtitle &>
434 <& /ontology/associate_ontology.mas,
435 trait_db_name => $trait_db_name,
436 object_id => $locus_id ,
437 object_name => "locus",
438 cvterm_add_uri=> $cvterm_add_uri,
439 ontology_url => "/locus/$locus_id/ontologies/",
440 reference_uri => "/locus/$locus_id/references",
441 evidence_with_uri => "/locus/$locus_id/evidences",
442 show_form => $is_owner &>
445 <&| /page/info_section.mas,
446 title => 'Related views',
450 <& /sitefeatures/mixed/xref_set/link.mas,
451 xrefs => [ grep { $_->feature->feature_name ne 'gbrowse2' } @$xrefs ],
456 <& /page/comments.mas, object_type=>'locus', object_id=>$locus_id, referer=>$this_page &>