From 7f6fc91509390d22809620d14d7ef82799126af0 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Sat, 10 Jun 2023 22:40:40 -0400 Subject: [PATCH] Exclude name from an export --- export/famplex_groundings.tsv | 1 - export/reach_bioresources.py | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/export/famplex_groundings.tsv b/export/famplex_groundings.tsv index 28dd09f41..8a10186a1 100644 --- a/export/famplex_groundings.tsv +++ b/export/famplex_groundings.tsv @@ -2447,7 +2447,6 @@ TIF-IB TIF_IB fplx Family TIM22 complex TIM22_complex fplx Family TIM22-complex TIM22_complex fplx Family TK TK fplx Family -TLE TLE fplx Family TLE family TLE fplx Family TLR TLR fplx Family TLR2 O60603 uniprot Gene_or_gene_product diff --git a/export/reach_bioresources.py b/export/reach_bioresources.py index a907af361..0210a2861 100644 --- a/export/reach_bioresources.py +++ b/export/reach_bioresources.py @@ -9,6 +9,8 @@ entities_file = os.path.join(path_this, os.pardir, 'entities.csv') +name_exclude = {'TLE'} + def get_groundings(): groundings = [] text_appearances = [] @@ -70,10 +72,13 @@ def get_groundings(): entity_txt = entity.replace('_', '-') # If it isn't already a synonym if entity_txt not in cnt: + if entity in name_exclude: + continue # If the name of the family happens to be a gene symbol # we don't add it - if not hgnc_client.get_hgnc_id(entity): - groundings.append((entity_txt, entity, 'fplx', 'Family')) + if hgnc_client.get_hgnc_id(entity): + continue + groundings.append((entity_txt, entity, 'fplx', 'Family')) ambiguous_txts = {t for t, c in cnt.items() if c >= 2} groundings = [g for g in sorted(groundings) if g[0] not in ambiguous_txts]