5 CXGN::Cview::ChrLink - an class for drawing chromosome relationships.
9 Inherits from L<CXGN::Cview::ImageObject>.
13 See also the documentation in L<CXGN::Cview>.
17 Lukas Mueller (lam87@cornell.edu)
28 use CXGN
::Cview
::ImageObject
;
30 package CXGN
::Cview
::ChrLink
;
32 use base qw
/CXGN::Cview::ImageObject/;
39 my $self = bless $args, $class;
45 $self->{marker_name
}=shift;
47 # define default color
48 $self -> set_color
(100, 100, 100);
54 $self->{color
}[0]=shift;
55 $self->{color
}[1]=shift;
56 $self->{color
}[2]=shift;
63 # draw only of both markers are visible...
64 if ($self->{chr1
}->is_visible($self->{cM1
}) && $self->{chr2
}->is_visible($self->{cM2
})) {
65 my $sign = (($self->{chr2
}->get_horizontal_offset()) <=> ($self->{chr1
}->get_horizontal_offset()));
66 my $x1 = $self->{chr1
}->get_horizontal_offset() + $sign*($self->{chr1
}->get_width()/2);
67 my $y1 = $self->{chr1
}->mapunits2pixels($self->{cM1
});
68 my $x2 = $self->{chr2
}->get_horizontal_offset() - $sign*($self->{chr2
}-> get_width
()/2);
69 my $y2 = $self->{chr2
}->mapunits2pixels($self->{cM2
});
71 #print STDERR "link color: $self->{color}[0], $self->{color}[1], $self->{color}[2]\n";
72 my $color = $image -> colorResolve
($self->{color
}[0], $self->{color
}[1], $self->{color
}[2]);
73 $image->setAntiAliased($color);
74 $image -> line
($x1, $self->{chr1
}->get_vertical_offset()+$y1, $x2, $self->{chr2
}->get_vertical_offset()+$y2, gdAntiAliased
);
77 #print STDERR "Not rendering link because not visible. chr1 cM: $self->{cM1} chr2 cM: $self->{cM2}\n";
82 =head2 get_marker_name(), set_marker_name()
95 return $self->{marker_name
};
101 $self->{marker_name
}=shift;