2
$\begingroup$

How is n-gram different from k-mer? Both seem to be (n or k) length substrings of a larger string. Are these just terms common with different practitioners? viz. Computer Scientists and Bioinformaticians?

$\endgroup$
3
  • 2
    $\begingroup$ The wiki for "n-gram" states at the top: "For applications in computational genomics, see k-mer." So yes, I believe they're just in different domains. $\endgroup$ Feb 17 '16 at 19:35
  • $\begingroup$ Oh... Thanks.. I missed the fine print :-) $\endgroup$
    – Lord Loh.
    Feb 17 '16 at 19:58
  • 1
    $\begingroup$ And to add - "k-shingle" also means the same thing. :-O. NLP folks i guess. $\endgroup$
    – Lord Loh.
    Feb 17 '16 at 21:18
4
$\begingroup$

Yes, they mean the same thing. A n-gram is a sequence of n consecutive things (words, letters, whatever). A k-mer is a sequence of k consecutive things (DNA basepairs). The phrase k-mer is more common in computational genomics.

See https://en.wikipedia.org/wiki/N-gram and https://en.wikipedia.org/wiki/K-mer for definitions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.