[Bioperl-l] Saving Codeml Output file

Jason Stajich jason.stajich at gmail.com
Mon Aug 29 20:05:57 EDT 2011


I think you are mistaken on how to use the factory running objects and associated parser.

You don't have to instantiate a parser as this is what is returned by the run command. The whole point is you don't need to get to the tempdir or specify opening of the mlc file or all the other output files from the program. you get to use the parser to get the data out and then it cleans up afterwards so you can run many iterations of runs in separate folders without having to cleanup afterwards.

http://www.bioperl.org/wiki/HOWTO:PAML

my $factory = Bio::Tools::Run::Phylo::PAML::Codeml->new( ... );
my ($rc,$parser) = $factory->run( );

if( my $result = $parser->next_result )  {
 #  $result is a Bio::Tools::Phylo::PAML object
}


On Aug 29, 2011, at 4:19 PM, Lorenzo Carretero Paulet wrote:

> Kevin,
> That's pretty reasonable, but unfortunately still doesn't run. Even if I create
> the file as $outfile and give it as value to the wrapper as -outfile
> =>$outfile. It seems as if Bio::Tools::Run::Phylo::PAML::Codeml failed at
> creating the outfile. Did anyone manage to generate the outfile from
> Bio::Tools::Run::Phylo::PAML::Codeml.
> Cheers,
> Lorenzo
> 
> Mensaje citado por Kevin Brown <Kevin.M.Brown at asu.edu>:
> 
>> OK, went back to the original message.
>> 
>> And here's where the problem actually originates...
>> 
>> my $codeml_factory = new Bio::Tools::Run::Phylo::PAML::Codeml
>> 						(
>> 				# this should cause it to create a file
>> called mlc
>> 						-outfile => '>mlc',
>> 						-save_tempfiles => 1,
>> 						-alignment =>
>> $codon_MSA,
>> 						-tree =>
>> $biotree,
>> 						-params =>
>> {
>>  	'verbose' => 1,
>> 	'noisy' => 9,
>> 	'runmode' => 0, #user tree
>> 	'seqtype' => 1,
>> 	'model' => $model,
>> 	'NSsites' => $NSsites,
>> 	'fix_omega' => $fix_omega,
>> 	'omega' => $omega,
>> 	'ncatG' => $ncatG,
>> 	'icode' => 0, #* 0:universal code; 1:mammalian mt; 2-10:see
>> below (5:ciliate nuclear)
>> 	#'fix_alpha' => 0,
>> 	#'fix_kappa' => 0,
>> 	#'RateAncestor' => 0,
>> 	'CodonFreq' => 2,
>> 	'cleandata' => 1, # remove sites with amibguity data (1 yes, 0
>> no),
>> 	'ndata' => 1
>> },
>> );
>> 
>> 
>> Kevin Brown
>> Center for Innovations in Medicine
>> Biodesign Institute
>> Arizona State University
>> 
>>> -----Original Message-----
>>> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
>>> bounces at lists.open-bio.org] On Behalf Of Lorenzo Carretero Paulet
>>> Sent: Monday, August 29, 2011 9:47 AM
>>> To: bioperl-l at lists.open-bio.org
>>> Subject: [Bioperl-l] Saving Codeml Output file
>>> 
>>> Hi all,
>>> I'm running codeml from the PAML package using the corresponding
>>> Bioperl
>>> wrapper. I'd like to save the output file as -outfile => 'mlc', as in:
>>> my $codeml_factory = new Bio::Tools::Run::Phylo::PAML::Codeml
>>> 						( -outfile => 'mlc',
>>> 						-save_tempfiles => 1,
>>> 						-alignment =>
>> $codon_MSA,
>>> 						-tree =>
>> $biotree,
>>> 						-params =>
>>> {
>>> #'outfile' =>'mlc',
>>> 	'verbose' => 1,
>>> 	'noisy' => 9,
>>> 'runmode' => 0, #user tree
>>> 'seqtype' => 1,
>>> 'model' => $model,
>>> 'NSsites' => $NSsites,
>>> 'fix_omega' => $fix_omega,
>>> 'omega' => $omega,
>>> 'ncatG' => $ncatG,
>>> 'icode' => 0, #* 0:universal code; 1:mammalian mt; 2-10:see below
>>> (5:ciliate
>>> nuclear)
>>> 	#'fix_alpha' => 0,
>>> 	#'fix_kappa' =>
>>> 0,							#'RateAncestor'
>> => 0,
>>> 							'CodonFreq' =>
>> 2,
>>> 						'cleandata' =>
>>> 1, # remove sites with amibguity data (1 yes, 0 no),
>>> 'ndata' => 1
>>> 
>> },
>>> 						);
>>> 
>>> and subsequently parsing it using
>>> my $parserF= Bio::Tools::Phylo::PAML->new (-file => "mlc", -dir =>
>>> "./");
>>> 
>>> However, I get the following message.
>>> 
>>> ------------- EXCEPTION -------------
>>> MSG: Could not open mlc: No such file or directory
>>> STACK Bio::Root::IO::_initialize_io
>>> /Library/Perl//5.10.0/Bio/Root/IO.pm:351
>>> STACK Bio::Tools::Phylo::PAML::new
>>> /Library/Perl//5.10.0/Bio/Tools/Phylo/PAML.pm:239
>>> STACK main::BranchSiteEvolAnalysis
>>> /Users/marioafares/Documents/workspace/BactEvolGen/BactEvolGen.pl:1421
>>> STACK toplevel
>>> /Users/marioafares/Documents/workspace/BactEvolGen/BactEvolGen.pl:939
>>> -------------------------------------
>>> 
>>> what I guess means the output file is not being saved in the previous
>>> step.
>>> Anyone knows what's wrong.
>>> Tnak you very much in advance for your help.
>>> Cheers,
>>> Lorenzo
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>> 
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list