6 Mason code to get probe composition data and show it in a web_page.
18 Mason code to get probe composition data and show it in a web_page.
20 Its controller is: template_design.pl
26 Aureliano Bombarely (ab782@cornell.edu)
41 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
44 my $probe_comp_content;
45 my $probe_composition_html;
47 my $default_message = '<i><font color="gray">data not available</font></i>';
49 ## If there aren't any template_row that comes from template it will do nothing. The error message will returned by basic information
54 if (defined $template->get_template_id() ) {
58 my $schema = $template->get_schema();
60 ## Get the data from the row as hash
62 my $template_id = $template->get_template_id();
64 ## Search probe data, put into an array and use columnar table to give the html format. If don't exists any data, print message.
67 my @probes_rows = $schema->resultset('GeProbe')
68 ->search( { template_id => $template_id } );
70 $probe_n = scalar(@probes_rows);
73 foreach my $probe_row (@probes_rows) {
75 my %probe_data = $probe_row->get_columns();
76 my $probe_name = $probe_data{'probe_name'};
78 my $probe_link = '/sedm/probe.pl?id='.$probe_data{'probe_id'}; ## It will be used when the
79 ## when the code to get sequences
82 my $probe_type = $probe_data{'probe_type'} || $default_message;
83 my $start_coord = $probe_data{'template_start'} || $default_message;
84 my $end_coord = $probe_data{'template_end'} || $default_message;
86 my @spots = $schema->resultset('GeProbeSpot')
87 ->search( { probe_id => $probe_data{'probe_id'} } );
89 my $spots_n = scalar(@spots) || $default_message;
91 push @probe_list, [ $probe_name, $probe_type, $start_coord, $end_coord, $spots_n];
94 $probe_composition_html = columnar_table_html( headings => [ 'Probe name',
96 'Template start coord',
100 __align => ['l', 'c', 'c', 'c', 'c'],
103 $probe_composition_html = 'None probe was found associated to this template';
105 $probe_comp_content = info_section_html( title => "Probe Composition (". $probe_n .")",
106 contents => $probe_composition_html,
115 <% $probe_comp_content %>
119 /util/import_javascript.mas,
120 classes => 'CXGN.Effects'