For any k and n (positive integer values ), there are A=k C n possible k-mers having a mismatch of n to a kmer T. I am not sure how to generate those A number of kmers? I am thinking to store all possible length K kmers in a suffix tree and use it to find all k-mers having n mismatches to a query kmer A. or Just simply store all possible Kmers in an array and do an exhaustive comparisons. Are there better ways, using C/C++ language for 6 <= k <= 12?
Thanks.
Enumerating all the combinations is a very classical problem in computer science. You can find the solution to this generalized problem with google. You can do that with suffix tree, but it is probably much easier to solve the generalized problem.