shenwei356 / kmcp

Accurate metagenomic profiling && Fast large-scale sequence/genome searching
https://bioinf.shenwei.me/kmcp
MIT License
182 stars 13 forks source link

Create an index without create the database #18

Closed davidmaimoun closed 2 years ago

davidmaimoun commented 2 years ago

Hello Dr Shen,

Can I create an index without create the database ? Because the folder takes memory.

If my interest is to indexing sequences and run some query, is it possible to use the tool without the db creation step ?

Best,

shenwei356 commented 2 years ago

I'm afraid you have to create the database with kmcp compute and kmcp index before searching.

And Most tools need an index step for search.

davidmaimoun commented 2 years ago

So can I erase the database folder once the index created?

shenwei356 commented 2 years ago
# compute k-mers
kmcp compute -k 21 --split-number 10 --split-overlap 100 \
    --in-dir genomes/ --out-dir genomes-k21-n10

# index k-mers
kmcp index --false-positive-rate 0.1 --num-hash 1 \
    --in-dir genomes-k21-n10/ --out-dir genomes.kmcp

# ------------------------------------------------------------------------------
# Here, the genomes-k21-n10/ folder created by 'kmcp compute' could be deleted.
# ------------------------------------------------------------------------------
# delete temporary files
# rm -rf genomes-k21-n10/

# search    
kmcp search --db-dir genomes.kmcp/ test.fa.gz --out-file search.kmcp@db1.kmcp.tsv.gz
davidmaimoun commented 2 years ago

Thank you very much