[Bioperl-l] parsing paml results

Ke Jiang biojiangke at gmail.com
Wed Feb 19 16:45:16 UTC 2014


Hi,

I'm trying to write a wrapper script for running PAML and parsing the
results. The code is here:

#!/usr/bin/perl

# generic perl modules
use strict;
use warnings;
# module for manipulating alignments
use Bio::AlignIO;
# module for manipulating trees
use Bio::TreeIO;
# module for running PAML
use Bio::Tools::Run::Phylo::PAML::Codeml;
# modules for parsing PAML results
use Bio::Tools::Phylo::PAML::Codeml;
use Bio::Tools::Phylo::PAML::Result;
use Bio::Tools::Phylo::PAML;

# usage information for the script
my $usage = "Usage: lineageW_PAML.pl alignment.phylip phylogeny.tree\n";

# read in an input file with genomic coordinates
my $phylipaln = $ARGV[0];
my $newicktree = $ARGV[1];

unless ($phylipaln) {
    warn "$usage\n";
    exit;
}

unless ($newicktree) {
    warn "$usage\n";
    exit;
}

my $alignio = Bio::AlignIO->new(-file => $phylipaln, -format => 'phylip',
-idlength=>50);
my $aln = $alignio->next_aln;
my $treeio = Bio::TreeIO->new(-file => $newicktree, -format => "newick");
my $tree = $treeio->next_tree;

my $codeml = Bio::Tools::Run::Phylo::PAML::Codeml->new( -params => {
'runmode' => 2, 'seqtype' => 1,} );
$codeml->alignment($aln);
$codeml->tree($tree);
my ($rc,$parser) = $codeml->run();
if( my $result = $parser->next_result() ) {
my $tree = $result->get_tree();
for my $node ($tree->get_nodes()) {
    print $node->param('omega'), "\n";
  }
}


The codeml (running with mode 2) seems running just fine (also tested in
the command line) but the script stops at line 46:  if( my $result =
$parser->next_result() ), when I try to get the results, the tree with
labels indicating dN, dS and omega values. It keeps throwing me the error
message: 'StarDecomposition not yet implemented!' Sounds like the parser
doesn't understand my results or the method to parse this particular type
of results has not been implemented. Does anyone have a clue what's
happening here?

Thanks for the help!

Ke

-- 
Ke Jiang, Ph.D.
Post-doctoral Fellow
Delbruck Laboratory
Cold Spring Harbor Laboratory
Cold Spring Harbor, NY 11724



More information about the Bioperl-l mailing list