I've turned on the Windows Subsystem for Linux feature on my Windows 10 desktop, installed Ubuntu and installed blast locally with this command
sudo apt-get install ncbi-blast+
.
I'm trying to run a shell script that includes doing a local blastp search. The shell script line that's causing errors is below:
blastp -query protein_query.txt -db /mnt/c/Users/username/Desktop/Bioinformatics/refdata -out protein.blast.txt -evalue 1e-15 -outfmt "6 qseqid sseqid evalue stitle" -max_target_seqs 1000
I ran this shell script on bash by typing /mnt/c/Users/username/Desktop/Bioinformatics/PROTEIN.sh
, which gave me the following error:
command line argument error: Argument "query". File is not accessible: 'protein_query.txt'
I'm suspecting this has something to do with the location that blast was installed but I can't figure out where it got installed with the Ubuntu configuration... Can anyone provide any advice/suggestions?
This is the classic
$PATH
problem. You are probably running the script from a directory which does not contain theprotein_query.txt
file. You can either modify the script to provide-query /full_path_to/protein_query.txt
or amend your$PATH
variable to include the directory that contains the query fileexport PATH=$PATH:/dir_with_query_file
.I've added
export PATH=$PATH:/dir_with_query_file
(the latter way you suggested) and it still gave me the same error, so I modified the script like the former way you suggested and it gave me a different error:BLAST Database error: No alias or index file found for protein database [/mnt/c/Users/username/Desktop/Bioinformatics/refdata] in search path [/home/ubuntuid::]
. I guess this means there's also an issue with$PATH
for the protein database too, right? Is there a way for me to move the location where blast was initially installed to somewhere on my local desktop (like/mnt/c/Users/...
) instead of Ubuntu location (like/home/ubuntuid::
)?I don't have a WSL install handy to check what the file paths look like but it sounds like your problem is related to those. Once you figure out the right paths the error should go away. Check the result of
echo $PATH
and amend as necessary.Hi,
If you want to see where
blastp
was installed (assuming that you've a system installation rather than local), you can just type the following command on your shell:Though your problem does not seem related with the installation of
blastp
, but it seems related with the path of the query file, as mention by @genomax.Do you know the path to the
protein_query_file.txt
? If yes, just provide the full path to the query file. If you don't know the full path just get into the folder where is the query file through the command-line withcd <path-to-query-file>
(you can putcd
and then drag the file until the shell - this will copy the full path to the shell) and then type the commandpwd
. This will give the full path until that file. Then just copy this full path plus the file name of the query as the 1st argument.This will should solve your problem.
António