From 2f2cb853e2f58d21b2b306adbec68e04e80a93f8 Mon Sep 17 00:00:00 2001 From: Kirill Tsukanov Date: Fri, 11 Oct 2019 12:26:32 +0100 Subject: [PATCH] OxO fix: do not try to query with an empty ID list --- eva_cttv_pipeline/trait_mapping/main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eva_cttv_pipeline/trait_mapping/main.py b/eva_cttv_pipeline/trait_mapping/main.py index 1fc020c4..65a9cdb4 100644 --- a/eva_cttv_pipeline/trait_mapping/main.py +++ b/eva_cttv_pipeline/trait_mapping/main.py @@ -45,8 +45,8 @@ def process_trait(trait: Trait, filters: dict, zooma_host: str, oxo_target_list: "distance" parameter. :return: The original trait after querying Zooma and possibly OxO, with any results found. """ - logger.debug('Processing trait {}'.format(trait.name)) + trait.zooma_result_list = get_zooma_results(trait.name, filters, zooma_host) trait.process_zooma_results() if (trait.is_finished @@ -55,15 +55,14 @@ def process_trait(trait: Trait, filters: dict, zooma_host: str, oxo_target_list: for mapping in trait.zooma_result_list for entry in mapping.mapping_list])): return trait + uris_for_oxo_set = get_uris_for_oxo(trait.zooma_result_list) - if len(uris_for_oxo_set) == 0: - return trait oxo_input_id_list = uris_to_oxo_format(uris_for_oxo_set) + if len(oxo_input_id_list) == 0: + return trait trait.oxo_result_list = get_oxo_results(oxo_input_id_list, oxo_target_list, oxo_distance) - if not trait.oxo_result_list: - logger.warning('No OxO mapping for trait {}'.format(trait.name)) - + logger.debug('No OxO mapping for trait {}'.format(trait.name)) trait.process_oxo_mappings() return trait