[Bioperl-l] Re: a problem with DNAStatistics

Jason Stajich jason at portal.open-bio.org
Tue Oct 18 15:26:53 EDT 2005


Hmm are you sure you are using bioperl 1.4?  Did someone upgrade it  
without telling you?
You can check by running this:
perl -MBio::Align::DNAStatistics -e 'print  
$Bio::Align::DNAStatistics::VERSION, "\n"'

The API changed after bioperl 1.4 so that it returned a Matrix object  
not an array reference.

The errors you are seeing suggest that $mat is not an array  
reference, I am guessing it is a Bio::Matrix::PhylipDist object.

See the updated documentation:
http://doc.bioperl.org/bioperl-live/Bio/Align/DNAStatistics.html

You'll want to call
$mat->print_matrix
to see the matrix.

-jason

On Oct 18, 2005, at 12:40 PM, eran elhaik wrote:

> Dear Sir
>
>
>
> I am having a problem with the module: DNAStatistics
>
> I can not repeat the example provided on the web site: http:// 
> doc.bioperl.org/releases/bioperl-1.4/Bio/Align/DNAStatistics.html
>
>
>
>   use Bio::AlignIO;
>
>   use Bio::Align::DNAStatistics;
>
>
>
>   my $stats = new Bio::Align::DNAStatistics;
>
>   my $alignin = new Bio::AlignIO(-format => 'emboss',
>
>                                  -file   => 't/data/insulin.water');
>
>   my $aln = $alignin->next_aln;
>
>   my $jc = $stats->distance(-align => $aln,
>
>                             -method => 'Jukes-Cantor');
>
>   foreach my $d ( @$jc )  {
>
>       print "\t";
>
>       foreach my $r ( @$d ) {
>
>           print "$r\t";
>
>       }
>
>       print "\n";
>
>
> This is the example.
>
>
>
> I repeat the same exact thing is my code with the attached sample  
> file:
>
>
>
> Notice that the code:
>
> ######################################
>
>        foreach my $d ( @$mat  )
>
>        {
>
>              print "\t";
>
>
>
>              foreach my $r ( @$d )
>
>               {
>
>                     print "$r\t";
>
>               }
>
>              print "\n";
>
>        }
>
> ######################################
>
>
>
> In my code is the same exact as in the example but I get the error:
>
>
>
> Not an ARRAY reference at trees.pl line 101.
>
>
>
> To run my program write:     perl trees.pl Sample.txt
>
>
>
>
>
>
>
> Thank you for your help!
>
>
>
>
>
> ____________________________________
>
> Eran Elhaik:           Lab Phone: (713) 743-2312
>
> Doctoral Student
>
> University of Houston
>
> http://nsmn1.uh.edu/~dgraur/eran/main.htm
>
> ____________________________________
>
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.12.2/137 - Release Date:  
> 10/16/2005
>
>
> <trees.pl>
> <Sample.txt>

--
Jason Stajich
jason at bioperl.org
http://jason.open-bio.org/




More information about the Bioperl-l mailing list