Skip to content

Commit

Permalink
fix!: ConceptMapping.coding.code should be a CURIE
Browse files Browse the repository at this point in the history
close #383

* Use `concept_id` as the CURIE
  • Loading branch information
korikuzma committed Dec 31, 2024
1 parent f6f200f commit ed970c2
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 59 deletions.
5 changes: 2 additions & 3 deletions src/gene/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def _create_concept_mapping(
``NamespacePrefix``
:return: Concept mapping for identifier
"""
source, source_id = concept_id.split(":")
source = concept_id.split(":")[0]

try:
source = NamespacePrefix(source)
Expand All @@ -424,10 +424,9 @@ def _create_concept_mapping(
raise ValueError(err_msg) from e

system = NAMESPACE_TO_SYSTEM_URI.get(source, source)
code_ = concept_id.upper() if source == NamespacePrefix.HGNC else source_id

return ConceptMapping(
coding=Coding(code=code(code_), system=system), relation=relation
coding=Coding(code=code(concept_id), system=system), relation=relation
)

gene_obj = MappableConcept(
Expand Down
Loading

0 comments on commit ed970c2

Please sign in to comment.