ChaissonLab / danbing-tk

Toolkit for VNTR genotyping and repeat-pan genome graph construction
BSD 3-Clause "New" or "Revised" License
21 stars 3 forks source link

kmer decode #27

Closed BrendaLee1 closed 1 year ago

BrendaLee1 commented 1 year ago

Hi Thanks for this excellent tool, I tried to use this software to build graph for our VNTRs. After I got pan.tr.kmers and pan.graph.kmers, I find that kmers were coded into numbers. How can I decode kmers into DNA seqence, do you have any suggestion?

Best Wishes, Lee

joyeuxnoel8 commented 1 year ago

Hi Lee,

Thanks for bringing up the question. Each nucleotide is encoded with 2 bits, A/C/G/T=0/1/2/3. Each additional nucleotide will shift the encoded value by two bits, e.g. T = 3, TA = 3*2^2 + 0 = 12, TAA = 3*2^4 + 0*2^2 + 0 = 48.

Hope this helps. -Tony