This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Makeblast db with more sequences in fasta format

Hello! I am a beginner and I need help. I downloaded from NCBI two distinct fasta files, which contain both a nucleotide sequence, and are saved in a folder on my pc; these are the names of the files: NG_006672.1.fasta NG_006682.3.fasta using locally blast would like to create a database, with makeblastdb command, which contains my 2 fasta sequences. How can I do?

blast blastdb

3 answers

Just cat the fasta file and use the concatenated FASTA file as the input to the -in argument. Here's NCBI manual on how to use makeblastdb https://www.ncbi.nlm.nih.gov/books/NBK279688/

Either cat them as a preliminary step or use the syntax -in <(cat file1.fa file2.fa) to use a subshell in the makeblastdb

-in <(cat file1.fa file2.fa) seems not to work with Blast 2.7.1, it shows this error: BLAST options error: File /dev/fd/11 does not exist . I found out you can actually use a regular pipe like so: cat file1.fa file2.fa | makeblastdb -title myDBtitle -out myDBpath -parse_seqids

That could be a shell restriction. If your shell allows process substitution, <() should work fine.

Also, this is a 3 year old post, so there is quite the chance the blast executable could be a different version.

https://www.ncbi.nlm.nih.gov/books/NBK279688/

I found out you can just omit the -in parameter, add a -title parameter and pipe the sequences using: cat file1.fa file2.fa | makeblastdb -title myDBtitle -out myDBpath -parse_seqids

Log in to answer this question.