# HG changeset patch # User nedias # Date 1476901471 14400 # Node ID e5616d5101c0680a3fcb38e822fe9585ec9d6d7e # Parent 0eda2c588bcd15a76a0d10ac08007cf2c4d77f05 Bug fix - Null strand give index out of bound error diff -r 0eda2c588bcd -r e5616d5101c0 ORFFinder.py --- a/ORFFinder.py Wed Oct 12 18:13:02 2016 -0400 +++ b/ORFFinder.py Wed Oct 19 14:24:31 2016 -0400 @@ -109,8 +109,14 @@ # The longest pair of each strand is store in the last position of the pair list, # so just pull it out directly - pos_longest = pairs[-1][1] - pairs[-1][0] - rev_longest = rev_pairs[-1][1] - rev_pairs[-1][0] + if len(pairs) > 1: + pos_longest = pairs[-1][1] - pairs[-1][0] + else: + pos_longest = 0 + if len(rev_pairs) > 1: + rev_longest = rev_pairs[-1][1] - rev_pairs[-1][0] + else: + rev_longest = 0 return max(pos_longest, rev_longest)