def grabOverlappingKmer(seq, sitei, pos=0, k=9):
    """Grab the kmer from seq for which it is in the pos position at sitei
    Return the gapped and non-gapped kmer

    This is a generalization of grabKmer for pos = 0

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

    Parameters
    ----------
    seq : str
        Sequence from which peptide will be grabbed.
    sitei : int
        Key position of the kmer (zero-based indexing)
    pos : int
        The position of the key sitei in the kmer.
    k : int
        Length of the peptide to return.

    Returns
    -------
    gapped : str
        A k-length peptide that overlaps sitei
    nonGapped : str
        A k-length peptide that overlaps sitei
        If seq[sitei] 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)"""
    aaRight = k - pos
    aaLeft = pos
    if seq[sitei] == '-':
        return None, None

    if (sitei + aaRight) <= len(seq) and (sitei - aaLeft) >= 0:
        if pos<k:
            rh = seq[sitei:]
            fullRH = rh[:aaRight]
            if '-' in fullRH:
                ngRH = rh.replace('-', '')
                if len(ngRH) >= aaRight:
                    ngRH = ngRH[:aaRight]
                else:
                    ngRH = None
            else:
                ngRH = fullRH
        else:
            fullRH = ''
            ngRH = ''

        if pos>0:
            lh = seq[:sitei]
            fullLH = lh[-aaLeft:]
            if '-' in fullLH:
                ngLH = lh.replace('-', '')
                if len(ngLH) >= aaLeft:
                    ngLH = ngLH[-aaLeft:]
                else:
                    ngLH = None
            else:
                ngLH = fullLH
        else:
            fullLH = ''
            ngLH = ''
        full = fullLH + fullRH
        #print aaLeft,fullLH,",", aaRight,fullRH

        if ngLH is None or ngRH is None:
            ng = None
        else:
            ng = ngLH + ngRH
        return full, ng
    else:
        return None, None