The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::Phylo::Matrices::Sequence - The molecular sequence object.

SYNOPSIS

 use Bio::Phylo::Matrices::Sequence;
 use Bio::Phylo::Matrices::Alignment;
 use Bio::Phylo::Taxa::Taxon;

 #instantiating a sequence object...
 my $sequence = Bio::Phylo::Matrices::Sequence->new;
 $sequence->set_type('DNA');
 $sequence->set_seq('ACGCATCGACTCAGAC');
 
 #...and linking it to a taxon object
 $sequence->set_taxon(Bio::Phylo::Taxa::Taxon->new( -name => 'Homo_sapiens' ));
 
 #instantiate an alignment object...
 my $alignment = Bio::Phylo::Matrices::Alignment->new;
 
 #...and insert the sequence into the alignment
 $alignment->insert($sequence);

DESCRIPTION

The sequence object models a character sequence, which can be crossreferenced with a taxon object, and inserted in an alignment object.

METHODS

CONSTRUCTOR

new()
 Type    : Constructor
 Title   : new
 Usage   : my $sequence = Bio::Phylo::Matrices::Sequence->new;
 Function: Instantiates a Bio::Phylo::Matrices::Sequence object.
 Returns : A Bio::Phylo::Matrices::Sequence object.
 Args    : Optional arguments:
           -type  => 'DNA', (a string)
           -seq   => 'ACGCATCGACTACGCAG', (a string)
           -taxon => $taxon (a Bio::Phylo::Taxa::Taxon object)

MUTATORS

set_taxon()
 Type    : Mutator
 Title   : set_taxon
 Usage   : $sequence->set_taxon($taxon);
 Function: Assigns the taxon a sequence refers to.
 Returns : Modified Bio::Phylo::Matrices::Sequence object.
 Args    : $taxon must be a Bio::Phylo::Taxa::Taxon object.
set_type()
 Type    : Mutator
 Title   : set_type
 Usage   : $sequence->set_type($type);
 Function: Assigns a sequence's type.
 Returns : Modified object.
 Args    : $type must be one of [DNA|RNA|STANDARD|PROTEIN|
           NUCLEOTIDE|CONTINUOUS]. If DNA, RNA or NUCLEOTIDE is defined, the
           subsequently set seq is validated against the IUPAC nucleotide one
           letter codes. If PROTEIN is defined, the seq is validated against
           IUPAC one letter amino acid codes. Likewise, a STANDARD seq has to
           be a single integer [0-9], while for CONTINUOUS all of Perl's number
           formats are allowed.
set_seq()
 Type    : Mutator
 Title   : set_seq
 Usage   : $sequence->set_seq('ACGTCGGATCGATCGACACA');
 Function: Assigns a character string to the sequence object.
 Returns : The modified Bio::Phylo::Matrices::Sequence object.
 Args    : A character string.
 Comments: The string argument is checked against the allowed ranges for the
           various character types: IUPAC nucleotide (for types of DNA|RNA|
           NUCLEOTIDE), IUPAC single letter amino acid codes (for type PROTEIN),
           integers (STANDARD) or any of perl's decimal formats (CONTINUOUS).
           The character type must be specified first using the
           $sequence->set_type method.

ACCESSORS

get_taxon()
 Type    : Accessor
 Title   : get_taxon
 Usage   : my $taxon = $sequence->get_taxon;
 Function: Retrieves the taxon a sequence refers to.
 Returns : Bio::Phylo::Taxa::Taxon
 Args    : NONE
get_type()
 Type    : Accessor
 Title   : get_type
 Usage   : my $type = $sequence->get_type;
 Function: Retrieves a sequence's type.
 Returns : One of [DNA|RNA|STANDARD|PROTEIN|NUCLEOTIDE|CONTINUOUS]
 Args    : NONE
get_seq()
 Type    : Accessor
 Title   : get_seq
 Usage   : my $string = $sequence->get_char;
 Function: Retrieves a sequence object's raw character string;
 Returns : A character string.
 Args    : NONE

SEE ALSO

Bio::Phylo

This object inherits from Bio::Phylo, so the methods defined therein are also applicable to Bio::Phylo::Matrices::Sequence objects.

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual.

FORUM

CPAN hosts a discussion forum for Bio::Phylo. If you have trouble using this module the discussion forum is a good place to start posting questions (NOT bug reports, see below): http://www.cpanforum.com/dist/Bio-Phylo

BUGS

Please report any bugs or feature requests to bug-bio-phylo@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-Phylo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Be sure to include the following in your request or comment, so that I know what version you're using:

$Id: Sequence.pm,v 1.9 2005/09/29 20:31:18 rvosa Exp $

AUTHOR

Rutger A. Vos,

email: rvosa@sfu.ca
web page: http://www.sfu.ca/~rvosa/

ACKNOWLEDGEMENTS

The author would like to thank Jason Stajich for many ideas borrowed from BioPerl http://www.bioperl.org, and CIPRES http://www.phylo.org and FAB* http://www.sfu.ca/~fabstar for comments and requests.

COPYRIGHT & LICENSE

Copyright 2005 Rutger A. Vos, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.