def get_front_back_kmer_overlap(k, motif_len, mod_index):
    """Get the largest number of bases overlap at front and back of motif

    eg: k=3 , motif_len = 2, mod_index = 1
        motif = GE

        X G E X
        _ _ _       max front_overlap = 1
          _ _ _     max back_overlap = 1

    :param k: length of kmer
    :param motif_len: length of motif
    :param mod_index: index position of modification
    :return: largest overlap in the front and back of a generated kmer
    """
    assert k >= 1, "k cannot be less than 1. k: {}".format(k)
    front_overlap = k - mod_index - 1
    back_overlap = k - (motif_len - mod_index)
    return front_overlap, back_overlap