From 6b059e8fe0fbe374e23f61d9d8753a8fee28a042 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Mon, 30 Dec 2024 08:16:16 -0500 Subject: [PATCH 1/4] add few more urls --- src/disease/schemas.py | 5 +++++ tests/unit/test_query.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/disease/schemas.py b/src/disease/schemas.py index 647dcf9..8ff8e40 100644 --- a/src/disease/schemas.py +++ b/src/disease/schemas.py @@ -96,9 +96,14 @@ class NamespacePrefix(Enum): NamespacePrefix.DOID: "http://purl.obolibrary.org/obo/doid.owl", NamespacePrefix.OMIM: "https://www.omim.org", NamespacePrefix.ONCOTREE: "https://oncotree.mskcc.org", + NamespacePrefix.COHD: "https://cohd.io", + NamespacePrefix.DECIPHER: "https://www.deciphergenomics.org", NamespacePrefix.EFO: "https://www.ebi.ac.uk/efo", + NamespacePrefix.GARD: "https://rarediseases.info.nih.gov", NamespacePrefix.HP: "http://purl.obolibrary.org/obo/hp.owl", NamespacePrefix.HPO: "http://purl.obolibrary.org/obo/hp.owl", + NamespacePrefix.ICD11: "https://icd.who.int/en", + NamespacePrefix.ICDO: "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology", NamespacePrefix.KEGG: "https://www.genome.jp/kegg/disease/", NamespacePrefix.MEDDRA: "https://www.meddra.org/", NamespacePrefix.MEDGEN: "https://www.ncbi.nlm.nih.gov/medgen/", diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index da6eaaf..122c1bb 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -52,7 +52,10 @@ def neuroblastoma(): "relation": "relatedMatch", }, { - "coding": {"code": "9500/3", "system": "icdo"}, + "coding": { + "code": "9500/3", + "system": "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology", + }, "relation": "relatedMatch", }, { @@ -63,7 +66,10 @@ def neuroblastoma(): "relation": "relatedMatch", }, { - "coding": {"code": "7185", "system": "gard"}, + "coding": { + "code": "7185", + "system": "https://rarediseases.info.nih.gov", + }, "relation": "relatedMatch", }, { From b72f3a34fb7686bd2e6cb8eb432570be91156b86 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Tue, 31 Dec 2024 07:36:24 -0500 Subject: [PATCH 2/4] trailing slash --- src/disease/schemas.py | 6 +++--- tests/unit/test_query.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/disease/schemas.py b/src/disease/schemas.py index 8ff8e40..5fb75ab 100644 --- a/src/disease/schemas.py +++ b/src/disease/schemas.py @@ -98,12 +98,12 @@ class NamespacePrefix(Enum): NamespacePrefix.ONCOTREE: "https://oncotree.mskcc.org", NamespacePrefix.COHD: "https://cohd.io", NamespacePrefix.DECIPHER: "https://www.deciphergenomics.org", - NamespacePrefix.EFO: "https://www.ebi.ac.uk/efo", + NamespacePrefix.EFO: "https://www.ebi.ac.uk/efo/", NamespacePrefix.GARD: "https://rarediseases.info.nih.gov", NamespacePrefix.HP: "http://purl.obolibrary.org/obo/hp.owl", NamespacePrefix.HPO: "http://purl.obolibrary.org/obo/hp.owl", - NamespacePrefix.ICD11: "https://icd.who.int/en", - NamespacePrefix.ICDO: "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology", + NamespacePrefix.ICD11: "https://icd.who.int/en/", + NamespacePrefix.ICDO: "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology/", NamespacePrefix.KEGG: "https://www.genome.jp/kegg/disease/", NamespacePrefix.MEDDRA: "https://www.meddra.org/", NamespacePrefix.MEDGEN: "https://www.ncbi.nlm.nih.gov/medgen/", diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index 122c1bb..54e26bb 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -54,14 +54,14 @@ def neuroblastoma(): { "coding": { "code": "9500/3", - "system": "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology", + "system": "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology/", }, "relation": "relatedMatch", }, { "coding": { "code": "0000621", - "system": "https://www.ebi.ac.uk/efo", + "system": "https://www.ebi.ac.uk/efo/", }, "relation": "relatedMatch", }, From fb70350379dea694e3d4efd513fe5e3a37e62cf4 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Tue, 31 Dec 2024 09:34:37 -0500 Subject: [PATCH 3/4] fix meddra --- src/disease/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/disease/schemas.py b/src/disease/schemas.py index 5fb75ab..e5e7598 100644 --- a/src/disease/schemas.py +++ b/src/disease/schemas.py @@ -105,7 +105,7 @@ class NamespacePrefix(Enum): NamespacePrefix.ICD11: "https://icd.who.int/en/", NamespacePrefix.ICDO: "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology/", NamespacePrefix.KEGG: "https://www.genome.jp/kegg/disease/", - NamespacePrefix.MEDDRA: "https://www.meddra.org/", + NamespacePrefix.MEDDRA: "https://www.meddra.org", NamespacePrefix.MEDGEN: "https://www.ncbi.nlm.nih.gov/medgen/", NamespacePrefix.MESH: "https://id.nlm.nih.gov/mesh/", NamespacePrefix.MP: "http://purl.obolibrary.org/obo/mp.owl", From 7750db3b66691b94975083c074a8fdb88f513b83 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Tue, 31 Dec 2024 11:54:43 -0500 Subject: [PATCH 4/4] use curie for concept mapping code --- src/disease/query.py | 4 ++-- src/disease/schemas.py | 25 ++++++++++++++----------- tests/unit/test_query.py | 36 +++++++++++++++++++++--------------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/disease/query.py b/src/disease/query.py index 381b1e5..3402fca 100644 --- a/src/disease/query.py +++ b/src/disease/query.py @@ -342,7 +342,7 @@ def _create_concept_mapping( :param relation: SKOS mapping relationship, default is relatedMatch :return: Concept mapping for identifier """ - source, source_id = concept_id.split(":") + source = concept_id.split(":")[0] try: source = NamespacePrefix(source) @@ -356,7 +356,7 @@ def _create_concept_mapping( system = NAMESPACE_TO_SYSTEM_URI.get(source, source) return ConceptMapping( - coding=Coding(code=code(source_id), system=system), relation=relation + coding=Coding(code=code(concept_id), system=system), relation=relation ) disease_obj = MappableConcept( diff --git a/src/disease/schemas.py b/src/disease/schemas.py index e5e7598..7125caa 100644 --- a/src/disease/schemas.py +++ b/src/disease/schemas.py @@ -310,39 +310,42 @@ class NormalizationService(BaseModel): "normalized_id": "ncit:C4989", "disease": { "id": "normalize.disease.ncit:C4989", - "type": "Disease", + "conceptType": "Disease", "label": "Childhood Leukemia", - "aliases": [ - "childhood leukemia (disease)", - "leukemia", - "pediatric leukemia (disease)", - "Leukemia", - "leukemia (disease) of childhood", - ], "mappings": [ { "coding": { - "code": "0004355", + "code": "mondo:0004355", "system": "http://purl.obolibrary.org/obo/mondo.owl", }, "relation": "relatedMatch", }, { "coding": { - "code": "7757", + "code": "DOID:7757", "system": "http://purl.obolibrary.org/obo/doid.owl", }, "relation": "relatedMatch", }, { "coding": { - "code": "C1332977", + "code": "umls:C1332977", "system": "https://www.nlm.nih.gov/research/umls/index.html", }, "relation": "relatedMatch", }, ], "extensions": [ + { + "name": "aliases", + "value": [ + "childhood leukemia (disease)", + "leukemia", + "pediatric leukemia (disease)", + "Leukemia", + "leukemia (disease) of childhood", + ], + }, { "name": "pediatric_disease", "value": True, diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index 54e26bb..af2282f 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -25,74 +25,77 @@ def neuroblastoma(): mappings=[ { "coding": { - "code": "0005072", + "code": "mondo:0005072", "system": "http://purl.obolibrary.org/obo/mondo.owl", }, "relation": "relatedMatch", }, { "coding": { - "code": "NBL", + "code": "oncotree:NBL", "system": "https://oncotree.mskcc.org", }, "relation": "relatedMatch", }, { "coding": { - "code": "769", + "code": "DOID:769", "system": "http://purl.obolibrary.org/obo/doid.owl", }, "relation": "relatedMatch", }, { "coding": { - "code": "C0027819", + "code": "umls:C0027819", "system": "https://www.nlm.nih.gov/research/umls/index.html", }, "relation": "relatedMatch", }, { "coding": { - "code": "9500/3", + "code": "icdo:9500/3", "system": "https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology/", }, "relation": "relatedMatch", }, { "coding": { - "code": "0000621", + "code": "efo:0000621", "system": "https://www.ebi.ac.uk/efo/", }, "relation": "relatedMatch", }, { "coding": { - "code": "7185", + "code": "gard:7185", "system": "https://rarediseases.info.nih.gov", }, "relation": "relatedMatch", }, { - "coding": {"code": "D009447", "system": "https://id.nlm.nih.gov/mesh/"}, + "coding": { + "code": "mesh:D009447", + "system": "https://id.nlm.nih.gov/mesh/", + }, "relation": "relatedMatch", }, { "coding": { - "code": "635", + "code": "orphanet:635", "system": "https://www.orpha.net", }, "relation": "relatedMatch", }, { "coding": { - "code": "C2751421", + "code": "umls:C2751421", "system": "https://www.nlm.nih.gov/research/umls/index.html", }, "relation": "relatedMatch", }, { "coding": { - "code": "18012", + "code": "medgen:18012", "system": "https://www.ncbi.nlm.nih.gov/medgen/", }, "relation": "relatedMatch", @@ -142,23 +145,26 @@ def mafd2(): label="major affective disorder 2", mappings=[ { - "coding": {"code": "309200", "system": "https://www.omim.org"}, + "coding": {"code": "MIM:309200", "system": "https://www.omim.org"}, "relation": "relatedMatch", }, { - "coding": {"code": "C564108", "system": "https://id.nlm.nih.gov/mesh/"}, + "coding": { + "code": "mesh:C564108", + "system": "https://id.nlm.nih.gov/mesh/", + }, "relation": "relatedMatch", }, { "coding": { - "code": "326975", + "code": "medgen:326975", "system": "https://www.ncbi.nlm.nih.gov/medgen/", }, "relation": "relatedMatch", }, { "coding": { - "code": "C1839839", + "code": "umls:C1839839", "system": "https://www.nlm.nih.gov/research/umls/index.html", }, "relation": "relatedMatch",