Question: I have the same question.like my prior question Indentation moved but the program still cannot execute def codons(seq): stops = [TAA,TGA,TAG] lst1 = [] #List

I have the same question.like my prior question Indentation moved but the program still cannot execute

def codons(seq):

stops = ["TAA","TGA","TAG"]

lst1 = [] #List for the stars codons

lst2 = [] #List for the stop codons

start = 0 #The start position of the sequence.

counter = 0 #Counter for 3 optional orfs. #initializes the lists for 3 optional orfs.

for i in range (3):

lst1.append([])

lst2.append

#Add to the lists the positions of the start and stop codons.

while (seq and counter < 3):

for i in range(start,len(seq),3):

codon = seq[i:i+3] #The codon is 3 nucleotides.

#print codon+ "\t"

if(codon == "ATG"): #If the codon is a start codon.

lst1[start].append(i+1) #The position of the start codon.

if(codon in stops): #if the codon is a stop codon.

lst2[start].append(i+1) #The position of the stop codon.

start += 1 #promotes the starting position.

counter += 1 #promotes the counter

print(lst1)

print ("------------------")

print (lst2) return (lst1, lst2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!