Hi ,
I tried the following code to run clustalw . But I am getting error.
>>> from Bio.Align.Applications import ClustalwCommandline
>>> cline = ClustalwCommandline("clustalw2", infile="seqs.fasta")
>>> print cline
clustalw2 -infile=seqs.fasta
>>> from Bio import AlignIO
>>> align = AlignIO.read("seqs.aln", "clustal")
IOError: [Errno 2] No such file or directory: 'seqs.aln'
I am using winndows OS, Biopython 1.57.
I modified the previous code as shown below
>>> from Bio.Align.Applications import ClustalwCommandline
>>> clustalw_exe = r"C:\Program Files\clustalw2\clustalw2.exe"
>>> clustalw_cline = ClustalwCommandline(clustalw_exe, infile="C:\Users\ss \Desktop\seqs.fasta")
>>> assert os.path.isfile(clustalw_exe), "Clustal W executable missing"
>>> stdout, stderr = clustalw_cline()
>>> from Bio import AlignIO
>>> align = AlignIO.read("seqs.aln", "clustal")
But I got the error like this
File "<pyshell#53>", line 1, in <module>
align = AlignIO.read("seqs.aln", "clustal")
File "C:\Python27\lib\site-packages\Bio\AlignIO\__init__.py", line 427, in read
first = iterator.next()
File "C:\Python27\lib\site-packages\Bio\AlignIO\__init__.py", line 333, in parse
handle = open(handle, "rU")
IOError: [Errno 2] No such file or directory: 'seqs.aln'
How to solve this error? Any suggestions please.
Your code does not actually run clustalw; you've only printed out the commandline. Try "cline()" and check out the Tutorial for more details: http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc75
No such file or directory: 'seqs.aln'!!!
Strange I'm getting the same problem too. I'm also on windows and it does not make the alignment file or the dnd file.
you have spaces in your path here: s"C:Usersss Desktopseqs.fasta", does your folder also have those spaces? And is seqs.aln in the same folder clustalw2.exe?
When I gave the path for seqs.aln file I got the output.