6 mason component to take experiment data associated to a sample from the database and return it as html
18 A mason component to take experiment data associated to a sample from the database and return it as html.
25 Aureliano Bombarely (ab782@cornell.edu)
41 use CXGN::GEM::Schema;
42 use CXGN::GEM::Target;
43 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
46 my @target_list = @{ $target_list };
48 ## Only return something if it is defined $sample and it have a sample_id
50 if (scalar(@target_list) > 0 ) {
54 foreach my $target (@target_list) {
56 my $target_id = $target->get_target_id();
57 my $target_name = $target->get_target_name();
58 my $target_link = '/gem/target.pl?id=' . $target_id;
59 my $target_html = "<a href=$target_link>$target_name</a><br>";
61 my $experiment = $target->get_experiment();
62 my $exp_id = $experiment->get_experiment_id();
63 my $exp_name = $experiment->get_experiment_name();
64 my $exp_link = '/gem/experiment.pl?id=' . $exp_id;
65 my $exp_html = "<a href=$exp_link>$exp_name</a><br>";
67 push @exp_list, [$exp_html, $target_html];
71 ## Use columnar table to give the html format. If don't exists any data, print message.
73 my $exp_composition_html = columnar_table_html( headings => [ 'Experiment', 'Target' ],
76 __align => ['c', 'c'], );
79 my $exp_n = scalar(@exp_list);
81 $exp_composition_html = 'None experiment was found associated to this sample';
84 $exp_content = info_section_html( title => "Expression Experiments (".$exp_n.")",
85 contents => $exp_composition_html,
96 /util/import_javascript.mas,
97 classes => 'CXGN.Effects'