I have the following code where frag is a list of strings which are cut up (in order) DNA sequence data:
for a in frag:
length_fragment = len(a)
if (a[0:5] == 'CCAGC') and (a[-1:] == 'C'):
total_length.append(length_fragment)
I however want to jump ahead to the next a in the for loop and see if the first letters of that next fragment are CCAGC... is this possible in python to do.
So I want to change the a[-1:] =='C' to be a statment which is the next a[0:5] =='ACGAG'. Key word there is the next a in the for loop. So I want to skip ahead briefly in the for loop.