6 /cview/map/index.mas - a Mason component to display top level map web page
10 This Mason component displays a web page with an overview graph of a map, an abstract and some statistics about the map, using map_id or map_version_id as a parameter.
12 This component is based on older Perl scripts that accepted other parameters, such as the mysterious legacy_id or the more cumbersome map short name, and a 'physical' parameter that then somehow displayed a physical map. Support for these has been scrapped. Sorry!
14 On the other hand, a new parameter was added, called "force", which, if set to true, will force the cached images and stats to be re-calculated. Normally, the map overview image and associated image map and the map statistics are cached.
22 The img tag and associated html to display the overview graphics [html]
26 the map_version_id of the map to display.
30 the abstract of the map [text]
34 a space separated, url-encoded string that gives the markers to be highlighted.
38 the size of the map to display. 0 denotes the standard size (smallest), 10 denotes the largest size.
42 items to add to the map, as a multi-line string with chr offset name
52 the page (uri + args) that this component is called from (to be able to construct links back from the page comment feature)
60 the basepath of the installation
64 if set to true, force the image and map stats caches to be re-calculated.
68 whether the map knows how to overlay information on the map [boolean]
72 whether the map is private [boolean]. Will cause the map to be shown only for logged in users who own the map.
74 =item parent1_stock_id
76 the stock_id of parent1
78 =item parent1_stock_name
80 the name of stock parent1
82 =item parent2_stock_id
84 the stock_id of parent2
86 =item parent2_stock_name
88 the name of stock parent2
94 Adapted to Mason by Lukas Mueller. Early Perl-only versions were written by Robert Ahrens, with later additions by Lukas Mueller and John Binns <zombieite@gmail.com>.
96 Currently maintained by Lukas Mueller <lam87\@cornell.edu>.
104 $map_version_id => undef
108 $short_name => "untitled map"
109 $long_name => "untitled map"
121 @hilite_markers => ()
123 $chromosome_stats => ''
127 $parent1_stock_id => ''
128 $parent1_stock_name => '(unknown)'
129 $parent2_stock_id => ''
130 $parent2_stock_name => '(unknown)'
136 # Historic Perl comment by Robert Ahrens, ca. 2003
138 # sub hack_abstract ($$$) {
139 # # Look. This is a total hack and that's that. Let's make no
140 # # bones about it. There is doubtlessly a good way to handle this,
141 # # but in the meantime this sub will allow us to swap in a decent
142 # # abstract for the physical mapping project w/o having to redesign
144 # my ($abstract, $map, $physical) = @_;
148 <& /page/page_title.mas, title=> $short_name &>
150 <div class="container-fluid">
152 <div id="pagetitle2"><center><h3><%$long_name%></h3></center></div>
160 % print "<div class=\"boxbgcolor5\"><b>NOTE:</b><br />$message</div>\n";
163 <& /cview/map/overview.mas,
164 map_version_id => $map_version_id,
165 overview_image => $overview_image,
167 hilite_markers => [ @hilite_markers ],
168 map_items=> $map_items,
169 basepath => $basepath,
175 <& /cview/map/overlay_form.mas,
176 map_version_id => $map_version_id,
177 can_overlay => $can_overlay,
178 map_items => $map_items,
187 <&| /page/info_section.mas, title=>"Abstract", collapsible=>1, collapsed=>0 &>
193 % my ($stock1_link, $stock2_link) = ("", "");
194 % $parent1_stock_id ? $stock1_link='' : $stock1_link = "/stock/$parent1_stock_id/view";
195 % $parent2_stock_id ? $stock2_link='' : $stock2_link = "/stock/$parent2_stock_id/view";
196 <&| /page/info_section.mas, collapsible => 1, title=>"Parents of Mapping Population" &>
197 <p>Parent 1 <a href="<% $stock1_link %>"><% $parent1_stock_name %></a></p>
198 <p>Parent 2 <a href="<% $stock2_link %>"><% $parent2_stock_name %></a></p>
203 % my $html = '<table class="table table-hover table-condensed table-bordered"><thead><tr class="info"><th>Chromosome</th><th>Markers</th></tr></thead><tbody>';
204 % foreach (@$chromosome_stats) { $html .= "<tr><td>$_->[0]</td><td>$_->[1]</td></tr>"; $total += $_->[2]; }
205 % $html .= '<tr><td><b>Total:</b></td><td>'.$total.'</td></tr></tbody>';
206 % $html .= '</table>';
207 <&| /page/info_section.mas,
208 title => 'Map Statistics',
214 <div class="col-sm-6 col-md-6 col-lg-6">
217 <div class="col-sm-6 col-md-6 col-lg-6">
218 <div class="panel panel-info">
219 <div class="panel-heading">Overview</div>
220 <div class="panel-body">
228 <& /page/comments.mas, object_type=>"map", object_id => $map_version_id, referer => $referer &>