I’m trying to write a code that will actively cut apart a peptide sequence based on an enzyme used. I’m able to get the peptide to become cut based on the first value of the list, but not on the second. I don’t fully understand what’s I’m doing wrong, as when I print the Trypsin[Amino] before the while loop, it shows the ‘K’ and the ‘R’, but then the peptide is only cut with the ‘K’. What I’m anticipating are a total of five cuts, ‘PWWK’ ‘IHEGSR’ ‘R’ ‘NQDK’ and then a remainder of HY. I’m still very new to Python, so any help would be appreciated.
What is the result supposed to be? It might be that TrypRep = 0 should be inside the loop, but without knowing what the result should be, I can’t tell.
I appreciate the help and moving the TrypRep into the loop actually solved one issue. I’m expecting five cuts: ‘PWWK’ ‘IHEGSR’ ‘R’ ‘NQDK’ and then a remainder of HY. I’m able to get five cuts in total, [‘PWWK’, ‘IHEGSRRDNQDK’, ‘PWWKIHEGSR’, ‘R’] DNQDKHY when running the updated code, but they’re not cut in a way I’m needing. One solution I can think of is to separate them, one with ‘K’ and one with ‘R’, then compare them and delete the repetitive portions.