I am attempting to build my own custom database for Kraken2. I have two questions:

  1. If I have the MCPyV genome in a file called MCPyV.fasta, how do I build a database with just this?
  2. How do I build the MinusB database? (https://benlangmead.github.io/aws-indexes/k2)

For number one, I attempted to build this by using:

kraken2-build --add-to-library MCPyV.fasta --db my_db

But was returned an error stating that there was no taxonomy information found. How do I make this MCPyV.fasta file amenable to Kraken2 while building the database?

For number 2, I again attempted to build the MinusB database using:

kraken2-build --build --threads 4 --db MinusB

and was returned an error regarding missing /taxonomy directory.

Does anyone know how to build these databases properly?

  • $\begingroup$ Hi @interestingQuestion61 the answer is helpful (I use Kraken too), please consider upvoting/accepting. $\endgroup$
    – M__
    Commented Sep 15, 2023 at 16:07

1 Answer 1


I am not sure if I understand your first question correctly.

Kraken is meant to be for the taxonomic classification of metagenomic sequencing data. Therefore, if you only have one target genome of interest there is no need to use Kraken. You can just use any sequence aligner and check the mapping rates.

However, if you are trying to add a custom genome to an existing database then you need a taxonomy id for the sequence names in the genome and add it to your DB using the --add-to-library command. If this is what you are asking this tutorial would help you https://bioinformaticsworkbook.org/dataAnalysis/Metagenomics/Kraken.html#gsc.tab=0

Regarding your second question, I truly believe those ref indexes are ready to go. You can download the tar file, extract it in a folder called MinusB and release the Kraken using, e.g., kraken2 --db MinusB yourreads.fq

Hope this helps


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.