ALPHABET_UNMOD = { "A": 1, "C": 2, "D": 3, "E": 4, "F": 5, "G": 6, "H": 7, "I": 8, "K": 9, "L": 10, "M": 11, "N": 12, "P": 13, "Q": 14, "R": 15, "S": 16, "T": 17, "V": 18, "W": 19, "Y": 20, } # trypsin cut after A or L (if not followed by P) def cut(seq, format): cuts = [] l = len(seq) if format == 'alphabetical': for i in range(l): if seq[i] == 'A' or seq[i] == 'L': if i < l - 1 and seq[i + 1] != 'P': cuts.append(i) if format == 'numerical': for i in range(l): if seq[i] == 1 or seq[i] == 10: if i < l - 1 and seq[i + 1] != 13: cuts.append(i) return cuts