Skip to content

Commit

Permalink
fix!: add missing namespace prefixes to NAMESPACE_TO_SYSTEM_URI
Browse files Browse the repository at this point in the history
* Removes unused NamespacePefix.KZNF

close #393
  • Loading branch information
korikuzma committed Jan 16, 2025
1 parent 82b75d3 commit c635061
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gene/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def _create_concept_mapping(
err_msg = f"Namespace prefix not supported: {source}"
raise ValueError(err_msg) from e

system = NAMESPACE_TO_SYSTEM_URI.get(source, source)
system = NAMESPACE_TO_SYSTEM_URI["source"]

return ConceptMapping(
coding=Coding(code=code(concept_id), system=system), relation=relation
Expand Down
10 changes: 9 additions & 1 deletion src/gene/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class NamespacePrefix(Enum):
HORDE = "hordedb"
MEROPS = "merops"
IUPHAR = "iuphar"
KZNF = "knzfgc"
MAMIT = "mamittrnadb"
CD = "hcdmdb"
LNCRNADB = "lncrnadb"
Expand All @@ -193,10 +192,19 @@ class NamespacePrefix(Enum):
NamespacePrefix.PUBMED: "https://pubmed.ncbi.nlm.nih.gov",
NamespacePrefix.COSMIC: "https://cancer.sanger.ac.uk/cosmic/",
NamespacePrefix.OMIM: "https://www.omim.org",
NamespacePrefix.MIRBASE: "https://www.mirbase.org",
NamespacePrefix.HOMEODB: "http://homeodb.zoo.ox.ac.uk",
NamespacePrefix.SNORNABASE: "https://www-snorna.biotoul.fr",
NamespacePrefix.ORPHANET: "https://www.orpha.net",
NamespacePrefix.PSEUDOGENE: "http://pseudogene.org",
NamespacePrefix.HORDE: "https://genome.weizmann.ac.il/horde/",
NamespacePrefix.MEROPS: "https://www.ebi.ac.uk/merops/",
NamespacePrefix.IUPHAR: "https://www.guidetopharmacology.org",
NamespacePrefix.MAMIT: "http://mamit-trna.u-strasbg.fr",
NamespacePrefix.CD: "http://www.hcdm.org",
NamespacePrefix.IMGT: "https://www.imgt.org",
NamespacePrefix.IMGT_GENE_DB: "https://www.imgt.org",
NamespacePrefix.LNCRNADB: "https://rnacentral.org",
NamespacePrefix.RFAM: "https://rfam.org",
}

Expand Down
9 changes: 8 additions & 1 deletion tests/unit/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from ga4gh.vrs.models import SequenceLocation, SequenceReference

from gene.schemas import Gene
from gene.schemas import NAMESPACE_TO_SYSTEM_URI, Gene, NamespacePrefix


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -104,3 +104,10 @@ def test_gene(gene, sequence_location):
symbol="BRAF",
locations=sequence_location,
)


def test_namespace_to_system_uri():
"""Ensure that each NamespacePrefix is included in NAMESPACE_TO_SYSTEM_URI"""
for v in NamespacePrefix.__members__.values():
assert v in NAMESPACE_TO_SYSTEM_URI, v
assert NAMESPACE_TO_SYSTEM_URI[v].startswith("http"), v

0 comments on commit c635061

Please sign in to comment.