Browse Source

made it recognize first stop codon

main
Ravi Shah 5 years ago
parent
commit
32e4019b48
  1. 26
      converter.py

26
converter.py

@ -33,19 +33,19 @@ def find_start(mrna):
quit() quit()
def find_stop(mrna): def find_stop(mrna):
if "UAA" in mrna:
print("UAA STOP codon found")
stop_index = mrna.index("UAA")
elif "UAG" in mrna:
print("UAG STOP codon found")
stop_index = mrna.index("UAG")
elif "UGA" in mrna:
print("UGA STOP codon found")
stop_index = mrna.index("UGA")
else:
print("No STOP codon found. Exiting...")
quit()
return stop_index
for i in mrna:
if "UAA" in i:
print("UAA STOP codon found")
stop_index = mrna.index("UAA")
elif "UAG" in i:
print("UAG STOP codon found")
stop_index = mrna.index("UAG")
elif "UGA" in i:
print("UGA STOP codon found")
stop_index = mrna.index("UGA")
else:
continue
return stop_index
def break_into_codons(mrna): def break_into_codons(mrna):
n = 3 n = 3

Loading…
Cancel
Save