jenniferlu717 / Bracken

Bracken (Bayesian Reestimation of Abundance with KrakEN) is a highly accurate statistical method that computes the abundance of species in DNA sequences from a metagenomics sample.
http://ccb.jhu.edu/software/bracken/index.shtml
GNU General Public License v3.0
273 stars 50 forks source link

kraken2: database does not contain necessary file taxo.k2d #76

Open charlottecc opened 5 years ago

charlottecc commented 5 years ago

Hi,

I have tried run the command kraken2 --db=~/Metagenomics/kraken/krakenDB --threads 20 <( find -L ~/Metagenomics/kraken/krakenDB/library \( -name "*.fna" -o -name "*.fa" -o -name "*.fasta" \) -exec cat {} + ) > database.kraken

However I am getting the error message: kraken2: database ("~/Metagenomics/kraken/krakenDB") does not contain necessary file taxo.k2d find: `cat' terminated by signal 13

I get this error message despite the taxo.k2d being present. I have tried to rebuild the kraken2 database (custom database of bacteria, fungi, human, plasmid, viral) but I am still getting this error.

If anyone has any advice how to progress I'd be grateful!

Thanks in advance

jenniferlu717 commented 4 years ago

Have you tried the command from directly inside the database folder?

calizilla commented 3 years ago

Hi Jennifer,

I am experiencing this also. I created a custom db and have the same error as charlottecc. I followed the custom database creation steps carefully and there were no errors. total database size is 190 GB. It contains bacteria, archaea, viral, fungi, plasmid, univec_core, human and mouse.

The error: kraken2: database ("~/kraken2_custom") does not contain necessary file taxo.k2d

Below is the database listing and sizes:

-rw-r--r-- 54G hash.k2d drwxr-sr-x 4.0K library -rw-r--r-- 56 opts.k2d -rw-r--r-- 3.4M seqid2taxid.map -rwxr-xr-- 2.5M taxo.k2d drwxr-sr-x 4.0K taxonomy -rw-r--r-- 4.4K unmapped.txt

The command used:

kraken2 \ --db $database \ --threads $NCPUS \ --output $out \ --report $report \ --report-zero-counts \ --use-names \ --paired \ --minimum-base-quality 20 \ --gzip-compressed \ $reads_1 $reads_2

The exact same script was used successfully prior, just changing the $database variable. This was using the pre-built kraken2/bracken2 db from https://genome-idx.s3.amazonaws.com/kraken/k2_standard_20201202.tar.gz

I tried your suggestion of running from within the kraken2_custom db directory and the error remained the same. I also tried making the taxo.k2d file executable which also did not help.

Your assistance much appreciated.

Kind regards, Cali

sanderdebacker commented 2 years ago

Hi all,

Recently experienced the same error (no taxo.k2d file). However, every time this error was the result of specifying the wrong directory of the database with the "--db" argument. It may seem a banality, but they are often overlooked!

kraken2: database ("greengenes/") does not contain necessary file taxo.k2d --> the database I need is actually called "greengenes_db/", therefore the error.

stjacqrm commented 1 year ago

I had the same error. I used the full path to the db and still got the error.

I tried renaming my files from .fastq -> .fq and was able to get Kraken on the work! (it worked)

russellsmithies commented 1 year ago

Not sure if anyone has found a solution, but I discovered that I get this error if there are symlinks in the database path.
If I use the full path then it works OK.