I feel I'm being really dumb here, so please excuse me! I have a file of fasta sequences which I want to make into a blast databse for standalone blast.
I haev the fasta file saved in the bin folder of ncbi-blast-2.2.25+
I make the following perl code:
I get the following error message when I run the script:
Unquoted string "makeblastdb" may clash with future reserved word at make_blast.pl line 7.
String found where operator expected at make_blast.pl line 7, near "in "viral_db.fasta""
(Do you need to predeclare in?)
syntax error at make_blast.pl line 7, near "in "viral_db.fasta""
Execution of make_blast.pl aborted due to compilation errors.
I know I must be doing something fundamentally wrong with my scripting here, but I can't see what it is!
To call unix commands in perl use backticks, exec, or system:
`makeblastdb ...`
should do.
edit:
As a general rule, if you can't get a system command to work on a shell, it won't magically work when called from a programming language. As Neil already mentioned, there is probably no reason to use Perl for this task at all.
To check if a command is really in the directory you think it is, you can type the first couple of letters and press [?]tab[?] twice (autocompletion). Plus, it needs to have the executable flag set (but the package you downloaded should already have handled that)
Please add the result of the following commands to your question :
# go to the directory where makeblastdb is installed
pwd
ls -la | grep blast
ok, thank you. I tried that, and also directly on the command line but it says: makeblastdb: command not found
I don't understand as I am in the bin dir, and makeblastdb is in there!
Not clear why you need Perl for this task. Can't you just run makeblastdb from the command line?
I tried directly on the command line but it says: makeblastdb: command not found I am in the bin dir, and makeblastdb is in there!
Which operating system?