DerrickWood / kraken

Kraken taxonomic sequence classification system
http://ccb.jhu.edu/software/kraken/
GNU General Public License v3.0
214 stars 103 forks source link

Failed to shrink the database... #116

Open jeffreycapy opened 6 years ago

jeffreycapy commented 6 years ago

Hi all, I built a database but failed to shrink it into a mini one. The error messages are:

Use of uninitialized value $shrink_block_offset in exec at kraken-master/scripts/kraken-build line 278.
db_shrink: offset count cannot be negative

The database seems to be all right since the messages from the building process contain no warnings or errors:

Kraken build set to minimize disk writes.
Creating k-mer set (step 1 of 6)...
Found jellyfish v1.1.11
Hash size not specified, using '42143697583'
K-mer set created. [9h56m25.432s]
Skipping step 2, no database reduction requested.
Sorting k-mer set (step 3 of 6)...
K-mer set sorted. [3h39m41.612s]
Creating GI number to seqID map (step 4 of 6)...
GI number to seqID map created. [9m33.546s]
Creating seqID to taxID map (step 5 of 6)...
27325 sequences mapped to taxa. [0.254s]
Setting LCAs in database (step 6 of 6)...
Finished processing 27325 sequences
Database LCAs set. [19h44m16.052s]
Database construction complete. [Total: 33h29m57.036s]

I am wondering where the problem is. Does anyone have any suggestion on how to solve it?

jenniferlu717 commented 6 years ago

What was your command line?

jeffreycapy commented 6 years ago

Hi @jenniferlu717 , I used the following command: kraken-master/scripts/kraken-build --shrink 20000 --db kraken_full_1803 --new-db kraken_1803_mini_20000

ajaybabu27 commented 6 years ago

I have the same issue. Any resolution on this yet ?

devindrown commented 6 years ago

You need to specify the shrink-block-offset

  --shrink-block-offset NUM  When shrinking, select the k-mer that is NUM
                             positions from the end of a block of k-mers
                             (default: 1)

Adding that option to the command line should allow you to shrink your DB