def _reverse_orf_read(s):
"""
Reads given string back until encounters stop-codon. Also write last encounter of start-codon
:param s: string
:return t, t_part_orf, fl, is_stop:
t - pos of end reading
t_part_orf - pos of current ORF's start
fl - True if start codon was read
is_stop - True if the reading was interrupted by stop codon
"""
t = len(s)
t_part_orf = t
fl = False
while True: # do..while
if s[t - 3:t] in ORFsInGraph.starts:
t_part_orf = t - 3
fl = True
t -= 3
if (s[t - 3:t] in ORFsInGraph.stops) or t < 3:
break
return t, t_part_orf, fl, s[t - 3:t] in ORFsInGraph.stops
评论列表
文章目录