5 basic_unigene_build_info.mas
6 Mason code to show history data for unigene_build web_page.
18 <& '/transcript/unigene_build/history_unigene_build_info.mas', schema => $schema, unigene_build => $unigene_build &>
20 where: $schema, a DBIx::Class::Schema object with the classes of SGN::Schema
21 $unigene_build, an CXGN::Transcript::UnigeneBuild object
27 It is a MASON module for the unigene_build.pl script to show information about the history of the unigene builds
33 Aureliano Bombarely (ab782@cornell.edu)
51 use CXGN::Transcript::UnigeneBuild;
52 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
57 ## If there aren't any unigene_build that comes from unigene_build_detail it will do nothing.
58 ## The error message will returned by basic information
60 my $unigene_build_id = $unigene_build->get_unigene_build_id();
62 ## Get the organism group id to use in a search
64 my $organism_group_id = $unigene_build->get_organism_group_id();
65 my $group_name = $unigene_build->get_organism_group_name();
68 if (defined $organism_group_id) {
70 ## Get the data from the sgn.method table
72 my @unigene_build_rows = $schema->resultset('UnigeneBuild')->search({ organism_group_id => $organism_group_id },
73 { order_by => 'build_date' } );
74 foreach my $unigene_build_row (@unigene_build_rows) {
75 my %unigene_data = $unigene_build_row->get_columns();
76 my $build_name = $group_name . '#' . $unigene_data{'build_nr'};
77 my $status = '<font color="red"><i>Deprecated</i></font>';
78 if ($unigene_data{'status'} eq 'C') {
79 $status = '<font color="green"><b>CURRENT</b></font>';
80 } elsif ($unigene_data{'status'} eq 'P') {
81 $status = '<font color="orange"><i>Previous</i></font>';
84 my $build_link = '<a href=/search/unigene_build.pl?id=' . $unigene_data{'unigene_build_id'} . '>' . $build_name . '</a>';
85 if ($unigene_data{'unigene_build_id'} == $unigene_build_id) {
86 push @unigene_data, [$unigene_data{'unigene_build_id'}, '<b>' . $build_link . '</b>', $status, $unigene_data{'build_date'}];
88 push @unigene_data, [$unigene_data{'unigene_build_id'}, $build_link, $status, $unigene_data{'build_date'}];
91 ## Create the HTML table
93 $history_html = columnar_table_html( headings => ['Unigene build id', 'Build Name', 'Status', 'Date'],
94 data => \@unigene_data );
97 $history_html = 'None history was found associated to this unigene build';
101 if (defined $unigene_build_id) {
102 $history_content = info_section_html( title => "Unigene Build History",
103 contents => $history_html,
111 <% $history_content %>