sourmash-bio / sourmash

Quickly search, compare, and analyze genomic and metagenomic data sets.
http://sourmash.readthedocs.io/en/latest/
Other
466 stars 79 forks source link

save signature generated using sourmash python API #131

Closed phiweger closed 7 years ago

phiweger commented 7 years ago

Dear all,

Once a minhash signature is created using

import sourmash_lib as sm

e = sm.Estimators(n=50, ksize=15)
for seq in sample
    e.add_sequence(seq)

how can it be exported to JSON (or even better, how can I dump a couple of signatures)? I am currently exporting it as csv, and reloading that with sourmash import_csv but this is a) cumbersome and b) does not allow to carry the --with-cardinality or --scaled information.

Thanks a lot!

ctb commented 7 years ago

See:

utils/compute-dna-mh-another-way.py

does that help?

best, --titus

phiweger commented 7 years ago

Yeah, that's what I have been looking for, I'll give it a try, thanks a lot!