NAME

Bio::Phylo::Adaptor::Bioperl::Matrix - Adaptor class for bioperl compatibility

SYNOPSIS

use Bio::Phylo::Matrices::Matrix;
use Bio::Phylo::Adaptor;

my $matrix = Bio::Phylo::Matrices::Matrix->new;

$Bio::Phylo::COMPAT = 'Bioperl';

my $alignment = Bio::Phylo::Adaptor->new($matrix);

print "compatible!" if $matrix->isa('Bio::Align::AlignI');

DESCRIPTION

This class wraps Bio::Phylo matrix objects to give them an interface compatible with bioperl.

METHODS

add_seq()

Adds another sequence to the alignment.

Title     : add_seq
Usage     : $myalign->add_seq($newseq);
Function  : Adds another sequence to the alignment. *Does not* align
            it - just adds it to the hashes.
Returns   : nothing
Argument  : a Bio::LocatableSeq object
            order (optional)

See Bio::LocatableSeq for more information.

remove_seq()

Removes a single sequence from an alignment.

Title     : remove_seq
Usage     : $aln->remove_seq($seq);
Function  : Removes a single sequence from an alignment
Returns   :
Argument  : a Bio::LocatableSeq object
sort_alphabetically()

Changes the order of the alignemnt to alphabetical on name followed by numerical by number.

Title     : sort_alphabetically
Usage     : $ali->sort_alphabetically
Function  : 

            Changes the order of the alignemnt to alphabetical on name 
            followed by numerical by number.

Returns   : 
Argument  : 
each_seq()

Gets an array of Seq objects from the alignment.

Title     : each_seq
Usage     : foreach $seq ( $align->each_seq() ) 
Function  : Gets an array of Seq objects from the alignment
Returns   : an array
Argument  : 
each_alphabetically()

Returns an array of sequence object sorted alphabetically.

Title     : each_alphabetically
Usage     : foreach $seq ( $ali->each_alphabetically() )
Function  :

            Returns an array of sequence object sorted alphabetically 
            by name and then by start point.
            Does not change the order of the alignment

Returns   : 
Argument  : 
each_seq_with_id()

Gets an array of Seq objects from the alignment.

Title     : each_seq_with_id
Usage     : foreach $seq ( $align->each_seq_with_id() ) 
Function  : 

            Gets an array of Seq objects from the
            alignment, the contents being those sequences
            with the given name (there may be more than one)

Returns   : an array
Argument  : a seq name
get_seq_by_pos()

Gets a sequence based on its position in the alignment.

Title     : get_seq_by_pos
Usage     : $seq = $aln->get_seq_by_pos(3) # third sequence from the alignment
Function  : 

            Gets a sequence based on its position in the alignment.
            Numbering starts from 1.  Sequence positions larger than
            no_sequences() will thow an error.

Returns   : a Bio::LocatableSeq object
Argument  : positive integer for the sequence osition
select()

Creates a new alignment from a continuous subset of sequences.

Title     : select
Usage     : $aln2 = $aln->select(1, 3) # three first sequences
Function  : 

            Creates a new alignment from a continuous subset of
            sequences.  Numbering starts from 1.  Sequence positions
            larger than no_sequences() will thow an error.

Returns   : a Bio::SimpleAlign object
Argument  : positive integer for the first sequence
            positive integer for the last sequence to include (optional)
select_noncont()

Creates a new alignment from a subset of sequences.

Title     : select_noncont
Usage     : $aln2 = $aln->select_noncont(1, 3) # first and 3rd sequences
Function  : 

            Creates a new alignment from a subset of
            sequences.  Numbering starts from 1.  Sequence positions
            larger than no_sequences() will thow an error.

Returns   : a Bio::SimpleAlign object
Args      : array of integers for the sequences
id()

Gets/sets the id field of the alignment.

Title     : id
Usage     : $myalign->id("Ig")
Function  : Gets/sets the id field of the alignment
Returns   : An id string
Argument  : An id string (optional)
missing_char()

Gets/sets the missing_char attribute of the alignment.

Title     : missing_char
Usage     : $myalign->missing_char("?")
Function  : Gets/sets the missing_char attribute of the alignment
            It is generally recommended to set it to 'n' or 'N' 
            for nucleotides and to 'X' for protein. 
Returns   : An missing_char string,
Argument  : An missing_char string (optional)
match_char()

Gets/sets the match_char attribute of the alignment.

Title     : match_char
Usage     : $myalign->match_char('.')
Function  : Gets/sets the match_char attribute of the alignment
Returns   : An match_char string,
Argument  : An match_char string (optional)
gap_char()

Gets/sets the gap_char attribute of the alignment.

Title     : gap_char
Usage     : $myalign->gap_char('-')
Function  : Gets/sets the gap_char attribute of the alignment
Returns   : An gap_char string, defaults to '-'
Argument  : An gap_char string (optional)
symbol_chars()

Returns all the seen symbols (other than gaps).

Title   : symbol_chars
Usage   : my @symbolchars = $aln->symbol_chars;
Function: Returns all the seen symbols (other than gaps)
Returns : array of characters that are the seen symbols
Argument: boolean to include the gap/missing/match characters
is_flush()

Tells you whether the alignment is flush, ie all of the same length

Title     : is_flush
Usage     : if( $ali->is_flush() )
          : 
          :
Function  : Tells you whether the alignment 
          : is flush, ie all of the same length
          : 
          :
Returns   : 1 or 0
Argument  : 
length()

Returns the maximum length of the alignment.

Title     : length()
Usage     : $len = $ali->length() 
Function  : Returns the maximum length of the alignment.
            To be sure the alignment is a block, use is_flush
Returns   : 
Argument  : 
maxdisplayname_length()

Gets the maximum length of the displayname in the alignment.

Title     : maxdisplayname_length
Usage     : $ali->maxdisplayname_length()
Function  : 

            Gets the maximum length of the displayname in the
            alignment. Used in writing out various MSE formats.

Returns   : integer
Argument  : 
no_sequences()

Number of sequence in the sequence alignment.

Title     : no_sequences
Usage     : $depth = $ali->no_sequences
Function  : number of sequence in the sequence alignment
Returns   : integer
Argument  : None
displayname()

Gets/sets the display name of a sequence in the alignment.

Title     : displayname
Usage     : $myalign->displayname("Ig", "IgA")
Function  : Gets/sets the display name of a sequence in the alignment
          :
Returns   : A display name string
Argument  : name of the sequence
            displayname of the sequence (optional)
set_displayname_flat()

Makes all the sequences be displayed as just their name, not name/start-end

Title     : set_displayname_flat
Usage     : $ali->set_displayname_flat()
Function  : Makes all the sequences be displayed as just their name,
            not name/start-end
Returns   : 1
Argument  : None

SEE ALSO

Bio::Align::AlignI

Bio::Phylo::Adaptor::Bioperl::Matrix is an adaptor that makes Bio::Phylo character matrices compatible with Bio::Align::AlignI objects.

Bio::Phylo::Manual

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

REVISION

$Id: Matrix.pm 4213 2007-07-15 03:11:27Z rvosa $