Entering edit mode
9.7 years ago
Andrea
▴
60
Constucting a Tree
Hi everyone!
I'm trying to construct a tree and get its newick format:
outfile.fasta
>seq9
---KNWEDFEIAAENMYMANPQNCRYTMKYVHSKGHILLKMSDNVKCVQYRAENMPDLKK
-----------------------------------------------
>seq7
----SWEEFVERSVQLFRGDPNATRYVMKYRHCEGKLVLKVTDDRECLKFKTDQAQDAKK
MEKLNNIFF--------------------------------------
>seq8
----SWDEFVDRSVQLFRADPESTRYVMKYRHCDGKLVLKVTDNKECLKFKTDQAQEAKK
MEKLNNIFFTLM-----------------------------------
>seq10
--FDSWDEFVSKSVELFRNHPDTTRYVVKYRHCEGKLVLKVTDNHECLKFKTDQAQDAKK
MEK--------------------------------------------
>seq6
--FTNWEEFAKAAERLHSANPEKCRFVTKYNHTKGELVLKLTDDVVCLQYSTNQLQDVKK
LEKLSSTLLRSI-----------------------------------
>seq5
----SWEEFAKAAEVLYLEDPMKCRMCTKYRHVDHKLVVKLTDNHTVLKYVTDMAQDVKK
IEKLTTLLMR-------------------------------------
>seq4
------EEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVVS-YEMRLFGVQKD
NFALEHSLL--------------------------------------
>seq0
--FQTWEEFSRAAEKLYLADPMKVRVVLKYRHVDGNLCIKVTDDLVCLVYRTDQAQDVKK
IEKF-------------------------------------------
>seq1
-KYRTWEEFTRAAEKLYQADPMKVRVVLKYRHCDGNLCIKVTDDVVCLLYRTDQAQDVKK
IEKFHSQLMRLMELKVTDNKECLKFKTDQAQEAKKMEKLNNIFFTLM
>seq2
EEYQTWEEFARAAEKLYLTDPMKVRVVLKYRHCDGNLCMKVTDDAVCLQYKTDQAQDVKK
VEKLHGK----------------------------------------
>seq3
-MYQVWEEFSRAVEKLYLTDPMKVRVVLKYRHCDGNLCIKVTDNSVCLQYKTDQAQDVK-
-----------------------------------------------
Code
use strict;
use warnings;
use Bio::AlignIO;
use Bio::Align::ProteinStatistics;
use Bio::Tree::DistanceFactory;
use Bio::TreeIO;
my $alnio = Bio::AlignIO->new(-file => 'outfile.fasta', -format=>'fasta');
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);
}
I get this message and this output:
UNIVERSAL->import is deprecated and will be removed in a future perl a +t C:/Perl6 4/site/lib/Bio/Tree/TreeFunctionsI.pm line 94. (seq0:0.04012,(seq2:0.06428,(seq4:0.22277,seq3:0.00000):0.14038):0.055 +06,(seq1:0 .08162,((seq9:0.71067,seq6:0.16093):0.24442,(seq5:0.28833,(seq10:0.127 +18,(seq7:0 .06605,seq8:0.08745):0.01099):0.42868):0.01353):0.15249):0.00931);
Is something wrong?