Entering edit mode
5.1 years ago
josephine.yates
•
0
Hello to all,
I am trying to produce alignments from fasta files with the ClustalwCommandline as explained in the Biopython tutorial. However, even though I do not get an error message, no alignment is produced from my code and I do not understand why.
If someone could help me with this issue, it would be of great help.
Here is my current code:
def score_align(reffile):
clustalw_exe = r"C:\Users\josep\Anaconda3\Lib\site-packages\Bio\Align\Applications\_Clustalw.py"
assert os.path.isfile(clustalw_exe), "Clustal W executable missing"
cline=ClustalwCommandline(clustalw_exe, infile=reffile+".fasta", type="PROTEIN", output="FASTA", outfile=reffile+"_aligned.fasta", quiet=True)
cline()
score_align("balibase/RV11.unaligned/BBS11001")
I have tried using the python subprocess to run to get an error message this way:
def score_align(reffile):
clustalw_exe = r"C:\Users\josep\Anaconda3\Lib\site-packages\Bio\Align\Applications\_Clustalw.py"
assert os.path.isfile(clustalw_exe), "Clustal W executable missing"
child = subprocess.call(str(clustalw_exe)+" -align -infile="+reffile_name+".fasta -seqnos ON -type protein", shell=True)
print(child)
score_align("balibase/RV11.unaligned/BBS11001")
this returned 0 (from what I gathered it means the execution went well and I should have a .aln file.
Thank you for your help.
Please use the formatting bar (especially the
code
option) to present your post better. I've done it for you this time.Thank you!
I'm sorry, it's my first post I didn't know it wouldn't format it. Thank you for doing it this time !
No worries.
Based on the slashes looks like you are using Windows? If so you are not pointing to the actual clustalw executable/program. It should be something like
clustalw.exe
.I am having the same problem... did you solve it ?