Before revision: The pseudocode to achieve this is as follows: procedure k-mers(string seq, integer k) is L ← arr ← new array of L − k + 1 empty strings // iterate over the number of k-mers in seq, // storing the nth k-mer in the output array for n ← 0 to L − k + 1 exclusive do arr[n] ← subsequence of seq from letter n inclusive to letter n + k exclusive return arr In Bioinformatics Pipelines Because the number of k-mers grows exponentially for values of k, counting k-mers for large values of k (usually >10) is a computationally difficult task.
After revision: The pseudocode to achieve this is as follows: procedure k-mers(string seq, integer k) is L ← arr ← new array of L − k + 1 empty strings // iterate over the number of k-mers in seq, // storing the nth k-mer in the output array for n ← 0 to L − k + 1 exclusive do arr[n] ← subsequence of seq from letter n inclusive to letter n + k exclusive return arr In bioinformatics pipelines Because the number of k-mers grows exponentially for values of k, counting k-mers for large values of k (usually >10) is a computationally difficult task.