[Biopython] Hit sequence download

Peter biopython at maubp.freeserve.co.uk
Mon Feb 22 11:21:46 UTC 2010


On Sat, Feb 20, 2010 at 5:06 PM, Hermella Woldemdihin <hermifi at yahoo.com> wrote:
> I blasted remotely and get a blast result file in XML format. How can I write
> a script to download the good hit sequences  listed in my blast result file and
> display the sequences?
>
> Thanks


The BLAST hits will probably all have NCBI GI numbers or accession numbers,
so you could use the NCBI Entrez Utilities to download them (e.g. as FASTA or
GenBank files).

I would use Bio.Blast.NCBIXML to parse the Blast XML output (see the
Biopython Tutorial) and select identifiers, and then use Bio.Entrez.efetch
to download the desired records (again, see the Tutorial).

Peter




More information about the Biopython mailing list