This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What command generate blast database from file in all.fna folder?

I downloaded genome of Bacteria, which file name is all.fna.tar.gz from ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/.

Next I extract file I got folder all.fna. I want to generate all bacteria file(.fna) in folder all.fna with makeblastdb.

What command for generate blast database all(.fna) file in folder all.fna. OR I have to generate each file in folder.

Thank you very much

database blast genome

Use the search/read the manual

Can you please clarify the question? You have many different FASTA files and want to have one single BlastDB with all sequences included? Is that correct?

Yes, I want to have on single BlastDB.

2 answers

Now I solve this problem by

  1. extract file all.fna.tar.gz
  2. concatenation all file xx.fna in each folder to single file fasta
  3. make blast database with

tar xvfz all.fna.tar.gz

#make_db.sh

#!/bin/bash

files=$(find . -name "*.fna")
create="cat $files > all.fna"
eval $create

makeblastdb -in all.fna -out Bacteria -dbtype nucl -title "Bacteria" -parse_seqids -max_file_sz='20GB'

That's a nice solution. Thanks for coming back and sharing it.

I also got multiple bacterial genome seq. files and want to make a single database by using them all, but sure why this code is used here:

eval $create

many thanks

It is still not clear whether you have one file or many, I assume one, then you will need to run the standard blast procedure. First create a blast database for your genome then use this blast database in your queries. Someting like this below, visit the blast pages for more details

makeblastdb -in all.fna.fa -dbtype 'nucl' -out all.fna.fa

This is example structure file after extract all.fna.tar.gz

./Acaryochloris_marina_MBIC11017_uid58167:
NC_009925.fna  NC_009927.fna  NC_009929.fna  NC_009931.fna  NC_009933.fna
NC_009926.fna  NC_009928.fna  NC_009930.fna  NC_009932.fna  NC_009934.fna

./Acetobacterium_woodii_DSM_1030_uid88073:
NC_016894.fna

./Acetobacter_pasteurianus_386B_uid214433:
NC_021976.fna  NC_021977.fna  NC_021978.fna  NC_021979.fna  NC_021991.fna  NC_021992.fna  NC_021993.fna

I want to generate all NC_xxx.fna file to a blast database.

Log in to answer this question.