I have been trying to run a basic codeML wraper, that I got from the Biopython cookbook, but it doesn't seem to be working. I have been getting the error "FileNotFoundError: [WinError 2]".
This is what the piece of code looks like:
def codeML(outfile): cml = codeml.Codeml() cml.alignment = "C:\\Users\\User\\Documents\\project\\codonal.fasta" cml.tree = "C:\\Users\\User\\Documents\\project\\newtree.nwk" cml.out_file = outfile cml.working_dir = "C:\\Users\\User\\Documents\\project" cml.set_options(seqtype=1, verbose=0, noisy=0, RateAncestor=0, model=0, NSsites=[0, 1, 2], CodonFreq=2, cleandata=1, fix_alpha=1, kappa=4.54006) results = cml.run() ns_sites = results.get("NSsites") m0 = ns_sites.get(0) m0_params = m0.get("parameters") print(m0_params.get("omega"))
And this is what the error looks like:
Traceback (most recent call last): File "C:\Python34\elgrando.py", line 155, in <module> codeML("rezultati.out") File "C:\Python34\elgrando.py", line 143, in codeML results = cml.run() File "C:\Python34\lib\site-packages\Bio\Phylo\PAML\codeml.py", line 186, in run Paml.run(self, ctl_file, verbose, command) File "C:\Python34\lib\site-packages\Bio\Phylo\PAML\_paml.py", line 143, in run stdout=subprocess.PIPE) File "C:\Python34\lib\subprocess.py", line 537, in call with Popen(*popenargs, **kwargs) as p: File "C:\Python34\lib\subprocess.py", line 858, in __init__ restore_signals, start_new_session) File "C:\Python34\lib\subprocess.py", line 1111, in _execute_child startupinfo) FileNotFoundError: [WinError 2]
Python usually gives this error when there is a problem with pathing, but I have checked it twice now and it works if I independently run CodeML. Could it be that python doesn't recognise Paml on my computer or it doesn't have access to it?