[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
Mon Sep 29 01:31:26 UTC 2008


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





------- Comment #22 from drpatnaik at yahoo.com  2008-09-28 21:31 EST -------
Following up on comment #21 re: subprocess module:

I am able to get the local BLAST through Biopython to work if I replace the 'w,
r, e = os.popen3(" ".join([blastcmd] + params))' line for 'blastall' in the
'NCBIStandalone.py' file to:

    import subprocess
    my_process = subprocess.Popen(" ".join([blastcmd] + params))
    w, r, e = (my_process.stdin, my_process.stdout, my_process.stderr)

The BLAST results just scroll by on the command-line console application's
screen, so this is very crude. I am new to Python, and I hardly know anything
about 'subprocess'. Perhaps this will information will help the developers.

                  ***

--- C:/Documents and Settings/patnaik/My
Documents/Python252/Lib/Site-packages/Bio/Blast/NCBIStandalone.py ---

[CVS version 1.77 with the chnages outlined above]

--- File C:/Documents and Settings/patnaik/Desktop/test.py ---

  # My test file
  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'

  from Bio.Blast import NCBIStandalone
  result_handle, error_handle = NCBIStandalone.blastall(my_blast_exe, "blastn",
my_blast_db, my_blast_file)

  error_results = error_handle.read()
  save_file = open(r"C:/Documents and Settings/patnaik/My
Documents/blast/bin/my_blast_error", "w")
  save_file.write(error_results)
  save_file.close()

  result_results = result_handle.read()
  save_file = open(r"C:/Documents and Settings/patnaik/My
Documents/blast/bin/my_blast_result", "w")
  save_file.write(result_results)
  save_file.close()

--- Run command ---

  python "C:\Documents and Settings\patnaik\Desktop\test.py"


-- 
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