def getPep (site, pos_in_pep, ref_seq):
    """
    get the pep seq arount the given site from the reference sequence  
    
    Parameters
    ----------
    site : int
        pos in protein seq
    pos_in_pep : int
        position in the peptide (defines the number of aa will get around the site)
    ref_seq : str
        reference sequence
        
    Returns
    -------
    pep_seq: str
        pep seq arount the given site
    """
    # get the start of the pep seq in the provided seq (ref_seq)
    start = site - pos_in_pep 
    # get the end of the pep seq in the provided seq (ref_seq)
    end = site + (pos_in_pep - 1)

    # if the seq is shorter than 15 aa
    if start < 0 and end > len(ref_seq):
        replace = abs(start) # number of '_' append to the beginning of the pep seq
        pep_seq = "_" * replace + ref_seq[0:end]
        replace = end - len(ref_seq) # number of '_' append to the end of the pep seq
        pep_seq = pep_seq + "_" * replace
    # if the site is at the very beginning of the protein seq (within the first 7 aa)
    elif start < 0:
        replace = abs(start) # number of '_' append to the beginning of the pep seq
        pep_seq = "_" * replace + ref_seq[0:end]
    # if the site is at the very end of the protein seq (within the last 7 aa)
    elif end > len(ref_seq):
        replace = end - len(ref_seq) # number of '_' append to the end of the pep seq
        pep_seq = ref_seq[start:len(ref_seq)]+"_"*replace
    # if the site is in the middle of the protein seq
    else:
        pep_seq = ref_seq[start:end]

    return pep_seq