Bio::NEXUS::DistancesBlock - Represents DISTANCES block in NEXUS file
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.
All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
Tom Hladish (tjhladish at yahoo)
$Revision: 1.18 $
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)
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}
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)
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.
To install Bio::NEXUS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::NEXUS
CPAN shell
perl -MCPAN -e shell install Bio::NEXUS
For more information on module installation, please visit the detailed CPAN module installation guide.