class Bio::Nexus::DistancesBlock

DESCRIPTION

Bio::Nexus::DistancesBlock represents a distances nexus block.

Example of Distances block:

Begin Distances;

Dimensions nchar=20 ntax=5;
Format Triangle=Upper;
Matrix
 taxon_1 0.0 1.0 2.0 4.0 7.0
 taxon_2 1.0 0.0 3.0 5.0 8.0
 taxon_3 3.0 4.0 0.0 6.0 9.0
 taxon_4 7.0 3.0 1.0 0.0 9.5
 taxon_5 1.2 1.3 1.4 1.5 0.0;

End;

USAGE

require 'bio/db/nexus'

# Create a new parser:
nexus = Bio::Nexus.new( nexus_data_as_string )

# Get distances block(s):
distances_blocks = nexus.get_distances_blocks
# Get matrix as Bio::Nexus::NexusMatrix object:
matrix = distances_blocks[ 0 ].get_matrix
# Get value (column 0 are names):
val = matrix.get_value( 1, 5 )