NAME
Bio::Seq::Meta::Array - array-based generic implementation of a sequence class with residue-based meta information
SYNOPSIS
use Bio::LocatableSeq;
use Bio::Seq::Meta::Array;
my $seq = Bio::LocatableSeq->new(-id=>'test',
-seq=>'ACTGCTAGCT',
-start=>2434,
-start=>2443,
-strand=>1,
-varbose=>1, # to see warnings
);
bless $seq, Bio::Seq::Meta::Array;
# the existing sequence object can be a Bio::PrimarySeq, too
# to test this is a meta seq object
$seq->isa("Bio::Seq::Meta::Array")
|| $seq->throw("$seq is not a Bio::Seq::Meta::Array");
$seq->meta('1 2 3 4 5 6 7 8 9 10');
# accessors
$arrayref = $seq->meta();
$string = $seq->meta_text();
$substring = $seq->submeta_text(2,5);
$unique_key = $seq->accession_number();
DESCRIPTION
This class implements generic methods for sequences with residue-based meta information. Meta sequences with meta data are Bio::LocatableSeq objects with additional methods to store that meta information. See Bio::LocatableSeq and Bio::Seq::MetaI.
The meta information in this class can be a string of variable length and can be a complex structure. Blank values are undef or zero.
Application specific implementations should inherit from this class to override and add to these methods.
SEE ALSO
Bio::LocatableSeq, Bio::Seq::MetaI, Bio::Seq::Meta,
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bio.perl.org/MailList.html - About the mailing lists
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:
bioperl-bugs@bio.perl.org
http://bugzilla.bioperl.org/
AUTHOR - Heikki Lehvaslaiho
Email heikki@ebi.ac.uk
CONTRIBUTORS
Chad Matsalla, bioinformatics@dieselwurks.com Aaron Mackey, amackey@virginia.edu
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : new
Usage : $metaseq = Bio::Seq::Meta->new
( -meta => 'aaaaaaaabbbbbbbb',
-seq => 'TKLMILVSHIVILSRM'
-id => 'human_id',
-accession_number => 'S000012',
);
Function: Constructor for Bio::Seq::Meta class, meta data being in a
string. Note that you can provide an empty quality string.
Returns : a new Bio::Seq::Meta object
meta
Title : meta
Usage : $meta_values = $obj->meta($values_string);
Function:
Get and set method for the meta data starting from residue
position one. Since it is dependent on the length of the
sequence, it needs to be manipulated after the sequence.
The length of the returned value always matches the length
of the sequence.
Returns : reference to an array of meta data
Args : new value, string or array ref, optional
meta_text
Title : meta_text
Usage : $meta_values = $obj->meta_text($values_arrayref);
Function: Variant of meta() guarantied to return a textual
representation of meta data. For details, see L<meta>.
Returns : a string
Args : new value, string or array ref, optional
named_meta
Title : named_meta()
Usage : $meta_values = $obj->named_meta($name, $values_arrayref);
Function: A more general version of meta(). Each meta data set needs
to be named. See also L<meta_names>.
Returns : reference to an array of meta data
Args : scalar, name of the meta data set
new value, string or array ref, optional
_test_gap_positions
Title : _test_gap_positions
Usage : $meta_values = $obj->_test_gap_positions($name);
Function: Internal test for correct position of gap characters.
Gap being only '-' this time.
This method is called from named_meta() when setting meta
data but only if verbose is positive as this can be an
expensive process on very long sequences. Set verbose(1) to
see warnings when gaps do not align in sequence and meta
data and turn them into errors by setting verbose(2).
Returns : true on success, prints warnings
Args : none
named_meta_text
Title : named_meta_text()
Usage : $meta_values = $obj->named_meta_text($name, $values_arrayref);
Function: Variant of named_meta() guarantied to return a textual
representation of the named meta data.
For details, see L<meta>.
Returns : a string
Args : scalar, name of the meta data set
new value, string or array ref, optional
submeta
Title : submeta
Usage : $subset_of_meta_values = $obj->submeta(10, 20, $value_string);
$subset_of_meta_values = $obj->submeta(10, undef, $value_string);
Function:
Get and set method for meta data for subsequences.
Numbering starts from 1 and the number is inclusive, ie 1-2
are the first two residue of the sequence. Start cannot be
larger than end but can be equal.
If the second argument is missing the returned values
should extend to the end of the sequence.
The return value may be a string or an array reference,
depending on the implentation. If in doubt, use
submeta_text() which is a variant guarantied to return a
string. See L<submeta_text>.
Returns : A reference to an array or a string
Args : integer, start position
integer, end position, optional when a third argument present
new value, string or array ref, optional
submeta_text
Title : submeta_text
Usage : $meta_values = $obj->submeta_text(20, $value_string);
Function: Variant of submeta() guarantied to return a textual
representation of meta data. For details, see L<meta>.
Returns : a string
Args : new value, string or array ref, optional
named_submeta
Title : named_submeta
Usage : $subset_of_meta_values = $obj->named_submeta($name, 10, 20, $value_string);
$subset_of_meta_values = $obj->named_submeta($name, 10);
Function: Variant of submeta() guarantied to return a textual
representation of meta data. For details, see L<meta>.
Returns : A reference to an array or a string
Args : scalar, name of the meta data set
integer, start position
integer, end position, optional when a third argument present
new value, string or array ref, optional
named_submeta_text
Title : named_submeta_text
Usage : $meta_values = $obj->named_submeta_text($name, 20, $value_string);
Function: Variant of submeta() guarantied to return a textual
representation of meta data. For details, see L<meta>.
Returns : a string
Args : scalar, name of the meta data
Args : integer, start position, optional
integer, end position, optional
new value, string or array ref, optional
meta_names
Title : meta_names
Usage : @meta_names = $obj->meta_names()
Function: Retrives an array of meta data set names. The default
(unnamed) set name is guarantied to be the first name if it
contains any data.
Returns : an array of names
Args : none
Bio::PrimarySeqI methods
revcom
Title : revcom
Usage : $newseq = $seq->revcom();
Function: Produces a new Bio::Seq::MetaI implementing object where
the order of residues and their meta information is reversed.
Returns : A new (fresh) Bio::Seq::Meta object
Args : none
trunc
Title : trunc
Usage : $subseq = $seq->trunc(10,100);
Function: Provides a truncation of a sequence together with meta data
Returns : a fresh Bio::Seq::Meta implementing object
Args : Two integers denoting first and last residue of the sub-sequence.