Skip to content

Commit

Permalink
Update exact matches
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Oct 30, 2023
1 parent f34041d commit 81d971f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/pyobo/sources/depmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/pyobo/sources/mgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
8 changes: 4 additions & 4 deletions src/pyobo/sources/slm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/zfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, []):
Expand Down

0 comments on commit 81d971f

Please sign in to comment.