[Bioperl-l] Patch to Bioperl Modules

Filipe Garrett fgarret at ub.edu
Fri Oct 21 13:58:34 EDT 2005


Hi all,

I've been using the PAML parser and wanted to capture the number of 
parameters for each model. Since it was not implemented, I've made some 
changes to two Bioperl Modules (Tree.pm and PAML.pm). I've put the 
number of parameters as a tree description. For that I've added the 
method description to Tree.pm

Another slight change that I made was to change the hardcoded "mlc" file 
name in the run method of Codeml to the outfile variable that is 
declared some lines before in the method

Please take this changes into consideration.

Bests

Filipe Vieira

diff -N of the changes

Codeml.pm
497c497
<          $parser = new Bio::Tools::Phylo::PAML(-file => 
"$tmpdir/$outfile",
---
 >   


Tree.pm
242,258d241
< =head2 description
<
<  Title   : description
<  Usage   : $obj->description($newval)
<  Function: Get/Set the description string
<  Returns : value of description
<  Args    : newvalue (optional)
<
<
< =cut
<
< sub description{
<     my $self = shift;
<     $self->{'_description'} = shift @_ if @_;
<     return $self->{'_description'};
< }
<
279a263
 >
318d301
<


PAML.pm
830c830
<     my 
($instancecount,$num_param,$loglikelihood,$score,$done,$treelength) = 
(0,0,0,0,0);
---
 >     my ($instancecount,$loglikelihood,$score,$done,$treelength) = 
(0,0,0,0,0);
848,850c848,849
<       } elsif( /^\s*lnL\(.+np\:\s*(\d+)\)\:\s+(\S+)/ ) {
<       $num_param = $1;
<           $loglikelihood = $2;
---
 >       } elsif( /^\s*lnL\(.+\)\:\s+(\S+)/ ) {
 >           $loglikelihood = $1;
859d857
<     $tree->description("num_param: $num_param");
1395,1400d1392
< sub _parse_rst {
<   my ($self) = @_;
<
< }
<
<


More information about the Bioperl-l mailing list