6 Mason component to create html with marker data
18 <& '/transcript/unigene/marker_info.mas', dbh => $dbh, unigene => $unigene &>
21 where: $dbh, a dbi connection object
22 $unigene, an CXGN::Transcript::Unigene object
30 Mason component to create html with markers data.
36 Aureliano Bombarely (ab782@cornell.edu)
55 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
60 my $id = $unigene->get_unigene_id();
62 ## The markers section are divided into two sections:
63 ## 1- General markers information
64 ## 2- COSII (Conserved Ortholog Set II) marker information
69 ## First get the map information using the unigene object
72 my @mapped_member_ids = $unigene->get_mapped_members();
74 ## Define a count variable
75 my $markers_count = 0;
77 foreach my $map (@mapped_member_ids) {
78 my $marker = CXGN::Marker->new($dbh, $map->{marker_id});
79 my $marker_name = 'Unknown'; ## Use unknown by default
81 $marker_name = $marker->name_that_marker();
84 my $est_link = qq |<a href="/search/est.pl?request_id=$map->{clone_id}&request_from=1&request_type=8">SGN-C$map->{clone_id}</a>|;
85 my $marker_link = qq|<a href="/search/markers/markerinfo.pl?marker_id=$map->{marker_id}">$marker_name</a>|;
86 push @mapped, [ $est_link, $marker_link];
90 ## Second, put the data into a table to show in the web
93 if (defined $mapped[0]) {
94 $mapped_html = columnar_table_html( headings => [ 'EST', 'Marker' ], data => \@mapped );
96 $mapped_html = qq|<span class="ghosted">No member sequence or clone is mapped.</span>|;
99 my $map_content = info_table_html( 'Unigene Mapped Marker Information' => $mapped_html,
105 ## Third, take the COSII marker data
109 my @cosii_data = $unigene->get_cosii_info();
110 foreach my $cosii_marker (@cosii_data) {
111 my ($marker_id, $marker_name)= @{$cosii_marker};
112 my $cosii_link = '<a href=/search/markers/markerinfo.pl?marker_id=' . $marker_id . '>' . $marker_name . '</a>';
113 $cosii_data_html .= "COSII marker $cosii_link was created with this unigene.<br />\n";
116 unless (defined $cosii_data[0]) {
117 $cosii_data_html .= qq|<span class="ghosted">None cosii markers associated to this unigene.</span>|;
120 my $cosii_info_link = '<a href="/markers/cosii_markers.pl">COSII Markers</a>';
121 my $cosii_content = info_table_html( "$cosii_info_link Information" => $cosii_data_html,
125 $map_content .= $cosii_content;
127 $markers_content = info_section_html( title => "Markers Information (".$markers_count.")",
128 contents => $map_content,
138 <% $markers_content %>