Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
charlottecc opened this issue Jul 9, 2019 · 5 comments
Open

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

charlottecc opened this issue Jul 9, 2019 · 5 comments

Comments

@charlottecc
Copy link

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
Copy link
Owner

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

@calizilla
Copy link

calizilla commented Feb 26, 2021

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
Copy link

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
Copy link

stjacqrm commented Mar 7, 2023

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants