Makeblastdb Help
1
2
Entering edit mode
13.5 years ago
Me_In_Oz ▴ 30

Hi,

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:

#!/bin/perl -w

makeblastdb 
-in "Mydb.fasta" 
-parse_seqids 
-dbtype prot;

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!

Thanks :-)

blast makeblastdb • 13k views
ADD COMMENT
1
Entering edit mode

Not clear why you need Perl for this task. Can't you just run makeblastdb from the command line?

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

Which operating system?

ADD REPLY
1
Entering edit mode
13.5 years ago

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
ADD COMMENT
1
Entering edit mode

It's ok, I've got it working now. needed to put ./makeblastdb -in Mydb.fasta -parse_seqids -dbtype prot all about the ./ !!!

ADD REPLY
1
Entering edit mode

It is also possible the current directory is not in PATH. Try './makeblastdb ...' (without quotes) if it is not.

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

edited answer..

ADD REPLY
0
Entering edit mode

Hmm, they don't have the executable flag. Not sure why the downlaoded package didn't do that

ADD REPLY
0
Entering edit mode

Then you may close the question as no longer relevant.

ADD REPLY

Login before adding your answer.

Traffic: 2508 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6