Question: Error while running clustaw2 in biopython from script
gravatar for Bioinformatics_NewComer
6.6 years ago by
Genomic Island
Bioinformatics_NewComer320 wrote:


import re, sys, argparse, os, subprocess
from subprocess import call
from Bio import SeqIO
from Bio import AlignIO
from Bio.Seq import Seq
from Bio.Align.Applications import ClustalwCommandline

for key in store_seq:
    fileN=str(key)+".txt" #"1.txt"
    outFile=str(key)+".fasta" #"1.fasta"
    with open(fileN,'w') as f:
        f.write(">"+str(store_seq[key])+"\n") # print seq id
        f.write(str(chemo_seq[store_seq[key]] )+"\n")#print sequence
        f.write( ">"+str(brig_orth[store_seq[key]])+ "\n")
        f.write ( str(chemo_seq[brig_orth[store_seq[key]]]) +"\n")
        f.write( ">"+str(reman_orth[store_seq[key]]) +"\n" )
        f.write( str(chemo_seq[reman_orth[store_seq[key]]]) + "\n")
         #run clustalw2 for the file..--->    cline=ClustalwCommandline("clustalw2",infile=fileN,type="PROTEIN",output="FASTA",outfile=outFile,quiet)

    #one key ends..

SyntaxError: non-keyword arg after keyword arg

However, when I run on python shell it runs smoothly. I have clustaw2 in my path. Instead of fileN and outFile, I give file name in  double quotes.

Editor using: emacs


biopython python2.7 clustalw2 • 1.9k views
ADD COMMENTlink modified 6.6 years ago by Andreas2.5k • written 6.6 years ago by Bioinformatics_NewComer320

This is a duplicate of - in future please don't ask the same question in multiple places withou at least cross referencing.

ADD REPLYlink written 6.6 years ago by Peter5.9k

I apologize for it. I will refrain this in future.

ADD REPLYlink written 6.6 years ago by Bioinformatics_NewComer320
gravatar for Andreas
6.6 years ago by
Andreas2.5k wrote:


have a look at the error message again. You are using a non-keyword arg (quiet) after keywords arguments (key=value) which is incorrect Python Syntax. Just remove 'quiet' from ClustalwCommandline and it should work.


ADD COMMENTlink written 6.6 years ago by Andreas2.5k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 991 users visited in the last hour