#2 my $alnio = Bio::AlignIO->new('-file'=> 'out_file','-format' => 'clustalw'); my $dfactory = Bio::Tree::DistanceFactory->new('-method' => 'NJ'); my $stats = Bio::Align::ProteinStatistics->new; my $treeout = Bio::TreeIO->new('-format' => 'newick'); while( my $aln = $alnio->next_aln ) { my $mat = $stats->distance('-method' => 'Kimura', '-align' => $aln); my $tree = $dfactory->make_tree($mat); $treeout->write_tree($tree); }