[Bioperl-l] Patch to Bioperl Modules

Jason Stajich jason.stajich at duke.edu
Fri Oct 21 14:44:12 EDT 2005


Looks good -

What about using the already existing 'id' field for a tree rather  
than adding the description field?


-jason

On Oct 21, 2005, at 1:58 PM, Filipe Garrett wrote:

> 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) = @_;
> <
> < }
> <
> <
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
http://www.duke.edu/~jes12




More information about the Bioperl-l mailing list