shenwei356 / kmcp

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

Create an index without create the database #18

Closed davidmaimoun closed 1 year ago

davidmaimoun commented 1 year 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 1 year 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 1 year ago

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

shenwei356 commented 1 year 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 1 year ago

Thank you very much