[BioPython] Problems with NCBIXML.py

Peter biopython at maubp.freeserve.co.uk
Fri Oct 26 09:52:34 UTC 2007


Bruno Santos wrote:
> Peter Said
>> I would suggest you install standalone blast, then give it the
>> multi-record FASTA file as input.  You should then get multiple blast
>> records back (in the same order).  This works fine with the XML output
>> (but currently does not work for plain text output on recent versions
>> of NCBI Blast).
>>
>> If you really want to make multiple blast submissions in parallel
>> online, first check the NCBI's website for any usage restrictions -
>> they don't want their servers to be abused.
>>
>> Peter
> 
> I have followed your advice and I decide to install standalone blast. As I
> want to make blast against the nt databases I have downloaded it pre
> compiled from the ncbi ftp server. And I have created I script to do this but
> for some reason I'm not getting any results, because the programs does not
> write anything to the XML file. 
> 
> Where is my script:
> from Bio import SeqIO
> from Bio.Blast import NCBIStandalone
> from Bio.Blast import NCBIXML
> import time
> import math

You are running on Windows, so the paths should have "\" rather than "/" 
in them.  However, in many cases this isn't essential - and indeed for 
some Unix programs ported to Windows using "/" is sometimes best!

> my_blast_db = (r'e:/nt.00')

I'm not sure if that is correct, but its difficult to tell without 
seeing your setup.

> my_blast_file =
> r'C:/FASTASeq/Results/well9/assembled_file_well9_V6_DIST.fna'
> my_blast_exe = r'C:/BLAST/bin/'

That is wrong, try something like:
my_blast_exe = r'C:\BLAST\bin\blastall.exe'

I would urge you to try running blastall "by hand" at the command line 
first for a few small examples, to get the hang of it.  Because any 
error messages get printed to the command line, it makes debugging 
simpler. This will also help with you how to prepare the arguments in 
Biopython.  Within python you would have to have checked what was 
written to the error_info output handle.

> As I have download the files from ncbi I have a lot of files in the database
> directory theres is any way of perform a search against all of them?

I'm not sure what exactly you are asking.  BLAST can make databases from 
FASTA files, so you might want to build a database from all your FASTA 
files... check the documentation for the BLAST formatdb program.

Peter




More information about the Biopython mailing list