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 />|;
159 my ($chr, $pos, $jbrowse_url);
160 my $tomDel_pub = qq|Please cite <a href ="https://doi.org/10.1101/2021.11.08.467620" target="blank">Razifard et al.|;
161 foreach ( @{ $dbxrefs{'TomDel'} } ) {
162 if ( $_->[1] eq '0' ) {
163 my $url = $_->[0]->get_urlprefix() . $_->[0]->get_url();
164 my $accession = $_->[0]->get_accession();
165 my $description = $_->[0]->get_description;
167 $description =~ /^chromosome (SL2.50ch\d{2}).*position: (\d[0-9]+)$/;
170 $jbrowse_url = "https://solgenomics.net/jbrowse_solgenomics/?data=data/json/SL2.50&loc=$chr:$pos&tracks=DNA,gene_models,TomDelDB";
172 qq|<br /><a href="$url$accession" target="blank">TomDelDB genotype frequencies</a> in tomato populations. <a href="$jbrowse_url" target="blank">$description</a><br />|;
173 $tomDel .= qq|$tomDel_pub<br />|;
176 my $pub_subtitle = $curator || $submitter || $sequencer ?
177 qq|<a href="/chado/add_publication.pl?type=locus&type_id=$locus_id&refering_page=$this_page&action=new"> [Associate publication] </a>| :
178 qq|<span class=\"ghosted\">[Associate publication]</span>|;
181 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> |;
183 my ($genbank, $gb_count);
184 foreach my $g ( @{ $dbxrefs{'DB:GenBank_GI'} } ) {
185 if ( $g->[1] eq '0' ) {
186 my $url = $g->[0]->get_urlprefix() . $g->[0]->get_url();
187 my $feature = CXGN::Chado::Feature->new_with_accession($dbh, $g->[0]->get_accession);
188 my $gb_accession = $feature->get_name;
189 my $description = $g->[0]->get_description();
190 my $feature_seq = $feature->get_residues;
191 my $blast_link = qq |
192 <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>
196 qq|<a href="$url$gb_accession" target="blank">$gb_accession</a> $description $blast_link<br />|;
200 my $ont_count = $locus->count_ontology_annotations();
202 my $ontology_subtitle = $curator || $submitter || $sequencer ?
203 qq|<a href="javascript:Tools.toggleContent('associate_cvterm_form', 'locus_ontology')">[Add ontology annotations]</a> | :
204 qq |<span class = "ghosted"> [Add ontology annotations]</span> |;
209 <& /util/import_javascript.mas, classes => ["jquery","jqueryui", "thickbox", "CXGN.Phenome.Locus", "CXGN.Phenome.Tools", "CXGN.Sunshine.NetworkBrowser"] &>
212 <script language="javascript">
214 jQuery(document).ready(function() {
215 jQuery("#genome_locus").autocomplete({
216 source: '/ajax/locus/genome_autocomplete'
223 <& /page/page_title.mas, title=> "$common_name locus ".$locus->get_locus_name &>
226 <&| /page/info_section.mas, title=>"Locus details" , subtitle => "$locus_xml | $editor_note | $guide_html" &>
230 object_type => 'locus',
231 object_id => "$locus_id",
232 form_name => 'locus_form',
233 server_side_script => '/jsforms/locus_ajax_form.pl',
234 form_div_name => 'locus_details',
235 js_object_name => 'locusForm',
236 page_url => "/locus/$locus_id/view/",
237 alternate_new_button => '<a class="btn btn-sm btn-default" href ="/locus/0/new">New</a>'
243 <& /locus/synonym.mas , locus_id=>"$locus_id" , synonyms=>\@synonyms &>
247 <& /phenome/display_owners.mas,
248 object_id => $locus_id,
249 object_type => "locus"
253 <& /phenome/assign_owner.mas,
254 object_id => $locus_id,
255 object_type => "locus",
256 owner_add_uri => "/ajax/locus/assign_owner",
257 show_form => $curator
261 % if ($locus_id && $person_id) {
262 <a href="/phenome/claim_locus_ownership.pl?locus_id=<% $locus_id %>&action=confirm"> [Request editor privileges]</a><br /><br />
263 % } elsif ( $locus_id ) {
264 <span class="ghosted">[log-in to request editor privileges]</span><br />
266 <& /locus/edits_info.mas, locus=>$locus &>
271 <& /locus/map_location.mas, person_id=>"$person_id", locus=>$locus &>
272 </td></tr></table></td></tr>
281 <&| /page/info_section.mas,
282 title => "Links to external databases",
284 id => "locus_dbxrefs",
296 <&| /page/info_section.mas,
297 title => "Registry name: $registry",
298 subtitle => $registry_subtitle,
299 id => "locus_registry",
303 <& /locus/registry.mas , person_id=>"$person_id", locus_id=>"$locus_id", registry => $registry , is_owner => $is_owner &>
307 <&| /page/info_section.mas, title=>"Locus history", collapsible=>1, collapsed=>1 &>
308 <& /locus/history.mas, locus=>$locus &>
312 % if ( $locus_name && $curator ) {
313 <&| /page/info_section.mas, title=>"Curator tools", collapsible=>1, collapsed=>1 &>
314 <& /locus/merge_locus.mas , locus_id=>"$locus_id" , common_name=>"$common_name" &>
319 <&| /page/info_section.mas, title=>"Notes and figures (" . scalar(@figures) . ")", subtitle => "$figure_subtitle", collapsible=>1, collapsed=>1 &>
320 <& /image/print_images.mas , images=>\@figures , dbh=>$dbh &>
324 %#<&| /page/info_section.mas, title=>"eFP Browser links" &>
326 %# <& /locus/efp_browser_links.mas, locus => $locus &>
330 <&| /page/info_section.mas, title=>"Accessions and images (" . scalar(@$accessions) . ")", subtitle => "$stock_subtitle", id=>"locus_accessions", collapsible=>1, collapsed=>1 &>
331 <& /phenome/associate_accession_form.mas , locus_id=>$locus_id, person_id=>$person_id &>
332 <& /phenome/associated_accessions.mas , accessions=>$accessions, dbh=>$dbh &>
336 <&| /page/info_section.mas, title=>"Alleles (" . scalar(@alleles) . ")", subtitle => "$allele_subtitle", collapsible=>1, collapsed=>1 &>
338 <& /phenome/allele.mas, alleles=>\@alleles, user_id=>$person_id, curator=>$curator &>
343 <&| /page/info_section.mas,
344 title => "Associated loci (" . $locus->count_associated_loci() . ")",
345 subtitle => "$al_subtitle",
346 id =>"locus_network",
350 <& /locus/associate_locus.mas, locus_id=>$locus_id &>
351 <& /locus/network.mas , locus_id => $locus_id &>
355 <&| /page/info_section.mas,
356 title => "Associated loci - graphical view",
357 subtitle => $network_sub,
359 collapsed => $collapsed,
360 id => "graphic_locus_network" &>
362 % print CXGN::Sunshine::Browser::include_on_page( 'locus', $locus_id ) if $network_sub ;
367 <&| /page/info_section.mas,
368 title => "SolCyc links",
369 id => "solcyc_links",
373 % ## solcyc links are generated from the unigenes function in the ajax/locus controller ##
374 <div id="solcyc" >[loading...]</div>
378 <&| /page/info_section.mas, title=>"Sequence annotations" , collapsible=>1, collapsed=>0 &>
379 <&| /page/info_section.mas, title => "Genome features",
385 <& /locus/print_mrna_features.mas,
387 blast_url => $blast_url,
392 <&| /page/info_section.mas, title => "Gene model matches",
397 <& /feature/jbrowse_exact_match.mas, feature=> $feature, src_feature=> $src_feature &>
400 <&| /page/info_section.mas, title => "SGN Unigenes",
401 id => 'locus_unigenes',
402 subtitle => $new_unigene_link,
407 <& /locus/associate_unigene.mas,
408 locus_id => $locus_id,
409 common_name => $common_name,
412 <& /locus/locus_unigenes.mas, locus_id => $locus_id &>
415 <&| /page/info_section.mas, title => "GenBank accessions",
416 subtitle => $new_genbank_link,
424 <&| /page/info_section.mas,
425 title => "Other genome matches",
431 <& /locus/locus_genomic_annotations.mas, locus => $locus &>
437 <&| /page/info_section.mas, title=>"Literature annotations [" . scalar(@$pubs) ."]" , subtitle=>$pub_subtitle, id=>"publications" , collapsible=>1, collapsed=>1 &>
439 % foreach my $pub ( @$pubs ) {
440 <& /chado/publication.mas, pub=>$pub &>
447 <&| /page/info_section.mas,
448 title =>"Ontology annotations ($ont_count)",
449 id => "locus_ontology",
452 subtitle => $ontology_subtitle &>
453 <& /ontology/associate_ontology.mas,
454 trait_db_name => $trait_db_name,
455 object_id => $locus_id ,
456 object_name => "locus",
457 cvterm_add_uri=> $cvterm_add_uri,
458 ontology_url => "/locus/$locus_id/ontologies/",
459 reference_uri => "/locus/$locus_id/references",
460 evidence_with_uri => "/locus/$locus_id/evidences",
461 show_form => $is_owner &>
464 <&| /page/info_section.mas,
465 title => 'Related views',
469 <& /sitefeatures/mixed/xref_set/link.mas,
470 xrefs => [ grep { $_->feature->feature_name ne 'gbrowse2' } @$xrefs ],
475 <& /page/comments.mas, object_type=>'locus', object_id=>$locus_id, referer=>$this_page &>