3 CXGN::Transcript::DrawContigAlign::ContigAlign - stores alignment data for a strand in a unigene.
7 Initialize it with all of the relevant values and use accessors to access the data.
9 $contigAlign = ContigAlign->new('Source ID', 'Sequence ID', '+', 10, 400, 20, 33, 1);
10 $sourceID = $contigAlign->sourceID; #returns 'Source ID'
14 ContigAlign stores alignment data for a strand in a unigene, primarily for use with CXGN::Transcript::DrawContigAlign, which uses it to store data that is being used to produce a graph.
18 Rafael Lizarralde <xarbiogeek@gmail.com> (July 2009)
20 =head1 MEMBER FUNCTIONS
22 =head2 constructor C<new>
28 $contigAlign = CXGN::Transcript::DrawContigAlign::ContigAlign->new('Source ID', 'Sequence ID', '+', 10, 400, 20, 33, 1);
32 a CXGN::Transcript::DrawContigAlign::ContigAlign object
40 the ID tag for the strand
44 the ID tag for the unigene
48 identifier if the strand is complementary or not (if not, it should be '+')
52 the base pair in the unigene's sequence at which this strand starts
56 the base pair at which this strand ends
60 the number of base pairs at the beginning that do not match
64 the number of base pairs at the end that do not match
68 whether or not the strand should be highlighted on the graph
80 returns a string with the ID tag for the strand
84 returns a string with the ID tag for the unigene
88 returns a string with an identifier indicating whether the strand is complementary or not
92 returns an integer indicating the base pair at which this strand starts
96 returns an integer indicating the base pair at which this strand ends
100 returns an integer indicating the number of base pairs that do not match at the start
104 returns an integer indicating the number of base pairs that do not match at the end
108 returns an integer indicating the first matching base pair (startLoc + startTrim)
112 returns an integer indicating the last matching base pair (endLoc - endTrim)
116 returns a boolean indicating whether this strand is highlighted
122 package CXGN
::Transcript
::DrawContigAlign
::ContigAlign
;
125 use MooseX
::Method
::Signatures
;
127 has sourceID
=> (is
=> 'ro', isa
=> 'Str');
128 has sequenceID
=> (is
=> 'ro', isa
=> 'Str');
129 has strand
=> (is
=> 'ro', isa
=> 'Str');
130 has startLoc
=> (is
=> 'ro', isa
=> 'Int');
131 has endLoc
=> (is
=> 'ro', isa
=> 'Int');
132 has startTrim
=> (is
=> 'ro', isa
=> 'Int');
133 has endTrim
=> (is
=> 'ro', isa
=> 'Int');
134 has start
=> (is
=> 'ro', isa
=> 'Int');
135 has end
=> (is
=> 'ro', isa
=> 'Int');
136 has highlight
=> (is
=> 'ro', isa
=> 'Bool', default => undef);
141 return { sourceID
=> $_[0], sequenceID
=> $_[1], strand
=> $_[2],
142 startLoc
=> $_[3], endLoc
=> $_[4], startTrim
=> $_[5], endTrim
=> $_[6],
143 start
=> $_[3] + $_[5], end
=> $_[4] - $_[6], highlight
=> $_[7],
145 } else { return $class->SUPER::BUILDARGS
(@_); }
148 =head2 accessor C<compare>
154 print "contig1 is less than contig2!" if($contig1->compare($contig2) < 0);
158 a negative value if the instance from which the method is called is less than the argument, zero if they are equal, and a positive value if the argument is greater
162 $other another ContigAlign object
168 method compare
(CXGN
::Transcript
::DrawContigAlign
::ContigAlign
$other!) {
169 ($self->start - $other->start != 0) ?
170 return $self->start - $other->start:
171 return $self->end - $other->end;
174 __PACKAGE__
->meta->make_immutable;
179 This is primarily used by CXGN::Transcript::DrawContigAlign, which, in turn, is used by CXGN::Transcript::Unigene.
180 DrawContigAlign also uses CXGN::Transcript::DrawContigAlign::DepthData and CXGN::Transcript::DrawContigAlign::Pane.