Entering edit mode
3.7 years ago
dk0319
▴
70
Second week working in Python, I am struggling to figure out how to ammend block so that translation starts at "atg" . Any help or suggestions would greatly be appreciated. Thank you
Got the translation program running but I need it to only start at "atg" reading through first 3 elements of seq. Code should be generic for any seq
out=[]
for i in range(4,len(dna),3):
triplet=dna[i:i+3] #groups elements of DNA into triplets
try:
amino=xlate[triplet] #generates string of AA for each triplet using dictionary
if amino=='0':break
except:
break
out.append(amino)
out="".join(out)
print(out)