Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ license = {file = "LICENSE"}
dependencies = [
"asyncpg",
"boto3",
"agct >= 0.1.0-dev1",
"agct >= 0.2.0rc1",
"polars ~= 1.0",
"biocommons.seqrepo",
"pydantic >=2.0,<3.0",
Expand Down
15 changes: 8 additions & 7 deletions src/cool_seq_tool/mappers/liftover.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import logging
from os import environ

from agct import Converter, Genome
from agct import Assembly as AgctAssembly
from agct import Converter

from cool_seq_tool.schemas import Assembly
from cool_seq_tool.utils import process_chromosome_input
Expand Down Expand Up @@ -43,13 +44,13 @@ def __init__(
"""
self.from_37_to_38 = Converter(
chainfile=chain_file_37_to_38 or LIFTOVER_CHAIN_37_TO_38,
from_db=Genome.HG19,
to_db=Genome.HG38,
from_assembly=AgctAssembly.HG19,
to_assembly=AgctAssembly.HG38,
)
self.from_38_to_37 = Converter(
chainfile=chain_file_38_to_37 or LIFTOVER_CHAIN_38_TO_37,
from_db=Genome.HG38,
to_db=Genome.HG19,
from_assembly=AgctAssembly.HG38,
to_assembly=AgctAssembly.HG19,
)

def get_liftover(
Expand Down Expand Up @@ -77,9 +78,9 @@ def get_liftover(
"""
chromosome = process_chromosome_input(chromosome, "LiftOver.get_liftover()")
if liftover_to_assembly == Assembly.GRCH38:
liftover = self.from_37_to_38.convert_coordinate(chromosome, pos)
liftover = self.from_37_to_38.convert_coordinate(chromosome, pos, pos)
elif liftover_to_assembly == Assembly.GRCH37:
liftover = self.from_38_to_37.convert_coordinate(chromosome, pos)
liftover = self.from_38_to_37.convert_coordinate(chromosome, pos, pos)
else:
_logger.warning("%s assembly not supported", liftover_to_assembly)
liftover = None
Expand Down
4 changes: 2 additions & 2 deletions src/cool_seq_tool/resources/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ async def check_status(
chain_file_38_to_37=chain_file_38_to_37,
)
except (FileNotFoundError, ChainfileError):
_logger.exception("agct converter setup failed")
_logger.exception("`agct` converter setup failed")
except Exception as e:
_logger.critical("Encountered unexpected error setting up agct: %s", e)
_logger.critical("Encountered unexpected error setting up `agct`: %s", e)
else:
status["liftover"] = True

Expand Down