[Biopython] Passing sequence to local BLAST

Sheila the angel from.d.putto at gmail.com
Thu Jul 21 09:14:06 UTC 2011


yes replacing '-' by 'stdin' works :)

seq_record = SeqIO.read(open("alpha.fasta"), "fasta")  #or a sequence object
water_cline = WaterCommandline(asequence="stdin", bsequence="beta.fasta",
gapopen=10, gapextend=0.5, outfile="water.txt")
stdout, stderr =water_cline(stdin=seq_record.format("fasta"))

but I tried to replace bsequence also by 'stdin' and it shows error
#----------------------------------------------------------------------------------------------------------------------
seq_record = SeqIO.read(open("alpha.fasta"), "fasta")  #or a sequence object
seq_record2 = SeqIO.read(open("beta.fasta"), "fasta")
water_cline = WaterCommandline(asequence="stdin", bsequence="stdin",
gapopen=10, gapextend=0.5, outfile="water.txt", auto=True)
stdout, stderr =water_cline(stdin=seq_record.format("fasta"),
stdin=seq_record2.format("fasta"))
#  File "<stdin>", line 1 # <the error msg.
#SyntaxError: keyword argument repeated
#----------------------------------------------------------------------------------------------------------------------





On Wed, Jul 20, 2011 at 7:27 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Wednesday, July 20, 2011, Sheila the angel <from.d.putto at gmail.com>
> wrote:
> > This method do not  work with Bio.Emboss.Applications!!!I am trying to do
> the same with 'Bio.Emboss.Applications' as
> > seq_record = SeqIO.read(open("alpha.fasta"), "fasta")  #or a sequence
> object
> > water_cline = WaterCommandline(asequence="-", bsequence="beta.fasta",
> gapopen=10, gapextend=0.5, outfile="water.txt")
> > stdout, stderr =water_cline(stdin=seq_record.format("fasta"))
> > but it is displaying error.How can I specify file handle or sequence only
> in  Emboss Applications???
> >
>
> What is the error message?
>
> I think you need asequence="stdin" not "-" (although the later is a
> widely used convention in command line tools). See:
>
> http://emboss.sourceforge.net/docs/themes/UniformSequenceAddress.html#stdin
>
> Also try including auto=True in the command line, this tells EMBOSS
> not to try and ask for user input (by default it will try and prompt
> the user for any missing arguments, with the auto setting it uses it's
> defaults).
>
> Peter
>



More information about the Biopython mailing list