This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error Running codeml

Hi, I am trying to use codeml from PAML for phylogenetic analysis, but getting the same error again and again. The code used is given below:

>>> from Bio.Phylo.PAML import codeml
>>> cml = codeml.Codeml()
>>> cml.tree = "species.tree"
>>> cml.alignment = "align.phylip"
>>> cml.read_ctl_file("codeml.ctl")     
>>> cml.run()

And the error is

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ammar/anaconda3/lib/python3.5/site-packages/Bio/Phylo/PAML/codeml.py", line 181, in run
raise IOError("The specified tree file does not exist.")
OSError: The specified tree file does not exist.

Although the current working directory contains all the required files as shown below:

>>> import os
>>> files = os.listdir(os.curdir)
>>> files
['align.phylip', 'codeml.ctl', 'species.tree']

How this problem can be resolved? The files used are here: alignment file, tree file and control file.

Thanks

phylogeny paml alignment

1 answer

Hi ammarsabir15,

In the second line of the control file, it is written as treefile = tree.txt. So, you may need to rename your tree file to "tree.txt" instead of "species.tree", and do the same thing for the alignment file ("seqfile.txt").

Log in to answer this question.