[Bioperl-l] Re: a problem with DNAStatistics
Jason Stajich
jason at portal.open-bio.org
Tue Oct 18 22:06:01 EDT 2005
[I am CCing bioperl-l so that others can learn from these Q&A]
Well ... what do you want to do?
See the documentation for Bio::Matrix::PhylipDist
http://doc.bioperl.org/bioperl-live/Bio/Matrix/PhylipDist.html
It holds all the pairwise distances.
If you want to print it out use the code I sent which includes the
line to $matrix->print_matrix.
You can write it out with Bio::Matrix::IO module.
You can build NJ trees from it with Bio::Tree::DistanceFactory
-jason
On Oct 18, 2005, at 4:05 PM, eran elhaik wrote:
> Hi Jason thanks for your answer,
>
> I am using BioPrel 1.5
>
>
>
> How should I address the Matrix object?
>
>
>
>
>
> _____
>
> From: Jason Stajich [mailto:jason at bioperl.org]
> Sent: Tuesday, October 18, 2005 2:27 PM
> To: eran elhaik
> Cc: bioperl-ml List
> Subject: Re: a problem with DNAStatistics
>
>
>
> 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:
>
> HYPERLINK
> "http://doc.bioperl.org/bioperl-live/Bio/Align/
> DNAStatistics.html"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: HYPERLINK
> "http://doc.bioperl.org/releases/bioperl-1.4/Bio/Align/
> DNAStatistics.html"ht
> tp://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
>
> HYPERLINK
> "BLOCKED::http://nsmn1.uh.edu/~dgraur/eran/main.htm"http://
> nsmn1.uh.edu/~dgr
> aur/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
>
> HYPERLINK "mailto:jason at bioperl.org"jason at bioperl.org
>
> HYPERLINK "http://jason.open-bio.org"http://jason.open-bio.org/
>
>
>
>
>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.12.2/137 - Release Date:
> 10/16/2005
>
>
>
> --
> 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
>
>
--
Jason Stajich
jason at bioperl.org
http://jason.open-bio.org/
More information about the Bioperl-l
mailing list