Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Feb 4, 2025
1 parent 1a0ffdc commit 3cacc2c
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 134 deletions.
10 changes: 5 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ verify_ssl = true
name = "pypi"

[packages]
"ga4gh.vrs" = "~=2.0.0a10"
gene-normalizer = {version = "~=0.4.1", extras = ["etl"]}
variation-normalizer = "~=0.10.0"
disease-normalizer = {version = "~=0.5.0", extras = ["etl"]}
thera-py = {version = "~=0.6.0", extras = ["etl"]}
"ga4gh.vrs" = "==2.0.0a13"
gene-normalizer = {version = "~=0.7.0", extras = ["etl"]}
variation-normalizer = "~=0.12.1"
disease-normalizer = {version = "~=0.8.0", extras = ["etl"]}
thera-py = {version = "~=0.8.0", extras = ["etl"]}
civicpy = "~=3.1"
requests = "*"
pydantic = "==2.*"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ dependencies = [
"ga4gh.vrs==2.0.0a13",
"ga4gh.cat_vrs~=0.2.1",
"ga4gh.va_spec @ git+https://github.com/ga4gh/va-spec-python.git@issue-10",
"gene-normalizer[etl]~=0.6.0",
"variation-normalizer~=0.12.0",
"disease-normalizer[etl]~=0.7.0",
"thera-py[etl]~=0.7.1",
"gene-normalizer[etl]~=0.7.0",
"variation-normalizer~=0.12.1",
"disease-normalizer[etl]~=0.8.0",
"thera-py[etl]~=0.8.0",
"civicpy~=3.1",
"requests",
"pydantic==2.*",
Expand Down
12 changes: 4 additions & 8 deletions src/metakb/transformers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
from pathlib import Path
from typing import ClassVar, TypeVar

from disease.schemas import (
SYSTEM_URI_TO_NAMESPACE as DISEASE_SYSTEM_URI_TO_NAMESPACE,
)
from disease.schemas import (
NamespacePrefix as DiseaseNamespacePrefix,
)
Expand Down Expand Up @@ -591,13 +588,12 @@ def _add_merged_id_ext(
normalizer_mappings = normalizer_resp_obj.mappings or []
if isinstance(normalizer_resp, NormalizedDisease):
for mapping in normalizer_mappings:
if (
DISEASE_SYSTEM_URI_TO_NAMESPACE.get(mapping.coding.system)
== DiseaseNamespacePrefix.MONDO.value
if mapping.coding.code.root.lower().startswith(
DiseaseNamespacePrefix.MONDO.value
):
mappings.append(_add_merged_id_ext(mapping, is_priority=False))
else:
if normalized_id == mapping.coding.code.root:
if normalized_id == mapping.coding.id:
mappings.append(
_add_merged_id_ext(
mapping,
Expand All @@ -611,7 +607,7 @@ def _add_merged_id_ext(
mapping, label=normalizer_resp_obj.label, is_priority=True
)
for mapping in normalizer_mappings
if normalized_id == mapping.coding.code.root
if normalized_id == mapping.coding.id
)
return mappings

Expand Down
Loading

0 comments on commit 3cacc2c

Please sign in to comment.