[Bioperl-l] Using Bio::Matrix::PhylipDist
iain.wallace at ucd.ie
Mon Feb 28 06:23:58 EST 2005
I hope someone can help me. I am trying to read in a distance matrix
using Bio::Matrix::PhylipDist so that I can extract a subset of the
matrix. However I am having some trouble reading in the Matrix.
I have tried a few different matrices so I don't think that is the
problem. If any one has an idea on what I am doing wrong that would be great
I have tried a few of the examples I found, but cann't seem to get them
to work. It seems to be falling over at the $parser->next_matrix phase.
---Some of the examples I tried (from the module documentation) ----
my $parser = new Bio::Matrix::IO(-format => 'phylip'
-file => 't/data/phylipdist.out');
my $matrix = $parser->next_matrix;
Error: Can't use an undefined value as an ARRAY reference at (full
path)/Bio/Matrix/Generic.pm line 731
my $dist = Bio::Tools::Phylo::Phylip::ProtDist->new(
#get specific entries
my $distance_value = $dist->get_entry('ALPHA','BETA');
my @columns = $dist->get_column('ALPHA');
my @rows = $dist->get_row('BETA');
my @diagonal = $dist->get_diagonal();
#print the matrix in phylip numerical format
Error: Cann't locate object method "get_entry" via package.
Then I modified the code, after looking at the ProtDist.pm file
my $dist = $parser->next_matrix or die "could not parse matrix";
My script then dies at this point, not being able to parse the matrix.
More information about the Bioperl-l