Closed:Python, DNA to Amino Acid Translation But Start at ATG Help
0
0
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)
Python Protein Tranlsation Programming • 197 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1322 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6