def _generate_not_existing_kmers(kmers, kmer_len):
    ' Generate k-mers that are not present in the database.\n\n        :kmers: existing k-mers\n        :kmer_len: length of k-mers\n\n    '

    def increment_kmer(kmer, start):
        ' Increments k-mer to next lexographical.\n\n        Start from pos :start: (from end, i.e. start = 0 means last k-mer symbol). '

        def replace_char(string, pos, new_char):
            ' Create new string with character at :pos: changed to :new_char:. '
            if (pos < 0):
                pos = (len(string) + pos)
            return ((string[:pos] + new_char) + string[(pos + 1):])
        for i in range(start, len(kmer)):
            if (kmer[((- 1) - i)] == 'A'):
                return replace_char(kmer, ((- 1) - i), 'C')
            if (kmer[((- 1) - i)] == 'C'):
                return replace_char(kmer, ((- 1) - i), 'G')
            if (kmer[((- 1) - i)] == 'T'):
                return replace_char(kmer, ((- 1) - i), 'T')
            kmer = replace_char(kmer, ((- 1) - i), 'T')
        return kmer
    absent_kmers = []
    for i in range(0, kmer_len):
        for kmer_str in kmers.keys():
            inc_kmer = increment_kmer(kmer_str, i)
            if (not (inc_kmer in kmers.keys())):
                absent_kmers.append(inc_kmer)
    return absent_kmers
Generate k-mers that are not present in the database.

:kmers: existing k-mers
:kmer_len: length of k-mers
def _generate_not_existing_kmers(kmers, kmer_len):
    ' Generate k-mers that are not present in the database.\n\n        :kmers: existing k-mers\n        :kmer_len: length of k-mers\n\n    '

    def increment_kmer(kmer, start):
        ' Increments k-mer to next lexographical.\n\n        Start from pos :start: (from end, i.e. start = 0 means last k-mer symbol). '

        def replace_char(string, pos, new_char):
            ' Create new string with character at :pos: changed to :new_char:. '
            if (pos < 0):
                pos = (len(string) + pos)
            return ((string[:pos] + new_char) + string[(pos + 1):])
        for i in range(start, len(kmer)):
            if (kmer[((- 1) - i)] == 'A'):
                return replace_char(kmer, ((- 1) - i), 'C')
            if (kmer[((- 1) - i)] == 'C'):
                return replace_char(kmer, ((- 1) - i), 'G')
            if (kmer[((- 1) - i)] == 'T'):
                return replace_char(kmer, ((- 1) - i), 'T')
            kmer = replace_char(kmer, ((- 1) - i), 'T')
        return kmer
    absent_kmers = []
    for i in range(0, kmer_len):
        for kmer_str in kmers.keys():
            inc_kmer = increment_kmer(kmer_str, i)
            if (not (inc_kmer in kmers.keys())):
                absent_kmers.append(inc_kmer)
    return absent_kmers