From 81d971f59fa3aee32c9d4d55da270d26256b651d Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 30 Oct 2023 13:58:34 +0100 Subject: [PATCH] Update exact matches --- src/pyobo/sources/depmap.py | 4 ++-- src/pyobo/sources/mgi.py | 4 +++- src/pyobo/sources/slm.py | 8 ++++---- src/pyobo/sources/zfin.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pyobo/sources/depmap.py b/src/pyobo/sources/depmap.py index 800b8955..b4a93a80 100644 --- a/src/pyobo/sources/depmap.py +++ b/src/pyobo/sources/depmap.py @@ -84,9 +84,9 @@ def iter_terms(version: str, force: bool = False) -> Iterable[Term]: continue term.append_synonym(alias) if pd.notna(cosmic_id): - term.append_xref(Reference(prefix="cosmic.cell", identifier=cosmic_id)) + term.append_exact_match(Reference(prefix="cosmic.cell", identifier=cosmic_id)) if pd.notna(cellosaurus_id): - term.append_xref(Reference(prefix="cellosaurus", identifier=cellosaurus_id)) + term.append_exact_match(Reference(prefix="cellosaurus", identifier=cellosaurus_id)) # WTSI stands for welcome trust sanger institute # Not sure where this prefix goes diff --git a/src/pyobo/sources/mgi.py b/src/pyobo/sources/mgi.py index afe75940..674f98b4 100644 --- a/src/pyobo/sources/mgi.py +++ b/src/pyobo/sources/mgi.py @@ -161,7 +161,9 @@ def get_terms(force: bool = False) -> Iterable[Term]: for synonym in mgi_to_synonyms[identifier]: term.append_synonym(Synonym(name=synonym)) if identifier in mgi_to_entrez_id: - term.append_xref(Reference(prefix="ncbigene", identifier=mgi_to_entrez_id[identifier])) + term.append_exact_match( + Reference(prefix="ncbigene", identifier=mgi_to_entrez_id[identifier]) + ) for ensembl_id in mgi_to_ensemble_accession_ids[identifier]: term.append_xref(Reference(prefix="ensembl", identifier=ensembl_id)) for ensembl_id in mgi_to_ensemble_transcript_ids[identifier]: diff --git a/src/pyobo/sources/slm.py b/src/pyobo/sources/slm.py index 729a53b9..6a03bd49 100644 --- a/src/pyobo/sources/slm.py +++ b/src/pyobo/sources/slm.py @@ -107,13 +107,13 @@ def iter_terms(version: str, force: bool = False): if pd.notna(inchikey): if inchikey.startswith("InChIKey="): inchikey = inchikey[len("InChIKey=") :] - term.append_xref(Reference(prefix="inchikey", identifier=inchikey)) + term.append_exact_match(Reference(prefix="inchikey", identifier=inchikey)) if pd.notna(chebi_id): - term.append_xref(("chebi", chebi_id)) + term.append_exact_match(("chebi", chebi_id)) if pd.notna(lipidmaps_id): - term.append_xref(("lipidmaps", lipidmaps_id)) + term.append_exact_match(("lipidmaps", lipidmaps_id)) if pd.notna(hmdb_id): - term.append_xref(("hmdb", hmdb_id)) + term.append_exact_match(("hmdb", hmdb_id)) if pd.notna(pmids): for pmid in pmids.split("|"): term.append_provenance(("pubmed", pmid)) diff --git a/src/pyobo/sources/zfin.py b/src/pyobo/sources/zfin.py index 790356b1..d8543603 100644 --- a/src/pyobo/sources/zfin.py +++ b/src/pyobo/sources/zfin.py @@ -135,7 +135,7 @@ def get_terms(force: bool = False, version: Optional[str] = None) -> Iterable[Te term.append_alt(alt_id) entrez_id = entrez_mappings.get(identifier) if entrez_id: - term.append_xref(Reference(prefix="ncbigene", identifier=entrez_id)) + term.append_exact_match(Reference(prefix="ncbigene", identifier=entrez_id)) for uniprot_id in uniprot_mappings.get(identifier, []): term.append_relationship(has_gene_product, Reference.auto("uniprot", uniprot_id)) for hgnc_id in human_orthologs.get(identifier, []):