No alignment produced ClustalW with python wrapper
0
0
Entering edit mode
5.1 years ago

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.

alignment clustalW • 1.5k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thank you!

ADD REPLY
0
Entering edit mode

I'm sorry, it's my first post I didn't know it wouldn't format it. Thank you for doing it this time !

ADD REPLY
0
Entering edit mode

No worries.

clustalw_exe = r"C:\Users\josep\Anaconda3\Lib\site-packages\Bio\Align\Applications\_Clustalw.py"

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.

ADD REPLY
0
Entering edit mode

I am having the same problem... did you solve it ?

ADD REPLY

Login before adding your answer.

Traffic: 2009 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6