Skip to content

Commit

Permalink
Work in progress, refactor part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jarbesfeld committed Apr 8, 2024
1 parent c52f03f commit a8fe91f
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 25 deletions.
9 changes: 5 additions & 4 deletions src/dcd_mapping/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import polars as pl
import requests
from biocommons.seqrepo import SeqRepo
from cool_seq_tool.app import CoolSeqTool
from cool_seq_tool.handlers.seqrepo_access import SeqRepoAccess
from cool_seq_tool.schemas import TranscriptPriority
Expand Down Expand Up @@ -55,7 +56,8 @@ def __new__(cls) -> CoolSeqTool:
:return: singleton instance of CoolSeqTool
"""
if not hasattr(cls, "instance"):
cls.instance = CoolSeqTool()
sr = SeqRepo("/usr/local/share/seqrepo/latest", writeable = True)
cls.instance = CoolSeqTool(sr=sr)
return cls.instance


Expand Down Expand Up @@ -367,14 +369,13 @@ def get_sequence(
# -------------------------------- VRS-Python -------------------------------- #


def translate_hgvs_to_vrs(hgvs: str, data_proxy: SeqRepoDataProxy) -> Allele:
def translate_hgvs_to_vrs(hgvs: str) -> Allele:
"""Convert HGVS variation description to VRS object.
:param hgvs: MAVE-HGVS variation string
:param data_proxy:
:return: Corresponding VRS allele as a Pydantic class
"""
tr = TranslatorBuilder(data_proxy)
tr = TranslatorBuilder(CoolSeqToolBuilder().seqrepo_access)
allele = tr.translate_from(hgvs, "hgvs")

if (
Expand Down
Loading

0 comments on commit a8fe91f

Please sign in to comment.