[Bioperl-l] Building Many trees with Bioperl

Ben Ward (TSL) Ben.Ward at sainsbury-laboratory.ac.uk
Fri May 24 19:14:17 UTC 2013


Hi,

I'm new to Bioperl and plan to make a script to automate making trees with many alignment files (themselves generated by automating the process of multiple alignment for many datasets by using clustalw in a bioperl script).
But I need to get it right for one pice of test data before I can do it for all:

What I have produced so far is the below. It's supposed to load in the alignment file as as SimpleAlign. Then use that alignment in phyml. I looked at the documentation and tried to follow examples.

However it gives me many errors like:
--------------------- WARNING ---------------------
MSG: Replacing one sequence [FXCNDTJ02P/1-366]

And then gives me:
Phyml command = /Users/wardb/clustalw2/phyml /var/folders/kp/clkqvqn9739ffw2755zjwy74_skf_z/T/MTFzfN4jED/aln8058.phylip  0 i 1 0 HKY e e 1 e BIONJ y y

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Phyml call (/Users/wardb/clustalw2/phyml /var/folders/kp/clkqvqn9739ffw2755zjwy74_skf_z/T/MTFzfN4jED/aln8058.phylip  0 i 1 0 HKY e e 1 e BIONJ y y) did not give an output [/var/folders/kp/clkqvqn9739ffw2755zjwy74_skf_z/T/MTFzfN4jED/aln8058.phylip_phyml_stat.txt]: 11
STACK: Error::throw
STACK: Bio::Root::Root::throw /Library/Perl/5.12/Bio/Root/Root.pm:472
STACK: Bio::Tools::Run::Phylo::Phyml::_run /Library/Perl/5.12/Bio/Tools/Run/Phylo/Phyml.pm:851
STACK: /Library/Perl/5.12/Bio/Tools/Run/Phylo/Phyml.pm:338
-----------------------------------------------------------

Can someone let me know if I'm going about this correctly and what I need to do to get it to work. I've also tried to run phyml by giving the filename in the run() method like:
my $inputfilename = 'outputalignmentfile';
my $tree = $factory->run("$inputfilename");

But I get the same EXCEPTION: Bio::Root::Exception message.

Thanks,
Ben W.

SCRIPT ---

#!/usr/bin/perl
use warnings;
use strict;
BEGIN { $ENV{PHYMLDIR} = '/Users/wardb/clustalw2' }
use Bio::TreeIO;
use Bio::AlignIO;
use Bio::Tools::Run::Phylo::Phyml;

my $alnin = Bio::AlignIO->new(-file => "<outputalignmentfile",
-format => 'phylip');

my $aln = $alnin->next_aln();


# Make a Phyml factory.
my $factory = Bio::Tools::Run::Phylo::Phyml->new(-verbose => 2,
 -data_type => 'dna');

# Pass the factory an alignment and run:
# my $inputfilename = 'outputalignmentfile';

my $tree = $factory->run($aln); # $tree is a Bio::Tree::Tree object.


# Setup tree output stream...
my $treeio = Bio::TreeIO->new(-format => 'newick',
 -file => 'tree.newick');

$treeio->write_tree($tree);

exit 0;




More information about the Bioperl-l mailing list