2 # BioPerl module for Bio::LiveSeq::Mutation
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
8 # Copyright Heikki Lehvaslaiho
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::LiveSeq::Mutation - Mutation event descriptor class
20 # full description of a point mutation
21 $mutation1a = Bio::LiveSeq::Mutation->new ( -seq => 'A',
24 -len => 1 # optional, defaults to length(seq)
27 # minimal information for a point mutation
28 $mutation1b = Bio::LiveSeq::Mutation->new ( -seq => 'A',
32 $mutation2 = Bio::LiveSeq::Mutation->new ( -seq => 'ATT',
37 $mutation3 = Bio::LiveSeq::Mutation->new ( -seq => '', # optional
38 -seqori => 'TTG', # optional
43 $mutation4 = Bio::LiveSeq::Mutation->new ( -seq => 'CC',
44 -seqori => 'TTG', # optional
52 This class describes a local mutation event using minimalistic
53 description. It is not necessary to know anything about the original
54 sequence. You need to give the changed sequence, the position of the
55 mutation in the (unidentified) reference sequence, and the length of
56 the affected subsequence in the reference sequence. If the original
57 allele sequence is given, the objects applying the mutation into the
58 reference sequence (e.g. L<Bio::LiveSeq::Mutator>) might check for its
65 User feedback is an integral part of the evolution of this and other
66 Bioperl modules. Send your comments and suggestions preferably to the
67 Bioperl mailing lists Your participation is much appreciated.
69 bioperl-l@bioperl.org - General discussion
70 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
74 Please direct usage questions or support issues to the mailing list:
76 I<bioperl-l@bioperl.org>
78 rather than to the module maintainer directly. Many experienced and
79 reponsive experts will be able look at the problem and quickly
80 address it. Please include a thorough description of the problem
81 with code and data examples if at all possible.
85 report bugs to the Bioperl bug tracking system to help us keep track
86 the bugs and their resolution. Bug reports can be submitted via the
89 https://github.com/bioperl/bioperl-live/issues
91 =head1 AUTHOR - Heikki Lehvaslaiho
93 Email: heikki-at-bioperl-dot-org
97 The rest of the documentation details each of the object
98 methods. Internal methods are usually preceded with a _
103 # Let the code begin...
105 package Bio
::LiveSeq
::Mutation
;
108 # Object preamble - inheritance
111 use base
qw(Bio::Root::Root);
114 my($class,@args) = @_;
119 my ($seq, $seqori, $pos, $len, $label) =
120 $self->_rearrange([qw(SEQ
127 $seq && $self->seq($seq);
128 $seqori && $self->seqori($seqori);
129 $pos && $self->pos($pos);
130 defined($len) && $self->len($len); # defined() added otherwise won't work for len==0
132 return $self; # success - we hope!
142 Sets and returns the mutated sequence. No checking is done
143 to validate the symbols.
153 my ($self,$value) = @_;
154 if( defined $value) {
155 $self->{'seq'} = $value;
157 return $self->{'seq'} || '';
164 Usage : $obj->seqori();
167 Sets and returns the original subsequence in the reference
168 sequence. No checking is done to validate the symbols.
179 my ($self,$value) = @_;
180 if( defined $value) {
181 $self->{'seqori'} = $value;
183 return $self->{'seqori'} || '';
193 Sets and returns the position of the first element in the
204 my ($self,$value) = @_;
205 if( defined $value) {
206 if ( $value !~ /^([+-])?\d+$/ ) {
207 $self->throw("[$value] for pos has to be an integer\n");
209 $self->{'pos'} = $value;
212 return $self->{'pos'};
221 Sets and returns the len of the affected original allele
222 sequence. If value is not set, defaults to the length of
223 the mutated sequence (seq).
232 my ($self,$value) = @_;
233 if ( defined $value) {
234 $self->{'len'} = $value;
236 if ( ! exists $self->{'len'} ) {
237 return length $self->{'seq'};
239 return $self->{'len'};
245 Usage : $obj->label();
248 Sets and returns the label of the affected original allele
249 location. Label is a stable identifier whereas location
250 can be changed by mutations. Label comes from
251 l<Bio::LiveSeq::Gene>.
260 my ($self,$value) = @_;
261 if ( defined $value) {
262 $self->{'label'} = $value;
264 if ( ! exists $self->{'label'} ) {
267 return $self->{'label'};
274 Usage : $obj->transpos();
277 Sets and returns the transcript position of the mutation.
278 Set when associated with a reference sequence. Value
279 depends on reference molecule and the co-ordinate system
290 my ($self,$value) = @_;
291 if( defined $value) {
292 if ( $value !~ /^([+-])?\d+$/ ) {
293 $self->throw("[$value] for transpos has to be an integer\n");
295 $self->{'transpos'} = $value;
298 return $self->{'transpos'};
305 Usage : $obj->issue();
308 Sets and returns the position of the mutation in an array
309 of mutations to be issued. Set after the validity of the
310 mutation has been confirmed.
320 my ($self,$value) = @_;
321 if( defined $value) {
322 if ( $value !~ /^([+-])?\d+$/ ) {
323 $self->throw("[$value] for issue has to be an integer\n");
325 $self->{'issue'} = $value;
328 return $self->{'issue'};
335 Usage : $obj->prelabel();
338 Sets and returns the prelabel of the affected original allele
339 location. Prelabel is a stable identifier whereas location
340 can be changed by mutations. Prelabel comes from
341 l<Bio::LiveSeq::Gene>.
350 my ($self,$value) = @_;
351 if ( defined $value) {
352 $self->{'prelabel'} = $value;
354 if ( ! exists $self->{'prelabel'} ) {
357 return $self->{'prelabel'};
364 Usage : $obj->postlabel();
367 Sets and returns the postlabel of the affected original allele
368 location. Postlabel is a stable identifier whereas location
369 can be changed by mutations. Postlabel comes from
370 l<Bio::LiveSeq::Gene>.
379 my ($self,$value) = @_;
380 if ( defined $value) {
381 $self->{'postlabel'} = $value;
383 if ( ! exists $self->{'postlabel'} ) {
386 return $self->{'postlabel'};
393 Usage : $obj->lastlabel();
396 Sets and returns the lastlabel of the affected original allele
397 location. Lastlabel is a stable identifier whereas location
398 can be changed by mutations. Lastlabel comes from
399 l<Bio::LiveSeq::Gene>.
408 my ($self,$value) = @_;
409 if ( defined $value) {
410 $self->{'lastlabel'} = $value;
412 if ( ! exists $self->{'lastlabel'} ) {
415 return $self->{'lastlabel'};