6 Mason component to create html section to show basic info for unigene web_page.
18 <& '/transcript/unigene/basic_unigene_info.mas', sgn_schema => $sgn_schema, schema => $schema, unigene => $unigene &>
20 where: $schema is a schema object with Bio::Chado::Schema, CXGN::Metadata::Schema and CXGN::Biosource::Schema classes
21 (aditionally, for expression data should contain CXGN::GEM::Schema classes)
22 $sgn_schema, a schema with SGN::Schema classes
23 $unigene, an CXGN::Transcript::Unigene object
29 Mason component to create html section to show basic info for unigene web_page.
35 Aureliano Bombarely (ab782@cornell.edu)
54 use CXGN::Transcript::Unigene;
55 use CXGN::Chado::Dbxref;
57 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
59 my $basic_info_content;
62 ## If there aren't any unigene that comes from unigene_detail.mas, it will return a message.
64 if (defined $ARGS{'unigene'}) {
67 my $id = $unigene->get_unigene_id();
68 $accession = $unigene->get_sgn_id();
70 my $unigene_build = $unigene->get_unigene_build();
71 my $build_name = $unigene_build->get_organism_group_name();
72 my $build_id = $unigene_build->get_unigene_build_id();
73 my $build_nr = $unigene_build->get_build_nr();
75 my $unigene_build_name = $build_name." #".$build_nr;
76 my $unigene_build_name_html = "<a href=/search/unigene_build.pl?id=$build_id>$unigene_build_name</a>";
78 my $build_date = $unigene_build->get_build_date();
80 my $member_nr = $unigene->get_nr_members();
82 my @organism_html_list;
83 my $organism_group_id = $unigene_build->get_organism_group_id();
84 my $group_linkage_rs = $sgn_schema->resultset('GroupLinkage')
85 ->search( { group_id => $organism_group_id } );
87 my @organism_ids = $group_linkage_rs->get_column('member_id')
90 foreach my $organism_id (@organism_ids) {
92 if ($organism_id =~ m/^\d+$/) {
94 my @organism_rows = $schema->resultset('Organism::Organism')
95 ->search({ sgn_organism_id => $organism_id });
97 foreach my $organism_row (@organism_rows) {
99 my $organism_name = $organism_row->get_column('abbreviation');
100 my $chado_organism_id = $organism_row->get_column('organism_id');
102 my $organism_html = "<a href=/chado/organism.pl?organism_id=" . $chado_organism_id . ">". $organism_name. "</a>";
103 push @organism_html_list, $organism_html;
107 my $organism_html_list = join('<br>', @organism_html_list) || '<font color="gray"><i>none</i></font>';
110 my $unigene_alternate_id = $unigene->get_alternate_identifier() || '<font color=gray><i>none</i></font>';
111 my $seq = $unigene->get_sequence();
112 my $seq_length = length($seq);
113 my $seq_html = uc(html_break_string($seq, 90));
115 ## It will create some tools links
117 my $blast_html = "<a href='/tools/blast/?preload_id=SGN-U". $id . "&preload_type=unigene+identifiers'>Blast</a>";
118 my $transl_orf_html = "<a href='/tools/sixframe_translate.pl?unigene_id=" . $id . "'>AA Translation</a>";
120 ## Create the HTML table
122 $basic_info_content = <<HTML;
125 <tr> <td width="25%"> <b>Unigene ID: </b> </td> <td> $accession </td></tr>
126 <tr> <td width="25%"> <b>Unigene Build: </b> </td> <td> $unigene_build_name_html </td></tr>
127 <tr> <td width="25%"> <b>Date: </b> </td> <td> $build_date </td></tr>
128 <tr> <td width="25%"> <b>Organism: </b> </td> <td> $organism_html_list </td></tr>
129 <tr> <td width="25%"> <b>Alternative ID:</b> </td> <td> $unigene_alternate_id </td></tr>
130 <tr> <td width="25%"> <b>mRNA sequence:</b> </td> <td> Length: $seq_length bp </td></tr>
134 >$accession $unigene_build_name ($member_nr members)<br>
135 <font style="font-family: monospace"> $seq_html</font>
138 [$blast_html] [$transl_orf_html]
143 $basic_info_content = "<big>There aren't any unigene data for the specified parameters.</big>";
148 if (defined $accession) {
149 $basic_info_html = "<center><big><b>Unigene $accession</b></big></center><br>";
151 $basic_info_html .= info_section_html( title => "Unigene Basic Information",
152 contents => $basic_info_content
157 <% $basic_info_html %>