Skip to content

Commit

Permalink
Merge branch 'issue-212' into issue-213
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Dec 31, 2024
2 parents 94dceec + 7750db3 commit ce007db
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/disease/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,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)
Expand All @@ -352,7 +352,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(
Expand Down
17 changes: 11 additions & 6 deletions src/disease/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,16 @@ 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.EFO: "https://www.ebi.ac.uk/efo",
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.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",
Expand Down Expand Up @@ -309,28 +314,28 @@ class NormalizationService(BaseModel):
"mappings": [
{
"coding": {
"code": "C4989",
"code": "ncit:C4989",
"system": "https://www.ebi.ac.uk/ols4/ontologies/ncit/classes?short_form=NCIT_",
},
"relation": "exactMatch",
},
{
"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",
Expand Down
50 changes: 31 additions & 19 deletions tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,75 +26,84 @@ def neuroblastoma():
mappings=[
{
"coding": {
"code": "C3270",
"code": "ncit:C3270",
"system": "http://purl.obolibrary.org/obo/ncit.owl",
},
"relation": "exactMatch",
},
{
"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", "system": "icdo"},
"coding": {
"code": "icdo:9500/3",
"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",
"code": "efo:0000621",
"system": "https://www.ebi.ac.uk/efo/",
},
"relation": "relatedMatch",
},
{
"coding": {"code": "7185", "system": "gard"},
"coding": {
"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",
Expand Down Expand Up @@ -133,7 +142,7 @@ def skin_myo():
mappings=[
{
"coding": {
"code": "C167370",
"code": "ncit:C167370",
"system": "http://purl.obolibrary.org/obo/ncit.owl",
},
"relation": "exactMatch",
Expand All @@ -156,29 +165,32 @@ def mafd2():
mappings=[
{
"coding": {
"code": "0010648",
"code": "mondo:0010648",
"system": "http://purl.obolibrary.org/obo/mondo.owl",
},
"relation": "exactMatch",
},
{
"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",
Expand Down

0 comments on commit ce007db

Please sign in to comment.