def grabKmer(seq, starti, k=9):
    """Grab the kmer from seq starting at position starti with length k
    Return the gapped and non-gapped kmer

    If seq[starti] is a gap then the non-gapped kmer is None.
    If there are not enough non-gap AA to return after starti then it returns None

    Parameters
    ----------
    seq : str
        Sequence from which peptide will be grabbed.
    starti : int
        Starting position of the kmer (zero-based indexing)
    k : int
        Length of the peptide to return.

    Returns
    -------
    gapped : str
        A k-length peptide starting at starti from seq.
    nonGapped : str
        A k-length peptide starting at starti from seq.
        If seq[starti] is a gap then returns None.
        If not then all gaps are removed before taking the k-length peptide
            (if there aren't k AAs then return is None)"""
    if not isinstance(starti, int):
        starti = int(starti)

    if (starti+k-1) <= (len(seq)-1) and starti >= 0:
        tmp = seq[starti:]
        full = tmp[:k]
        if full[0] == '-':
            return None, None
        elif '-' in full:
            ng = tmp.replace('-', '')
            if len(ng) >= k:
                ng = ng[:k]
            else:
                ng = None
        else:
            ng = full
        return full, ng
    else:
        return None, None