[Bioperl-l] Using Bio::Matrix::PhylipDist
iain.wallace at ucd.ie
Mon Feb 28 10:22:54 EST 2005
Thanks for your help; The tests passed, and this showed my how I should
use the function.
The following from the test file works:
my $parser = new Bio::Matrix::IO(-format => 'phylip'
-file => 't/data/phylipdist.out');
my $matrix = $parser->next_matrix;
Jason Stajich wrote:
> Not sure what version of Bioperl you are using?
> Do the tests in t/Matrix.t pass?
> Is your matrix file really populated? Try running it with the test
> file t/data/phylipdist.out instead.
> Jason Stajich
> jason.stajich at duke.edu
> On Feb 28, 2005, at 6:23 AM, Iain Wallace wrote:
>> Hi all,
>> 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
>> ---Some of the examples I tried (from the module documentation) ----
>> from Bio::Matrix::IO::phylip
>> use Bio::Matrix::IO;
>> 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
>> from Bio::Matrix::PhylipDist
>> use Bio::Tools::Phylo::Phylip::ProtDist;
>> 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
>> print $dist->print_matrix;
>> 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.
>> Bioperl-l mailing list
>> Bioperl-l at portal.open-bio.org
More information about the Bioperl-l