Entering edit mode
7.0 years ago
annette440
•
0
I have downloaded blast to my own computer and I am trying first to make a blast database using makeblastdb program and then make a blastn using the blastn program. My code looks like this:
makedb_path = '\"C:/Program Files/NCBI/blastn-2.6.0+/bin/makeblastdb.exe"\ '
blastn_path = '\"C:/Program Files/NCBI/blastn-2.6.0+/bin/blastn.exe"\ '
make_db_command = makedb_path + "-in " + Ref_file + " -dbtype nucl -parse_seqids -out
Blastdatabase.out"
process = subprocess.call(make_db_command, shell=True)
blastn_command = blastn_path + "-query" + Que_file + " -task megablast -db Blastdatabase.out -outfmt 6 -out blastn.out -min_cov=0.6 -perc_identity=0.9"
process2 = subprocess.call(blastn_command, shell=True)
After running the processes I do not have Blastdatabase.out or blastn.out, indicating it did not run the programs. What am I doing wrong?
This is on windows? Have you tried those command out on the command line first before putting them in this code? I assume
Ref_file
is coming from some other part of the code we do not see above.Yes, Ref_file and Que_file are both files coming from other parts of the code, which you cannot see. When I run the make_db_command on the command line I get an error that looks like: bash: \"C:/Program Files/NCBI/blastn-2.6.0+/bin/makeblastdb.exe\" does not exist.
Does that file exist or not? Is the error coming from those extra
\
you have at the beginning and end? Are you working inbash shell in Win 10
or just python interpreter in Windows?The file exists in the same folder as I run my script and I removed the extra \ or else I could not get it to work. I work in Spyder with python3 in Windows 10.
I recommend to use the WSL in Win10, it works wonderfully.
I tried to use it a bit, but I cannot acces the folder called "program files" and it thinks "program" is a file. How to solve this in WSL?
use something like "program\ files"
What happens when you run it like this, and don't break up the code:
Then I do not get the output files "Blastdatabase.out" and "blastn.out" in my folder, but it does not give me an error.
Ceck in the folder where
Ref_file
isThat is the folder I am checking. Ref_file, Que_file and the program that I run are all in the same folder, and this is the folder I expect the out files to be.
Try without -
out
flag, makeblastdb will automake the necessary files with extensions to your ref_file.I still get the error: /bin/sh: 1: C:/Program Files/NCBI/blastn-2.6.0+/bin/makeblastdb.exe-in: not found.
Must be copy/paste error. There needs to be a space before
-in
You also need to account for the space in
Program Files
name by escaping it as noted by @JC above.I tried to print the two processes I am running and it looks like both of them did run, because both of them are assigned with a 1. But the output files are not there. What could be the problem? I did account for the space in Program files.
Post the commands exactly as you're running them. Alternatively, try your commands in the windows shell, and see if they work, you might be able to see the error, if there is one. Also, try '\' or '\' instead of '/' in your path.