details: http://www.bx.psu.edu/hg/galaxy/rev/9f7a2a3be0e7 changeset: 3127:9f7a2a3be0e7 user: guru date: Mon Nov 30 11:59:54 2009 -0500 description: Fixed a bug in 'fetch closest features' tool. diffstat: tools/new_operations/flanking_features.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diffs (22 lines): diff -r 71b779fde315 -r 9f7a2a3be0e7 tools/new_operations/flanking_features.py --- a/tools/new_operations/flanking_features.py Mon Nov 30 11:56:58 2009 -0500 +++ b/tools/new_operations/flanking_features.py Mon Nov 30 11:59:54 2009 -0500 @@ -121,7 +121,7 @@ map(outfields.append, result_down[-1].other) #The last element of result_down will be the closest element to the given interval yield outfields - if either: + if either and (result_up or result_down): if result_up and result_down: if abs(start - int(result_up[res_ind].end)) <= abs(end - int(result_down[-1].start)): map(outfields.append, result_up[res_ind].other) @@ -131,8 +131,7 @@ map(outfields.append, result_up[res_ind].other) elif result_down: map(outfields.append, result_down[-1].other) #The last element of result_down will be the closest element to the given interval - yield outfields - + yield outfields def main(): options, args = doc_optparse.parse( __doc__ )