Skip to content

Commit

Permalink
Exclude name from an export
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jun 11, 2023
1 parent 8c846ba commit 7f6fc91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion export/famplex_groundings.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions export/reach_bioresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
entities_file = os.path.join(path_this, os.pardir, 'entities.csv')


name_exclude = {'TLE'}

def get_groundings():
groundings = []
text_appearances = []
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 7f6fc91

Please sign in to comment.