[Biopython-dev] [Bug 2480] Local BLAST fails: Spaces in Windows file-path values

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed May 21 02:45:58 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2480





------- Comment #16 from drpatnaik at yahoo.com  2008-05-20 22:45 EST -------
Similar to what I mentioned in comment #10 this BLAST command-line code works:

(1)   "C:/Documents and Settings/patnaik/My Documents/blast/bin/blastall.exe"
-p blastn -d "\"C:\Documents and Settings\patnaik\My
Documents\blast\bin\mine\"" -i "C:\Documents and Settings\patnaik\My
Documents\blast\bin\hairpin" -m 7

Now I've been trying to see the system call popen3 makes in line 1662 of
NCBIStandalone.py by putting this line of code before the os.popen3("
".join([blastcmd] + params):

   print " ".join([blastcmd] + params)

(as reported in comment #15, I do have to first disable the os.path.exists)

Using these values in my test script:
   my_blast_db =r'"\"C:\Documents and Settings\patnaik\My
Documents\blast\bin\mine\""'
   my_blast_file =r'"C:\Documents and Settings\patnaik\My
Documents\blast\bin\hairpin"'
   my_blast_exe =r'"C:/Documents and Settings/patnaik/My
Documents/blast/bin/blastall.exe"'

I get a print command result that is identical to the working BLAST
command-line code (1).

   "C:/Documents and Settings/patnaik/My Documents/blast/bin/blastall.exe" -p
blastn -d "C:\Documents and Settings\patnaik\My Documents\blast\bin\mine\" -i
"C:\Documents and Settings\patnaik\My Documents\blast\bin\hairpin" -m 7

But BLAST doesn't get called and the error reported is:

   'C:/Documents' is not recognized as ...

Finally I tried replacing the code inside the os.popen3 of NCBIStandalone.py
with the string (1):

   w, r, e = os.popen3(r'"C:/Documents and Settings/patnaik/My
Documents/blast/bin/blastall.exe" -p blastn -d "C:\Documents and
Settings\patnaik\My Documents\blast\bin\mine\" -i "C:\Documents and
Settings\patnaik\My Documents\blast\bin\hairpin" -m 7')

And I get the same error:

   'C:/Documents' is not recognized as ...

With a non-Biopython-dependent script, I get the same error (irrespective of
the quote combinations I tried):

   import os
   w, r, e = os.popen3(r'"C:/Documents and Settings/patnaik/My
Documents/blast/bin/blastall.exe" -p blastn -d "C:\Documents and
Settings\patnaik\My Documents\blast\bin\mine\" -i "C:\Documents and
Settings\patnaik\My Documents\blast\bin\hairpin" -m 7')
   print e.read()

-------------------------------------------------------------------

FINAL THOUGHTS

I think I've to give up on this.

There seem to be two incurable issues, unlikely Biopython-specific:
os.path.exists (see comment #15) and os.popen3


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list