Hello everyone. I'm working on Python script that find ORF for a sequence. It runs well only for short sequencece. But when I tries to input much longer sequence it gives me wrong answer(according to this server: https://www.ncbi.nlm.nih.gov/orffinder/) Can anybody find what's the problem with my code?
def codons(seq): stops = ["TTA","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