From ed381c7333d66f69a58dae52592d177e541ede3f Mon Sep 17 00:00:00 2001 From: Guruprasad Anada Date: Mon, 30 Nov 2009 11:59:54 -0500 Subject: [PATCH] Fixed a bug in 'fetch closest features' tool. --- tools/new_operations/flanking_features.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/new_operations/flanking_features.py b/tools/new_operations/flanking_features.py index 2ef0d77f59f..450b2598ed8 100644 --- a/tools/new_operations/flanking_features.py +++ b/tools/new_operations/flanking_features.py @@ -121,7 +121,7 @@ def proximal_region_finder(readers, region, comments=True): 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 @@ def proximal_region_finder(readers, region, comments=True): 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__ )