5 CXGN::Cview::Map_overviews::Physical - a class to draw physical map representations.
9 see L<CXGN::Cview::Map_overviews>.
16 Lukas Mueller (lam87@cornell.edu)
26 This class implements/overrides the following functions:
32 =head1 CXGN::Cview::Map_overviews::physical_overview
34 A class to display a genetic map with the overgo results next to it.
35 Inherits from CXGN::Cview::Map_overviews.
41 package CXGN
::Cview
::Map_overviews
::Physical
;
43 use base
qw( CXGN::Cview::Map_overviews::Generic );
47 my $marker_name = shift;
48 push @
{$self->{hilite_markers
}}, $marker_name;
54 if ($self->has_cache()) { return; }
57 $self->{map_image
}=CXGN
::Cview
::MapImage
->new("", 13*$self->get_horizontal_spacing(), 150);
60 my $cM_eq = 0.4; # 1 cM corresponds to 0.4 pixels.
61 my $max_chr_len_cM = 0;
62 my $max_chr_len_pixels = 0;
66 for (my $i=1; $i<=@
{$self->get_map()->linkage_groups()}; $i++) {
67 $c[$i]= CXGN
::Cview
::Chromosome
-> new
(1, 100, $self->get_horizontal_spacing()*$i, 40);
68 CXGN
::Cview
::Cview_data_adapter
::fetch_chromosome
($self, $c[$i], $self->get_map(), $i);
69 my @markers = $c[$i]->get_markers();
70 #$self->set_marker_count($i, scalar(@markers));
72 foreach my $m (@markers) {
74 $m -> set_color
(200, 100, 100);
75 if ($m->get_offset() > $chr_len) { $chr_len = $m->get_offset(); }
77 $c[$i]->set_caption($i);
78 $c[$i]->set_width(12);
79 #$c[$i]->set_url("/cview/view_chromosome.pl?map_id=$self->{map_id}&chr_nr=$i");
80 my $chr_len_pixels = $chr_len*$cM_eq;
81 $c[$i]->set_height($chr_len_pixels);
82 if ($chr_len > $max_chr_len_cM) {
83 $max_chr_len_cM = $chr_len;
84 $max_chr_len_pixels = $chr_len_pixels;
86 $c[$i]->set_length($chr_len);
89 $c[$i]->set_rasterize_link("/cview/view_chromosome.pl?map_version_id=".$self->get_map()->map_version_id()."&chr_nr=$i&show_ruler=1&show_zoomed=1&show_physical=1&cM=");
91 $self->{map_image
}->add_chromosome($c[$i]);
93 my @p; # the physical maps
96 for (my $i=1; $i<=@
{$self->get_map()->linkage_groups()}; $i++) {
97 $p[$i]= CXGN
::Cview
::Physical
-> new
(1, 100, $self->get_horizontal_spacing()*$i+22, 40);
98 CXGN
::Cview
::Cview_data_adapter
::fetch_chromosome
($self, $p[$i], $self->get_map(), $i);
99 CXGN
::Cview
::Cview_data_adapter
::fetch_physical
($self, $p[$i], $self->get_map(), $i);
100 $p[$i]->set_box_height(2);
101 my @markers = $p[$i]->get_markers();
102 # $self->{marker_count}[$i] = scalar(@markers);
104 foreach my $m (@markers) {
106 if ($m->get_offset() > $chr_len) { $chr_len = $m->get_offset(); }
109 my $chr_len_pixels = $chr_len*$cM_eq;
110 $p[$i]->set_height($chr_len_pixels);
111 if ($chr_len > $max_chr_len_cM) {
112 $max_chr_len_cM = $chr_len;
113 $max_chr_len_pixels = $chr_len_pixels;
115 #$c[$i]->rasterize(5);
116 #$c[$i]->set_rasterize_link("/cview/view_chromosome.pl?map_id=$self->{map_id}&chr_nr=$i&show_zoomed=1&cM=");
118 $self->{map_image
}->add_physical($p[$i]);
120 # print STDERR "mac chr len pixels: $max_chr_len_pixels, max chr len: $max_chr_len_cM\n";
121 $self->{map_image
}->add_ruler(CXGN
::Cview
::Ruler
->new(20, 40, $max_chr_len_pixels, 0, $max_chr_len_cM));
123 $self->set_image_map( $self->{map_image
}->get_image_map("#mapmap") );
126 package CXGN
::Cview
::Map_overviews
::physical_overview
;
128 use base qw
| CXGN
::Cview
::Map_overviews
::Physical
| ;
132 my $self = $class->SUPER::new
(@_);