[Bioperl-l] Using Bio::Matrix::PhylipDist

Jason Stajich jason.stajich at duke.edu
Mon Feb 28 09:39:04 EST 2005


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
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/

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 
> phase.
>
> ---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(
>    -file=>"t/data/phylipdist.out",
>    -program=>"ProtDist");
>  #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.
>
>
> Thanks
>
> Iain
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20050228/e41f9b2f/PGP.bin


More information about the Bioperl-l mailing list