[Biopython] Passing sequence to local BLAST

Peter Cock p.j.a.cock at googlemail.com
Fri Jul 22 11:18:08 UTC 2011


On Fri, Jul 22, 2011 at 11:58 AM, Sheila the angel
<from.d.putto at gmail.com> wrote:
> Oh I am sorry for the line
> seq_record = SeqIO.read(open("alpha.fasta"), "fasta")  #or a sequence object
> This was meant to show that I have a sequence record object.

I understood.

> In my actual problem I have open 2 different genbank files which contains
> many sequence record. I want to run EMBOSS to each sequence.

The EMBOSS tools can read GenBank files too. Try something like this
using their Uniform Sequence Address (USA) convention,

http://emboss.sourceforge.net/docs/#Usa
http://emboss.sourceforge.net/docs/themes/UniformSequenceAddress.html

water_cline = WaterCommandline(asequence="genbank::ls_orchid.gbk",
bsequence="genbank::other_file.gbk", gapopen=10, gapextend=0.5,
outfile="water.txt", auto=True)

Alternative some (all?) of the EMBOSS tools provide an explicit
separate argument for the input file format. In this case it wasn't
very obvious as it wasn't listed in the "water --help" text, you could
use -sformat1 and -sformat2 but it looks like our needle/water
wrappers don't include them. So go with the USA approach.

Peter




More information about the Biopython mailing list