NAME

Bio::NEXUS::DistancesBlock - Represents DISTANCES block in NEXUS file

SYNOPSIS

DESCRIPTION

The DistancesBlock class represents a NEXUS Distances Block and provides methods for reading, writing, and accessing data within these blocks. Distances Blocks contain distance matrices, or a table of calculated distances between each possible pair of taxa.

COMMENTS

FEEDBACK

All feedback (bugs, feature enhancements, etc.) are greatly appreciated.

AUTHORS

Tom Hladish (tjhladish at yahoo)

VERSION

$Revision: 1.18 $

METHODS

new

Title   : new
Usage   : block_object = new Bio::NEXUS::DistancesBlock($block_type, $commands, $verbose, $taxa);
Function: Creates a new Bio::NEXUS::DistancesBlock object
Returns : Bio::NEXUS::DistancesBlock object
Args    : type (string), the commands/comments to parse (array ref), and a verbose flag (0 or 1)

get_matrix

Title   : get_matrix
Usage   : $matrix = $self->get_matrix();
Function: Retrieves the entire distance matrix
Returns : a hashref of hashrefs
Args    : none
Note    : Distance values may be retrieved by specifying the row and column keys, e.g. $dist = $matrix->{$row_taxon}{$col_taxon}

get_distances_for

Title   : get_distances_for
Usage   : %taxon1_distances = %{ $self->get_distances_for($first_taxon) };
Function: Retrieves a row of the distance matrix
Returns : 
Args    : the row label (a taxlabel) for the row desired (string)

get_distance_between

Title   : get_distance_between
Usage   : $distance = $self->get_distance_between($row_taxon, $column_taxon);
Function: Retrieves a cell from the matrix
Returns : A scalar (number)
Args    : the row and column labels (both taxa) for the cell desired
Note    : Generally get_distance_between($A, $B) == get_distance_between($B, $A); however, this need not be true if the distance matrix is not symmetric.  Make sure you are asking for the distance you want.