Merge pull request #4106 from solgenomics/topic/wishlist
[sgn.git] / mason / feature / types / gene.mas
blob4a25fed538c82a626967795c1d81c32bfd36a316
1 <%args>
2     $feature
3     $blast_url => undef
4     $xrefs     => []
5     $featurelocs
6 </%args>
7 <%once>
8     use SGN::View::Feature 'mrna_cds_protein_sequence';
9 </%once>
10 <%perl>
11     #my $reference   = $featurelocs ? $featurelocs->single->srcfeature : undef ;
12     #getting only for primary featureloc
13     my $reference   = $featurelocs ? $featurelocs->search({locgroup => 0,},)->single()->srcfeature() : undef ;
14     my @mrnas       = grep $_->type->name eq 'mRNA', $feature->child_features;
15     my $current_loc = $featurelocs ? $featurelocs->search({locgroup => 0,},)->single() : undef ; 
16 </%perl>
18 <& /feature/page_title.mas, feature => $feature &>
20 <&| /page/info_section.mas,
21     title       => 'Gene',
22     subtitle    => $feature->is_obsolete ? 'WARNING: This feature is obsolete, new data is available.' : '',
23     collapsible => 1,
25   <& /feature/feature_data.mas,
26       feature          => $feature,
27       description_from => \@mrnas,
28       featurelocs      => $featurelocs,
29   &>
31   <& /feature/properties.mas,
32      feature => $feature,
33    &>
35 </&>
37 <&| /page/info_section.mas,
38    title       => 'Genome Viewer',
39    collapsible => 1,
42         <& /feature/jbrowse_exact_match.mas, feature => $feature , src_feature => $reference &>
44 </&>
47 <&| /page/info_section.mas,
48    title       => 'Related features',
49    collapsible => 1,
51   <& /feature/related_features.mas,
52       reference => $reference,
53       feature   => $feature,
54       omit_columns => ['organism'],
55   &>
57 </&>
60 <&| /page/info_section.mas,
61         title       => 'Genomic sequence',
62         subtitle    => 'unprocessed genomic sequence region underlying this gene',
63         empty_message => 'Not available',
64         collapsible => 1,
65         collapsed   => 1,
68    <& /feature/region_sequence.mas,
69        feature   => $feature,
70        blast_url => $blast_url,
71    &>
73 </&>
75 % for my $mrna ( @mrnas ) {
77   <&| /page/info_section.mas,
78           title       => 'mRNA '. $mrna->name,
79           collapsible => 1,
80   &>
82     <&| /page/info_section.mas,
83        title => 'Ontology terms',
84        subtitle => 'terms associated with this mRNA',
85        collapsible => 1,
86        is_subsection => 1,
87     &>
89       <& /feature/feature_cvterms.mas,
90           feature   => $mrna,
91       &>
93     </&>
95 %   my ( $mrna_sequence, $cds_sequence, $protein_sequence ) = @{(mrna_cds_protein_sequence( $mrna ))[0] || [] };
97     <&| /page/info_section.mas,
98             title         => 'cDNA sequence',
99             is_subsection => 1,
100             subtitle      => 'spliced cDNA sequence, including UTRs',
101             empty_message => 'Not available',
102             collapsible   => 1,
103             collapsed     => 1,
104     &>
106 %  if( $mrna_sequence ) {
108      <div style="margin-left: 3em">
109        <& /sequence/with_markup.mas,
110           seq       => $mrna_sequence,
111           width     => 80,
112           subdiv    => 10,
113           blast_url => $blast_url,
114         &>
115      </div>
116      <div style="margin-top: 1em">
117         <& /feature/sequence_download.mas,
118              feature => $mrna,
119          &>
120      </div>
121 % }
123     </&>
125     <&| /page/info_section.mas,
126             title         => 'Protein sequence',
127             is_subsection => 1,
128             subtitle      => 'translated polypeptide sequence',
129             empty_message => 'Not available',
130             collapsible   => 1,
131             collapsed     => 1,
132     &>
134 %  if( $protein_sequence ) {
136      <div style="margin-left: 3em">
137        <& /sequence/with_markup.mas,
138           seq       => $protein_sequence,
139           width     => 80,
140           subdiv    => 10,
141           blast_url => $blast_url,
142         &>
143      </div>
144 %    if( $protein_sequence->can('feature_id') ) {
145      <div style="margin-top: 1em">
146         <& /feature/sequence_download.mas,
147              feature => $protein_sequence,
148          &>
149      </div>
150 %    }
151 % }
153     </&>
155     <&| /page/info_section.mas,
156         title         => 'Related features',
157         is_subsection => 1,
158         collapsible   => 1,
159      &>
161        <& /feature/related_features.mas,
162              feature   => $mrna,
163              omit_columns => ['organism'],
164        &>
166     </&>
168   </&>
169 % }
171 <&| /page/info_section.mas,
172      title       => 'Related views',
173      collapsible => 1,
174  &>
175      <& /sitefeatures/mixed/xref_set/link.mas,
176         xrefs   => $xrefs,
177         exclude => 'gbrowse2',
178       &>
179 </&>