I'm trying to learn biopython and am learning from the tutorial book,
however when i try to do muscle or clustal alignment, i keep getting errors.
How can i get past this?
Is it because of the version of my windows is not compatible? i'm using 64bit.
What is the error you're getting? There's a good chance that you don't have MUSCLE or Clustal installed on your computer, or Biopython cannot find the executables.
You can tell Biopython where to find these executables, from the help:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\Bio\AlignIO\__init__.py", line 425, in read
first = next(iterator)
File "C:\Python27\lib\site-packages\Bio\AlignIO\__init__.py", line 372, in parse
for a in i:
File "C:\Python27\lib\site-packages\Bio\AlignIO\ClustalIO.py", line 109, in __next__
", ".join(known_headers)))
ValueError: >gi|6273291|gb|AF191665.1|AF191665 is not a known CLUSTAL header: CLUSTAL, PROBCONS, MUSCLE, MSAPROBS, Kalign
If I don't have the executables, do you know where can i get them? and which path should I install?
I added markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
I see! The code you're trying to run expects output from Clsutal, but you're trying to give it a FASTA file. You have to align the sequences in the FASTA file using Clustal first to get the format your code wants.
Hi, thank you for your response, I get this
If I don't have the executables, do you know where can i get them? and which path should I install?
I added markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Thank you so much for that, next time i post something similar I'll be sure to use it
I see! The code you're trying to run expects output from Clsutal, but you're trying to give it a FASTA file. You have to align the sequences in the FASTA file using Clustal first to get the format your code wants.
Ah I see, but how do I make alignments using the fasta file? Thank you so much~ when try to input I get this
I get this... sorry, I'm a real newbie at biopython
When you run the code like that, Windows assumes that your 'clustalw2' executable is in the current folder you're running it in.
You'll have to download clustalw2 (if you haven't done so already) and use the full path to make this error message go away:
replace the
C:\Downloads
path with wherever you downloaded clustalw2 toI see, then i need an executable file for clustal and muscle in the same folder as my fasta file? Do you know where I can get it? and Thank you again~
You can get them from google :)
Their path doesn't matter as long as you explicitly set both, they can be in different folders.
Got it~ Thanks so much~ :) I'll try getting first the executables and run it.