[Bioperl-l] Error in constructing Phylogenetic tree using BioPerl

Jason Stajich jason at bioperl.org
Tue Jun 26 19:27:05 EDT 2007


On Jun 26, 2007, at 11:13 AM, Sendu Bala wrote:

> SujiBala wrote:
>> Hi Hello
>>   This is sujatha from singapore. I am trying to construct phylo  
>> tree using DNAStatistics and Kirma method. But I am getting the  
>> following error message. It would be nice if you could help me  
>> resolve this problem asap.
>>
>>   Error messasge
>>     Must supply  a valid Bio::Align::AlignI for the _align  
>> parameter  in the distance
>>   My program
>>   use Bio::AlignIO;
>> use Bio::Align::DNAStatistics;
>> use Bio::Tree::DistanceFactory;
>> # for a dna alignment  can also use ProteinStatistics
>> @aln = Bio::AlignIO->new(-file => 'out4.fa', -format=>'clustalw');
>> $stats = Bio::Align::DNAStatistics->new;
>> $mat = $stats->distance( -align  => @aln,-method => 'Kimura');
>

yep you want to call next_aln on the Bio::AlignIO object.
I fixed the example code in the HOWTO so it should work properly now;
http://bioperl.org/wiki/HOWTO:Trees#Constructing_Trees

> Without looking at the docs for these modules, it is immediately  
> obvious
> that Bio::AlignIO->new() is going to return an instance of  
> Bio::AlignIO
> and not an array of alignments. It is also obvious that the -align =>
> parameter for the distance() method can't take an array of anything  
> (but
> probably an array ref?).
>
> Check the documentation and make sure you know what objects you're
> generating and passing around.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

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




More information about the Bioperl-l mailing list