3 # BioPerl module for Bio::LiveSeq::Mutation
5 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
7 # Copyright Heikki Lehvaslaiho
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::LiveSeq::Mutation - Mutation event descriptor class
19 # full descrition of a point mutation
20 $mutation1a = Bio::LiveSeq::Mutation->new ( -seq => 'A',
23 -len => 1 # optional, defaults to length(seq)
26 # minimal information for a point mutation
27 $mutation1b = Bio::LiveSeq::Mutation->new ( -seq => 'A',
31 $mutation2 = Bio::LiveSeq::Mutation->new ( -seq => 'ATT',
36 $mutation3 = Bio::LiveSeq::Mutation->new ( -seq => '', # optional
37 -seqori => 'TTG', # optional
42 $mutation4 = Bio::LiveSeq::Mutation->new ( -seq => 'CC',
43 -seqori => 'TTG', # optional
51 This class describes a local mutation event using minimalistic
52 description. It is not necessary to know anything about the original
53 sequence. You need to give the changed sequence, the position of the
54 mutation in the (unidentified) reference sequence, and the length of
55 the affected subsequence in the reference sequence. If the original
56 allele sequence is given, the objects applying the mutation into the
57 reference sequence (e.g. L<Bio::LiveSeq::Mutator>) might check for its
64 User feedback is an integral part of the evolution of this and other
65 Bioperl modules. Send your comments and suggestions preferably to the
66 Bioperl mailing lists Your participation is much appreciated.
68 bioperl-l@bioperl.org - General discussion
69 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
73 report bugs to the Bioperl bug tracking system to help us keep track
74 the bugs and their resolution. Bug reports can be submitted via the
77 http://bugzilla.open-bio.org/
79 =head1 AUTHOR - Heikki Lehvaslaiho
81 Email: heikki-at-bioperl-dot-org
85 The rest of the documentation details each of the object
86 methods. Internal methods are usually preceded with a _
91 # Let the code begin...
93 package Bio
::LiveSeq
::Mutation
;
96 # Object preamble - inheritance
99 use base
qw(Bio::Root::Root);
102 my($class,@args) = @_;
107 my ($seq, $seqori, $pos, $len, $label) =
108 $self->_rearrange([qw(SEQ
115 $seq && $self->seq($seq);
116 $seqori && $self->seqori($seqori);
117 $pos && $self->pos($pos);
118 defined($len) && $self->len($len); # defined() added otherwise won't work for len==0
120 return $self; # success - we hope!
130 Sets and returns the mutated sequence. No checking is done
131 to validate the symbols.
141 my ($self,$value) = @_;
142 if( defined $value) {
143 $self->{'seq'} = $value;
145 return $self->{'seq'} || '';
152 Usage : $obj->seqori();
155 Sets and returns the original subsequence in the reference
156 sequence. No checking is done to validate the symbols.
167 my ($self,$value) = @_;
168 if( defined $value) {
169 $self->{'seqori'} = $value;
171 return $self->{'seqori'} || '';
181 Sets and returns the position of the first element in the
192 my ($self,$value) = @_;
193 if( defined $value) {
194 if ( $value !~ /^([+-])?\d+$/ ) {
195 $self->throw("[$value] for pos has to be an integer\n");
197 $self->{'pos'} = $value;
200 return $self->{'pos'};
209 Sets and returns the len of the affected original allele
210 sequence. If value is not set, defaults to the lenght of
211 the mutated sequence (seq).
220 my ($self,$value) = @_;
221 if ( defined $value) {
222 $self->{'len'} = $value;
224 if ( ! exists $self->{'len'} ) {
225 return length $self->{'seq'};
227 return $self->{'len'};
233 Usage : $obj->label();
236 Sets and returns the label of the affected original allele
237 location. Label is a stable identifier whereas location
238 can be changed by mutations. Label comes from
239 l<Bio::LiveSeq::Gene>.
248 my ($self,$value) = @_;
249 if ( defined $value) {
250 $self->{'label'} = $value;
252 if ( ! exists $self->{'label'} ) {
255 return $self->{'label'};
262 Usage : $obj->transpos();
265 Sets and returns the transcript position of the mutation.
266 Set when associated with a reference sequence. Value
267 depends on reference molecule and the co-ordinate system
278 my ($self,$value) = @_;
279 if( defined $value) {
280 if ( $value !~ /^([+-])?\d+$/ ) {
281 $self->throw("[$value] for transpos has to be an integer\n");
283 $self->{'transpos'} = $value;
286 return $self->{'transpos'};
293 Usage : $obj->issue();
296 Sets and returns the position of the mutation in an array
297 of mutations to be issued. Set after the validity of the
298 mutation has been confirmed.
308 my ($self,$value) = @_;
309 if( defined $value) {
310 if ( $value !~ /^([+-])?\d+$/ ) {
311 $self->throw("[$value] for issue has to be an integer\n");
313 $self->{'issue'} = $value;
316 return $self->{'issue'};
323 Usage : $obj->prelabel();
326 Sets and returns the prelabel of the affected original allele
327 location. Prelabel is a stable identifier whereas location
328 can be changed by mutations. Prelabel comes from
329 l<Bio::LiveSeq::Gene>.
338 my ($self,$value) = @_;
339 if ( defined $value) {
340 $self->{'prelabel'} = $value;
342 if ( ! exists $self->{'prelabel'} ) {
345 return $self->{'prelabel'};
352 Usage : $obj->postlabel();
355 Sets and returns the postlabel of the affected original allele
356 location. Postlabel is a stable identifier whereas location
357 can be changed by mutations. Postlabel comes from
358 l<Bio::LiveSeq::Gene>.
367 my ($self,$value) = @_;
368 if ( defined $value) {
369 $self->{'postlabel'} = $value;
371 if ( ! exists $self->{'postlabel'} ) {
374 return $self->{'postlabel'};
381 Usage : $obj->lastlabel();
384 Sets and returns the lastlabel of the affected original allele
385 location. Lastlabel is a stable identifier whereas location
386 can be changed by mutations. Lastlabel comes from
387 l<Bio::LiveSeq::Gene>.
396 my ($self,$value) = @_;
397 if ( defined $value) {
398 $self->{'lastlabel'} = $value;
400 if ( ! exists $self->{'lastlabel'} ) {
403 return $self->{'lastlabel'};