<p>Running <code>blastdbcmd -db foo -info</code> provides a little information but I haven't seen anything which will report exactly how a blastdb was created.</p>
<p>A <a href="https://ftp.ncbi.nlm.nih.gov/blast/documents/blastdb.html" rel="nofollow noreferrer">blastdb readme</a> suggests that only the <code>parse_seqids</code> option has been added to the standard parameters.</p>
<blockquote>
<p>For those from NCBI, the following makeblastdb commands are recommended:</p>
<ul>
<li>For nucleotide fasta file:   makeblastdb -in input_db -dbtype nucl -parse_seqids</li>
<li>For protein fasta file:      makeblastdb -in input_db -dbtype prot -parse_seqids</li>
</ul>
</blockquote>
<p>The <code>-parse_seqids</code> requires NCBI fasta headers in the correct format (spec can be found <a href="http://ncbi.github.io/cxx-toolkit/pages/ch_demo#ch_demo.id1_fetch.html_ref_fasta" rel="nofollow noreferrer">here</a>).</p>

CC BY-SA 3.0
2017-06-22T09:17:53.090Z
2017-06-22T19:56:20.457Z
2020-06-18T08:30:41.743Z
igelkott
<p>I don't know what specific properties you are considering. As far as I know, that's just a normal blast database, like any other. These are produced using the <code>formatdb</code> command which is part of the <code>ncbi-blast</code> software. You haven't specified what system you are using so I can't help you find and install it, but the command will be something like:</p>

<pre><code>formatdb -p F -i yourSeqs.fasta -n yourDBName
</code></pre>

<ul>
<li><code>formatdb</code> : the command</li>
<li><code>-p F</code> : protein: false. This is needed to make databases of nucleotide sequences. </li>
<li><code>-i yourSeqs.fasta</code> : your input file with all your sequences in fasta format. </li>
<li><code>-n yourDBName</code> : the name (choose whatever you like) for your database.</li>
</ul>

<p>You can then use <code>yourDBName</code> as a database to blast against. The above assumes yuou are </p>

CC BY-SA 3.0
2017-06-19T15:38:39.357Z
I would recommend using the newest ncbi-blast+ suite instead of the (now deprecated?) legacy-blast. In that cases `formatdb` would become `makeblastdb`, with slightly different arguments.
mgalardini
CC BY-SA 3.0
2017-06-19T15:43:14.100Z
@mgalardini that sounds very reasonable. I'm afraid I'm showing my age. This is the only one I've ever used but I last did so more than 10 years ago now. Please post an answer with this new tool you mention. I'm sure it's the Right Way© to go today.
terdon
CC BY-SA 3.0
2017-06-19T16:10:57.523Z
@terdon - whatever works I say ;).  Thanks for the help, I've updated the question to make it (hopefully) more clear.  I am specifically looking to add metadata to a blastdb and looking for a reference or similar for what metadata is added to the 16SMicrobial database.
amblina
CC BY-SA 3.0
2017-06-19T12:17:45.603Z
2017-06-19T12:17:45.603Z
terdon
<p>I am not sure whether you are looking for how to produce taxonomy file or rep_set file (qiime reference file types). But you can produce fasta file (rep_Set) like that:</p>

<pre><code>$blastdbcmd -db 16SMicrobial/16SMicrobial -outfmt '%f' -entry 'all' &gt; 16SMicrobial.fasta
</code></pre>

<p>Then you can create QIIME-compatible id_to_tax maps with this code:
<a href="https://github.com/mtruglio/QIIME_utilities/blob/master/id_to_tax_mapmaker.sh" rel="nofollow noreferrer">https://github.com/mtruglio/QIIME_utilities/blob/master/id_to_tax_mapmaker.sh</a></p>

<p>Hope this helps.</p>

CC BY-SA 4.0
2018-11-30T08:59:00.007Z
2018-11-30T08:59:00.007Z
merik
<p>I'm looking for the exact invocation used to generate the 16SMicrobial database that you can download from here:</p>

<p><a href="https://ftp.ncbi.nlm.nih.gov/blast/db/" rel="nofollow noreferrer">https://ftp.ncbi.nlm.nih.gov/blast/db/</a></p>

<p>I'm hoping to create the same type of blastdb with the same type of metadata with custom sequences.</p>

<p>Platform isn't an issue, but let's say on ubuntu 14.04 or 16.04.</p>

<p>I would like to replicate the creation of the database as closely as possible. 
 The most important feature is the taxonomic information as can be seen <a href="https://www.ncbi.nlm.nih.gov/books/NBK279688/" rel="nofollow noreferrer">here</a>:</p>

<blockquote>
  <p>The databases on the FTP site contain taxonomic information for each
  sequence, include the identifier indices for lookups, and can be up to
  four times smaller than the FASTA. The original FASTA can be generated
  from the BLAST database using blastdbcmd</p>
</blockquote>

<p>Creation of a blastdb using makeblastdb from a set of a fasta sequences is not an issue and can be achieved via:</p>

<pre><code>makeblastdb -in &lt;your_file.fasta&gt; -dbtype nucl -out &lt;database_name&gt;
</code></pre>

<p>My question is specifically about the invocation NCBI uses to add the metadata that is present in the NCBI's 16SMicrobial blast database as I am keen to make sure I have replicated the process as closely as possible.</p>

CC BY-SA 3.0
2017-06-19T12:14:14.327Z
What properties, specifically?
terdon
CC BY-SA 3.0
2017-06-19T15:34:15.217Z
Most crucially the taxonomic information, but I would like to replicate this creation of this database as closely as possible.
amblina
<blast>
What command/invocation is used to generate NCBI 16SMicrobial blastdb
# What command/invocation is used to generate NCBI 16SMicrobial blastdb

(Asked by: username_0 on 2017-06-19)

I'm looking for the exact invocation used to generate the 16SMicrobial database that you can download from here:
https://ftp.ncbi.nlm.nih.gov/blast/db/
I'm hoping to create the same type of blastdb with the same type of metadata with custom sequences.
Platform isn't an issue, but let's say on ubuntu 14.04 or 16.04.
I would like to replicate the creation of the database as closely as possible. 
 The most important feature is the taxonomic information as can be seen here:

The databases on the FTP site contain taxonomic information for each
  sequence, include the identifier indices for lookups, and can be up to
  four times smaller than the FASTA. The original FASTA can be generated
  from the BLAST database using blastdbcmd

Creation of a blastdb using makeblastdb from a set of a fasta sequences is not an issue and can be achieved via:
makeblastdb -in  -dbtype nucl -out 

My question is specifically about the invocation NCBI uses to add the metadata that is present in the NCBI's 16SMicrobial blast database as I am keen to make sure I have replicated the process as closely as possible.

**Tags:** blast
> **Comments:**
> **username_1**: What properties, specifically?  
> **username_0**: Most crucially the taxonomic information, but I would like to replicate this creation of this database as closely as possible.  

---

## 3 answers

### Answer by username_2 on 2017-06-22. Score: 1

Running `blastdbcmd -db foo -info` provides a little information but I haven't seen anything which will report exactly how a blastdb was created.

A [blastdb readme](https://ftp.ncbi.nlm.nih.gov/blast/documents/blastdb.html) suggests that only the `parse_seqids` option has been added to the standard parameters.

> For those from NCBI, the following makeblastdb commands are recommended:
>
> * For nucleotide fasta file: makeblastdb -in input\_db -dbtype nucl -parse\_seqids
> * For protein fasta file: makeblastdb -in input\_db -dbtype prot -parse\_seqids

The `-parse_seqids` requires NCBI fasta headers in the correct format (spec can be found [here](http://ncbi.github.io/cxx-toolkit/pages/ch_demo#ch_demo.id1_fetch.html_ref_fasta)).


---

### Answer by username_1 on 2017-06-19. Score: 0

I don't know what specific properties you are considering. As far as I know, that's just a normal blast database, like any other. These are produced using the formatdb command which is part of the ncbi-blast software. You haven't specified what system you are using so I can't help you find and install it, but the command will be something like:
formatdb -p F -i yourSeqs.fasta -n yourDBName


formatdb : the command
-p F : protein: false. This is needed to make databases of nucleotide sequences. 
-i yourSeqs.fasta : your input file with all your sequences in fasta format. 
-n yourDBName : the name (choose whatever you like) for your database.

You can then use yourDBName as a database to blast against. The above assumes yuou are

> **Comments:**
> **username_3**: I would recommend using the newest ncbi-blast+ suite instead of the (now deprecated?) legacy-blast. In that cases `formatdb` would become `makeblastdb`, with slightly different arguments.  
> **username_1**: @mgalardini that sounds very reasonable. I'm afraid I'm showing my age. This is the only one I've ever used but I last did so more than 10 years ago now. Please post an answer with this new tool you mention. I'm sure it's the Right Way© to go today.  
> **username_0**: @terdon - whatever works I say ;).  Thanks for the help, I've updated the question to make it (hopefully) more clear.  I am specifically looking to add metadata to a blastdb and looking for a reference or similar for what metadata is added to the 16SMicrobial database.  

---

### Answer by username_4 on 2018-11-30. Score: 0

I am not sure whether you are looking for how to produce taxonomy file or rep_set file (qiime reference file types). But you can produce fasta file (rep_Set) like that:
$blastdbcmd -db 16SMicrobial/16SMicrobial -outfmt '%f' -entry 'all' > 16SMicrobial.fasta

Then you can create QIIME-compatible id_to_tax maps with this code:
https://github.com/mtruglio/QIIME_utilities/blob/master/id_to_tax_mapmaker.sh
Hope this helps.


---

