5 basic_platform_info.mas
6 Mason component to show the basic information for platform web page.
18 Mason component to show the basic information for platform web page.
20 - Mason root page = platform_detail.mas
21 - Perl controller = platform.pl
23 This component use out schema dbi connection to get data about CXGN::People::Person
29 Aureliano Bombarely (ab782@cornell.edu)
45 use CXGN::GEM::Schema;
46 use CXGN::Biosource::Sample;
47 use CXGN::Page::FormattingHelpers qw/ info_section_html info_table_html columnar_table_html page_title_html html_break_string /;
52 my $basic_info_content;
53 my $platform_accession;
55 my $default_message = '<i><font color="gray">data not available</font></i>';
57 ## If there aren't any experiment_row that comes from experimental_design_detail.mas, it will return a message.
59 if (defined $platform->get_platform_id()) {
61 ## Get the schema object
62 my $schema = $platform->get_schema();
64 my $platform_name = $platform->get_platform_name();
65 my $description = $platform->get_description();
66 $platform_accession = $platform_name;
68 my $template_count = $platform->count_templates();
69 my $probe_count = $platform->count_probes();
71 my $techtype = $platform->get_technology_type();
72 my $techtype_name = $techtype->get_technology_name();
74 ## Get the platform design links
77 my @sample_id_list = $platform->get_design_list();
78 foreach my $sample_id (@sample_id_list) {
79 my $sample = CXGN::Biosource::Sample->new($schema, $sample_id);
80 my $sample_name = $sample->get_sample_name();
81 my $sample_link = '/biosource/sample.pl?id=' . $sample_id;
82 my $sample_html = "<a href=$sample_link>$sample_name</a>";
84 push @design_links, $sample_html;
86 my $design_links = join('<br>', @design_links) || $default_message;
88 ## Get the external links
90 my @dbxref_list_id = $platform->get_dbxref_list();
91 my @dbxref_html_list = ();
93 foreach my $dbxref_id (@dbxref_list_id) {
94 my ($dbxref_row) = $schema->resultset('General::Dbxref')
95 ->search({ dbxref_id => $dbxref_id });
97 if (defined $dbxref_row) {
98 my ($db_row) = $schema->resultset('General::Db')
99 ->search({ db_id => $dbxref_row->get_column('db_id') });
101 my $dbxref_link = $db_row->get_column('urlprefix') .
102 $db_row->get_column('url') .
103 $dbxref_row->get_column('accession');
105 my $dbxref_html = $db_row->get_column('name') .
106 ": <a href=$dbxref_link>" .
107 $dbxref_row->get_column('accession')."</a>";
109 push @dbxref_html_list, $dbxref_html;
113 my $dbxref_html_list = join('<br>', @dbxref_html_list) || $default_message;
115 ## Get information of the contact
117 my $person_id = $platform->get_contact_id();
118 my ($complete_name, $contact_email);
119 if (defined $person_id) {
121 my $person = CXGN::People::Person->new($dbh, $person_id);
123 my $salutation = $person->get_salutation() || 'Dr.';
124 my $first_name = $person->get_first_name();
125 my $last_name = $person->get_last_name();
126 $contact_email = $person->get_contact_email || $default_message;
127 if (defined $salutation && defined $first_name && defined $last_name) {
128 $complete_name = "$salutation $first_name $last_name";
130 $complete_name = $default_message;
134 $complete_name = $default_message;
135 $contact_email = $default_message;
140 ## Create the HTML table
142 $basic_info_content = <<HTML;
145 <tr> <td width="25%"> <b>Platform name:</b> </td> <td> $platform_name </td></tr>
146 <tr> <td width="25%"> <b>Technology type:</b> </td> <td> $techtype_name </td></tr>
147 <tr> <td width="25%"> <b>Description:</b> </td> <td> $description </td></tr>
148 <tr> <td width="25%"> <b>Template number:</b> </td> <td> $template_count </td></tr>
149 <tr> <td width="25%"> <b>Probe number:</b> </td> <td> $probe_count </td></tr>
150 <tr> <td width="25%"> <b>Design datasets:</b> </td> <td> $design_links </td></tr>
151 <tr> <td width="25%"> <b>Platform external links:</b> </td> <td> $dbxref_html_list </td></tr>
152 <tr> <td width="25%"> <b>Contact info:</b> </td> <td> <b>Name:</b> $complete_name </td></tr>
153 <tr> <td width=""> </td> <td> <b>E-mail:</b> $contact_email </td></tr>
160 $basic_info_content = "<big>There aren't any platform data for the specified parameters.</big>";
164 if (defined $platform_accession) {
165 $basic_info_html = "<center><big><b>Expression Platform: $platform_accession</b></big></center><br>";
168 $basic_info_html .= info_section_html( title => "Platform Basic Information", contents => $basic_info_content );
172 <% $basic_info_html %>
175 /util/import_javascript.mas,
176 classes => 'CXGN.Effects'