5 hybridization_composition.mas
6 Mason component to show data about hybridizations.
18 Mason component to show information for hybridization web page.
19 This component is used by platform, experiment and target
20 Use as argument an array reference composed by CXGN::GEM::Target objects.
22 - Mason root page = platform_detail.mas, experiment_detail.mas, target_detail.mas
23 - Perl controller = platform.pl, experiment.pl, target.pl
29 Aureliano Bombarely (ab782@cornell.edu)
43 use CXGN::GEM::Schema;
44 use CXGN::GEM::Platform;
46 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
54 ## If there aren't any experiment that comes from experimental design it will do nothing.
55 ## The error message will returned by basic information
58 my $hyb_composition_html;
60 my @target_list = @{ $target_list };
62 if (scalar(@target_list) > 0) {
65 my $schema = $target_list[0]->get_schema();
67 foreach my $target (@target_list) {
68 my $target_id = $target->get_target_id();
69 my $target_name = $target->get_target_name();
70 my $target_link = '/gem/target.pl?id='.$target_id;
71 my $target_html = "<a href=$target_link>$target_name</a>";
73 my $exp = $target->get_experiment();
74 my $exp_id = $exp->get_experiment_id();
75 my $exp_name = $exp->get_experiment_name();
76 my $exp_link = '/gem/experiment.pl?id='.$exp_id;
77 my $exp_html = "<a href=$exp_link>$exp_name</a>";
79 my @hyb_rows = $schema->resultset('GeHybridization')
80 ->search({ target_id => $target_id });
82 foreach my $hyb_row (@hyb_rows) {
83 my $hyb_id = $hyb_row->get_column('hybridization_id');
84 my $platform_id = $hyb_row->get_column('platform_id');
85 my $platform = CXGN::GEM::Platform->new($schema, $platform_id);
87 my $platform_name = $platform->get_platform_name();
88 my $platform_link = '/gem/platform.pl?id='.$platform_id;
89 my $platform_html = "<a href=$platform_link>$platform_name</a>";
91 push @data, [$hyb_id, $platform_html, $exp_html, $target_html];
96 ## Use columnar table to give the html format. If don't exists any data, print message.
98 $hyb_composition_html = columnar_table_html( headings => [ 'Hybridization id', 'Platform', 'Experiment', 'Target'],
101 __align => ['c', 'l', 'l', 'l'],
108 $hyb_composition_html = "No hybridization associated with this element <br>";
111 my $hyb_n = scalar(@data);
112 $hyb_comp_content = info_section_html( title => "Hybridizations (".$hyb_n.")",
113 contents => $hyb_composition_html,
120 <% $hyb_comp_content %>
124 /util/import_javascript.mas,
125 classes => 'CXGN.Effects'