Mercurial > repos > nedias > orf_tools
comparison ORFFinder.py @ 8:e5616d5101c0 draft default tip
Bug fix - Null strand give index out of bound error
author | nedias |
---|---|
date | Wed, 19 Oct 2016 14:24:31 -0400 |
parents | d42adca5ecc2 |
children |
comparison
equal
deleted
inserted
replaced
7:0eda2c588bcd | 8:e5616d5101c0 |
---|---|
107 # TODO: Temporary use, need replace by formal method | 107 # TODO: Temporary use, need replace by formal method |
108 def get_longest_pair(pairs, rev_pairs): | 108 def get_longest_pair(pairs, rev_pairs): |
109 | 109 |
110 # The longest pair of each strand is store in the last position of the pair list, | 110 # The longest pair of each strand is store in the last position of the pair list, |
111 # so just pull it out directly | 111 # so just pull it out directly |
112 pos_longest = pairs[-1][1] - pairs[-1][0] | 112 if len(pairs) > 1: |
113 rev_longest = rev_pairs[-1][1] - rev_pairs[-1][0] | 113 pos_longest = pairs[-1][1] - pairs[-1][0] |
114 else: | |
115 pos_longest = 0 | |
116 if len(rev_pairs) > 1: | |
117 rev_longest = rev_pairs[-1][1] - rev_pairs[-1][0] | |
118 else: | |
119 rev_longest = 0 | |
114 return max(pos_longest, rev_longest) | 120 return max(pos_longest, rev_longest) |
115 | 121 |
116 | 122 |
117 | 123 |
118 | 124 |