Biopython PAML CodeML Error [Errno 2]
2
1
Entering edit mode
8.1 years ago
QVH ▴ 10

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?

Biopython PAML CodeML • 3.7k views
ADD COMMENT
3
Entering edit mode
8.1 years ago
Eric T. ★ 2.8k

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 COMMENT
0
Entering edit mode
8.1 years ago
QVH ▴ 10

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 COMMENT

Login before adding your answer.

Traffic: 1508 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6