Question: Biopython PAML CodeML Error [Errno 2]
1
gravatar for QVH
3.1 years ago by
QVH10
Upenn
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 codeml.py 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)
>>> 
>>> cml.run()

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/codeml.py", line 186, in run
    Paml.run(self, ctl_file, verbose, command)
  File "/usr/local/lib/python3.5/site-packages/Bio/Phylo/PAML/_paml.py", line 145, in run
    stdout=subprocess.PIPE)
  File "/usr/local/lib/python3.5/subprocess.py", line 560, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/lib/python3.5/subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.5/subprocess.py", 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 • 1.4k views
ADD COMMENTlink modified 3.1 years ago • written 3.1 years ago by QVH10
3
gravatar for Eric T.
3.1 years ago by
Eric T.2.4k
San Francisco, CA
Eric T.2.4k wrote:

Does it work if you specify the full, absolute path to the codeml binary within Biopython? E.g.:

cml.run(command="/home/PAML/codeml")
ADD COMMENTlink written 3.1 years ago by Eric T.2.4k
0
gravatar for QVH
3.1 years ago by
QVH10
Upenn
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 3.1 years ago by QVH10
Please log in to add an answer.

Help
Access

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