[BioPython] Blastall problem w/ restrict_gi

Peter biopython at maubp.freeserve.co.uk
Wed Jun 13 15:56:48 EDT 2007


Roger Barrette wrote:
> Hi Peter,
> 
> Thank you for the response.  In regards to your questions, I am using Python
> 2.5 w/ biopython v1.43, on a Windows platform (XP).  The specific problem I
> am having occurs when I attempt to run the blastall command from Python
> through the NCBIStandalone module.  If I run the blastall without the
> "restrict_gi" option, it gives me  alignment results in the .xml
> file.  However, when I include the "restrict_gi" option, I get an empty .xml
> result file.  As per your suggestion however, the error file does list an
> error.  The output of this .err file is:
> 
> [NULL_Caption] ERROR: gi|90968860|gb|DQ443515.1|: Unable to open file
> .\/BLAST/DATAout/A10241.txt

That is interesting - it tells us that the argument is at least getting 
passed to the blast program (and explains why there is no XML output).

That path is an odd mixture of Unix and Windows style paths, which I 
wouldn't expect to work.

Could you try using \BLAST\DATAout\A10241.txt or 
C:\BLAST\DATAout\A10241.txt instead (both from within Python and from 
the command line).

Remember that slashes are escape characters in python so use either 
r"C:\BLAST\DATAout\A10241.txt" or "C:\\BLAST\\DATAout\\A10241.txt".

> This is odd because when I run the command from the c:\ prompt:
>  c:\>/BLAST/blastall.exe -p tblastx -d /BLAST/DATAout/VirDBX -i
> /BLAST/sequencesXX.fasta -m 7 -l .\/BLAST/DATAout/A10241.txt
> 
> ;it works fine, and I get the alignment results, and no error.

I'm a little surprised that does work to be honest.

I suspect this is something subtle to do with how command line programs 
break up the arguments (which is complicated by quotes and slashes - at 
least you have no spaces in the filenames!).

Note some of ways of getting python to make a system call pass the 
arguments as a long string (as if typed by the user at the command 
prompt) while others are already broken down into the individual terms.

> Because I do not get any results in the xml file when I get this error,
> running the blast from the python script,  there is nothing to parse,
> however, when I run the script without the "restrict_gi" option, from either
> the command prompt or my python script, I get results in the xml file, and
> they are able to be parsed.  Any suggestions as to how to fix this problem
> would be greatly appreciated.  Thanks

Fingers crossed using Windows style absolute paths fixes this for you...

Peter



More information about the BioPython mailing list