[BioRuby] Problem with PAML wrapper

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Wed Feb 25 10:24:27 UTC 2009


Hi,

On Wed, 25 Feb 2009 08:14:40 +0100
Marc Hoeppner <marc.hoeppner at molbio.su.se> wrote:

> Hi,
> 
> now with vers. 1.3 released (congrats on that by the way!), I was hoping 
> to speed up some analyses by using the Bio::PAML module. However, I 
> can't get it to work...
> 
> Ruby info:
> ruby 1.8.6 (2007-03-13 patchlevel 0) [universal-darwin8.0]
> on a Macbook, Os X 10.5
> 
> This is what I tried:
> 
> 1) read in a fasta file -> to Bio::Alignment::OriginalAlignment
> Verified the object (i.e. alingment.each_pair produces what it should, 
> so I am assuming that step was successful)
> 2) read in a newick-type tree (with branch lengths.. ) and converted it 
> to Bio::Tree - again, printed it out to see if it worked, and it did.
> 3) Verified that taxon labels in both files/objects were identical
> 4) Verified that all the sequences in the alignment were in fact of 
> equal lengths

First, please check that the command "baseml" exists in
the PATH directory. If not, you must specify the location
of "baseml" binary. For example,

  baseml = Bio::PAML::Baseml.new("/home/ngoto/paml/bin/baseml")

> I then tried to use the module as described:
> 
> baseml = Bio::PAML::Baseml.new
> report = baseml.query(alignment,tree)
> 
> -> nothing happens, i.e. program just exists normally, report.to_yaml 
> shows an empty object.

Unfortunately, Bio::PAML::Baseml::Report is still under
construction, and it always returns an empty object now.
Because PAML results are too complex to parse, I could not
write parsing routine yet. In the future, above should work.

Currently, you can only get raw results as strings by using
Bio::Baseml#report and  Bio::Baseml#supplemental_outputs.

   baseml = Bio::PAML::Baseml.new
   report = baseml.query(alignment,tree)
   # Now, the above "report" is only a dummy object.

   # Shows the output of baseml 
   p baseml.output
   # Shows supplemental outputs of baseml
   p baseml.supplemental_ouputs

> In order to confirm that PAML was working and that the data is, in 
> principle, compatible with Baseml, I created a normal ctl file and ran 
> the whole analysis from command line. And that worked.
> 
> So I then tried to do it the less sophisticated way:
> 
> baseml = Bio::PAML::Baseml.new
> baseml.run(my_local_ctl_file)
> 
> Again, nothing happened (should print out the results to the screen, as 
> I understand it).

Bio::Baseml#run returns the contents normally printed out
to the screen as a string. If you want screen output,
just print the string.

  baseml = Bio::PAML::Baseml.new
  str = baseml.run("baseml.ctl")
  print str

Note that the results of baseml are written to the file which
is described in the specified control file.

> Any suggestions on what I am doing wrong here? I suspect a problem with 
> the creation of the temporary folder/files, but frankly don't know 
> enough about the details to follow up on that. Also, I would guess that 
> such issues were addressed when developing the module (?).
> 
> Cheers,
> 
> Marc

The PAML documentation says that PAML programs do not work with
filenames containing spaces. In addition, it might not work with
filenames containing non-ASCII characters. So, If the temporary
file location contain spaces or non-ASCII characters, baseml
could not work correctly.

Cheers,

Naohisa Goto 
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org



More information about the BioRuby mailing list