1 # $Id: PositionWithSequence.pm,v 1.19 2006/09/20 10:20:01 sendu Exp $
3 # BioPerl module for Bio::Map::PositionWithSequence
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Sendu Bala <bix@sendu.me.uk>
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Map::PositionWithSequence - A position with a sequence.
21 use Bio::Map::PositionWithSequence;
23 my $pos = Bio::Map::PositionWithSequence->new(-map => $map,
31 Have a position with a sequence, eg. define what the binding site sequence of
32 a certain transcription factor binding site is by modelling it as one of these
33 objects with the -element assigned to a Bio::Map::TranscriptionFactor instance.
39 User feedback is an integral part of the evolution of this and other
40 Bioperl modules. Send your comments and suggestions preferably to
41 the Bioperl mailing list. Your participation is much appreciated.
43 bioperl-l@bioperl.org - General discussion
44 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 Please direct usage questions or support issues to the mailing list:
50 I<bioperl-l@bioperl.org>
52 rather than to the module maintainer directly. Many experienced and
53 reponsive experts will be able look at the problem and quickly
54 address it. Please include a thorough description of the problem
55 with code and data examples if at all possible.
59 Report bugs to the Bioperl bug tracking system to help us keep track
60 of the bugs and their resolution. Bug reports can be submitted via the
63 https://github.com/bioperl/bioperl-live/issues
65 =head1 AUTHOR - Sendu Bala
71 The rest of the documentation details each of the object methods.
72 Internal methods are usually preceded with a _
76 # Let the code begin...
78 package Bio
::Map
::PositionWithSequence
;
81 use base
qw(Bio::Map::Position Bio::LocatableSeq);
86 Usage : my $obj = Bio::Map::PositionWithSequence->new();
87 Function: Builds a new Bio::Map::PositionWithSequence object
88 Returns : Bio::Map::PositionWithSequence
89 Args : -map => Bio::Map::GeneMap object
90 -element => Bio::Map::Gene object
91 -relative => Bio::Map::GeneRelative object
92 -seq => string, length of this string will set the length
93 of this position's range
95 * If this position has no range, or if a single value can describe
97 -value => scalar : something that describes the single
98 point position or range of this
99 Position, most likely an int
101 * Or if this position has a range, at least two of *
102 -start => int : value of the start co-ordinate
103 -end => int : value of the end co-ordinate
104 -length => int : length of the range
109 my ($class, @args) = @_;
110 my $self = $class->SUPER::new
(@args);
112 my ($seq) = $self->_rearrange([qw( SEQ )], @args);
114 $self->seq($seq) if $seq;
122 Usage : my $string = $obj->seq();
123 Function: Get/set the sequence as a string of letters.
125 Args : Optionally on set the new value (a string). An optional second
126 argument presets the alphabet (otherwise it will be guessed).
131 my ($self, $str, $alpha) = @_;
133 # done like this because SUPER will set seq to undef if undef supplied,
134 # but GeneMap wants to send undef, undef, 1 to decendants of this method
138 $alpha ?
($seq = $self->SUPER::seq
($str, $alpha)) : ($seq = $self->SUPER::seq
($str));
141 $seq = $self->SUPER::seq
;
145 $self->length(length($seq));