Question: Biopython PAML CodeML Error [Errno 2]
gravatar for QVH
4.7 years ago by
QVH10 wrote:

I try integrate PAML in a pipeline in order to analyse a large number of alignment. But, I met a problem with the python interface to codeML. Indeed, while codeML works perfectly when I call it directly, I don't manage to make it work through the interface. I launch Python3.5 in the directory "/home/PAML" and all files are in this directory.

I launch codeML through those command lines in python3.5:

>>> from Bio.Phylo.PAML import codeml
>>> cml = codeml.Codeml()
>>> cml.alignment = "lysozymeLarge.nuc"
>>> cml.tree = "lysozymeLarge.trees"
>>> cml.out_file = "results.out"
>>> cml.working_dir = "/home/PAML"
>>> cml.set_options(noisy = 4)
>>> cml.set_options(verbose = 5)
>>> cml.set_options(NSsites=[0])
>>> cml.set_options(runmode = 0)
>>> cml.set_options(seqtype = 1)
>>> cml.set_options(omega = 0.4)
>>> cml.set_options(kappa = 2)
>>> cml.set_options(fix_alpha = 1)
>>> cml.set_options(CodonFreq = 2)

And, I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/Bio/Phylo/PAML/", line 186, in run, ctl_file, verbose, command)
  File "/usr/local/lib/python3.5/site-packages/Bio/Phylo/PAML/", line 145, in run
  File "/usr/local/lib/python3.5/", line 560, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/lib/python3.5/", line 950, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.5/", line 1544, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'codeml'

It doesn't find codeML, but it is integrated in the PATH, and works perfectly anywhere through the terminal with only this command:

codeml codeml.ctl

Do you have any idea what could be the problem?

paml codeml biopython • 2.7k views
ADD COMMENTlink modified 4.7 years ago • written 4.7 years ago by QVH10
gravatar for Eric T.
4.7 years ago by
Eric T.2.6k
San Francisco, CA
Eric T.2.6k wrote:

Does it work if you specify the full, absolute path to the codeml binary within Biopython? E.g.:"/home/PAML/codeml")
ADD COMMENTlink written 4.7 years ago by Eric T.2.6k
gravatar for QVH
4.7 years ago by
QVH10 wrote:

It works! I wasn't expecting that kind of problem since CodeML is in the PATH, I will check everything next time.

Thank you very much.

ADD COMMENTlink written 4.7 years ago by QVH10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1287 users visited in the last hour