add more STDERR output for merge function.
[cxgn-corelibs.git] / lib / CXGN / Cview.pm
blobe23ec4eedc8db168a21594346483b16e9bfebcfd
2 # Lukas Mueller, July 2004.
3 #
5 our $VERSION = "2.0";
7 =head1 NAME
9 Cview.pm - objects for the SGN chromosome viewer
11 =head1 SYNOPSIS
13 my $map_image = CXGN::Cview::MapImage -> new($dbh, 500, 600);
15 my $map = CXGN::Cview::MapFactory->new($dbh, { map_version_id=>55 });
16 my $chr1 = $map->get_chromosome($chr_nr);
17 $chr1->set_vertical_offset(50);
18 $chr1->set_horizontal_offset(100);
19 $chr1->set_height(300);
20 $chr1->set_labels_left();
21 $chr1->set_display_marker_offset();
22 $chr1->set_hilite(50, 100);
24 my @m1 = $chr1->get_markers();
26 for (my $i=0; $i<@m1; $i++) {
28 #$m1[$i]->hide();
29 $m1[$i]->hide_label();
30 if ($i % 5 ==0) {
31 $m1[$i]->hilite(); $m1[$i]->show_label();
35 # adding a ruler
37 my $ruler = CXGN::Cview::Ruler -> new (200, 20, 550, 0, $chr1->get_chromosome_length());
38 $ruler -> set_labels_right();
39 $map -> add_ruler($ruler);
41 # adding a physical map
43 # (same as adding any chromosome, but specify an id for a physical map)
46 # rendering the image
48 $map_image -> render_jpg();
50 =head1 AUTHOR(S)
52 Lukas Mueller (lam87@cornell.edu)
54 =head1 Cview CLASSES
56 The Cview package defines several objects:
58 =over 5
60 =item 1)
62 A C<MapImage> object that is like a canvas to draw other objects on
64 =item 2)
66 A C<CXGN::Chromosome> object that contains chromosome information, such as markers and links between chromosomes
68 =item 3)
70 A C<CXGN::Marker> object that contains the marker information
72 =item 4)
74 A C<CXGN::ChrLink> object that stores information about markers that are linked on different chromosomes
76 =item 5)
78 A C<CXGN::Ruler> object that draws a ruler
80 =item 6)
82 A C<CXGN::Chromosome::Physical> object, which inherits from chromosome and draws a physical map.
84 =item 7)
86 A C<CXGN::Chromosome::IL> object, which inherits from chromosome, and draws an IL map.
88 =back
90 These objects can be placed on the MapImage at will and know how to render themselves using the render() function.
92 =head1 LICENSE
94 Copyright (c) 2002-2006 Sol Genomics Network and Cornell University.
96 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
98 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
100 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
102 =cut
104 use strict;
105 use GD;