Skip to content

Commit

Permalink
build: pin cool-seq-tool version ~=0.9.1 (#589)
Browse files Browse the repository at this point in the history
close #588
  • Loading branch information
korikuzma authored Jan 6, 2025
1 parent dc26a7c commit 47db4d5
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"ga4gh.vrs[extras] ==2.0.0a13",
"gene-normalizer ~=0.6.0",
"boto3",
"cool-seq-tool ~=0.6.0",
"cool-seq-tool ~=0.9.1",
"bioutils"
]
dynamic = ["version"]
Expand Down
4 changes: 2 additions & 2 deletions src/variation/hgvs_dup_del_mode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module for hgvs_dup_del_mode in normalize endpoint."""

from cool_seq_tool.handlers import SeqRepoAccess
from cool_seq_tool.schemas import ResidueMode
from cool_seq_tool.schemas import CoordinateType
from ga4gh.core import ga4gh_identify
from ga4gh.core.models import (
Extension,
Expand Down Expand Up @@ -179,7 +179,7 @@ def allele_mode(
vrs_seq_loc_ac,
start=location["start"],
end=location["end"],
residue_mode=ResidueMode.INTER_RESIDUE,
coordinate_type=CoordinateType.INTER_RESIDUE,
)

if ref:
Expand Down
24 changes: 12 additions & 12 deletions src/variation/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import pkg_resources
from bioutils.exceptions import BioutilsError
from cool_seq_tool.schemas import Assembly, ResidueMode
from cool_seq_tool.schemas import Assembly, CoordinateType
from fastapi import FastAPI, Query
from ga4gh.vrs import models
from ga4gh.vrs.dataproxy import DataProxyValidationError
Expand Down Expand Up @@ -678,8 +678,8 @@ async def p_to_c(
p_ac: str = Query(..., description="Protein RefSeq accession"),
p_start_pos: int = Query(..., description="Protein start position"),
p_end_pos: int = Query(..., description="Protein end position"),
residue_mode: ResidueMode = Query(
ResidueMode.RESIDUE,
residue_mode: CoordinateType = Query(
CoordinateType.RESIDUE,
description="Residue mode for `p_start_pos` and `p_end_pos`",
),
) -> ToCdnaService:
Expand All @@ -688,7 +688,7 @@ async def p_to_c(
:param str p_ac: Protein RefSeq accession
:param int p_start_pos: Protein start position
:param int p_end_pos: Protein end position
:param ResidueMode residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
:param CoordinateType residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
:return: ToCdnaService containing cDNA representation, warnings, and
service meta
"""
Expand Down Expand Up @@ -727,8 +727,8 @@ async def c_to_g(
cds_start: int | None = Query(
None, description="CDS start site. If not provided, this will be computed."
),
residue_mode: ResidueMode = Query(
ResidueMode.RESIDUE,
residue_mode: CoordinateType = Query(
CoordinateType.RESIDUE,
description="Residue mode for `c_start_pos` and `c_end_pos`",
),
target_genome_assembly: Assembly = Query(
Expand All @@ -742,7 +742,7 @@ async def c_to_g(
:param int c_end_pos: cDNA end position for codon
:param Optional[int] cds_start: CDS start site. If not provided, this will be
computed.
:param ResidueMode residue_mode: Residue mode for `c_start_pos` and `c_end_pos`.
:param CoordinateType residue_mode: Residue mode for `c_start_pos` and `c_end_pos`.
:param Assembly target_genome_assembly: Genome assembly to get genomic data for
:return: ToGenomicService containing genomic representation, warnings, and
service meta
Expand All @@ -753,7 +753,7 @@ async def c_to_g(
c_start_pos,
c_end_pos,
cds_start=cds_start,
residue_mode=residue_mode,
coordinate_type=residue_mode,
target_genome_assembly=target_genome_assembly,
)
except Exception as e:
Expand Down Expand Up @@ -784,8 +784,8 @@ async def p_to_g(
p_ac: str = Query(..., description="Protein RefSeq accession"),
p_start_pos: int = Query(..., description="Protein start position"),
p_end_pos: int = Query(..., description="Protein end position"),
residue_mode: ResidueMode = Query(
ResidueMode.RESIDUE,
residue_mode: CoordinateType = Query(
CoordinateType.RESIDUE,
description="Residue mode for `p_start_pos` and `p_end_pos`",
),
target_genome_assembly: Assembly = Query(
Expand All @@ -797,7 +797,7 @@ async def p_to_g(
:param str p_ac: Protein RefSeq accession
:param int p_start_pos: Protein start position
:param int p_end_pos: Protein end position
:param ResidueMode residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
:param CoordinateType residue_mode: Residue mode for `p_start_pos` and `p_end_pos`.
:param Assembly target_genome_assembly: Genome assembly to get genomic data for
:return: ToGenomicService containing genomic representation, warnings, and
service meta
Expand All @@ -807,7 +807,7 @@ async def p_to_g(
p_ac,
p_start_pos,
p_end_pos,
residue_mode=residue_mode,
coordinate_type=residue_mode,
target_genome_assembly=target_genome_assembly,
)
except Exception as e:
Expand Down
10 changes: 5 additions & 5 deletions src/variation/schemas/service_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enum import Enum
from typing import Literal

from cool_seq_tool.schemas import ResidueMode
from cool_seq_tool.schemas import CoordinateType
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr

from variation import __version__
Expand All @@ -28,7 +28,7 @@ class CdnaRepresentation(BaseModel, extra="forbid"):
c_start_pos: StrictInt
c_end_pos: StrictInt
cds_start: StrictInt
residue_mode: Literal["inter-residue"] = ResidueMode.INTER_RESIDUE.value
residue_mode: Literal["inter-residue"] = CoordinateType.INTER_RESIDUE.value

model_config = ConfigDict(
json_schema_extra={
Expand All @@ -37,7 +37,7 @@ class CdnaRepresentation(BaseModel, extra="forbid"):
"c_start_pos": 1797,
"c_end_pos": 1800,
"cds_start": 226,
"residue_mode": ResidueMode.INTER_RESIDUE.value,
"residue_mode": CoordinateType.INTER_RESIDUE.value,
}
}
)
Expand Down Expand Up @@ -78,15 +78,15 @@ class GenomicRepresentation(BaseModel, extra="forbid"):
g_ac: StrictStr
g_start_pos: StrictInt
g_end_pos: StrictInt
residue_mode: Literal["inter-residue"] = ResidueMode.INTER_RESIDUE.value
residue_mode: Literal["inter-residue"] = CoordinateType.INTER_RESIDUE.value

model_config = ConfigDict(
json_schema_extra={
"example": {
"g_ac": "NC_000007.13",
"g_start_pos": 140453134,
"g_end_pos": 140453137,
"residue_mode": ResidueMode.INTER_RESIDUE.value,
"residue_mode": CoordinateType.INTER_RESIDUE.value,
}
}
)
Expand Down
16 changes: 8 additions & 8 deletions src/variation/translators/genomic_del_dup_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import NamedTuple

from cool_seq_tool.schemas import ManeGeneData, ResidueMode
from cool_seq_tool.schemas import CoordinateType, ManeGeneData
from ga4gh.vrs import models
from pydantic import StrictInt, StrictStr, ValidationError

Expand Down Expand Up @@ -116,7 +116,7 @@ async def translate(
grch38_data = None
vrs_variation = None
vrs_seq_loc_ac_status = VrsSeqLocAcStatus.NA
residue_mode = ResidueMode.RESIDUE
residue_mode = CoordinateType.RESIDUE
mane_genes = None

if do_liftover or endpoint_name == Endpoint.NORMALIZE:
Expand All @@ -141,7 +141,7 @@ async def translate(
pos1 = grch38_data.pos0
else:
pos1 = grch38_data.pos1
residue_mode = ResidueMode.INTER_RESIDUE
residue_mode = CoordinateType.INTER_RESIDUE
ac = grch38_data.ac

if (
Expand All @@ -154,7 +154,7 @@ async def translate(
pos0,
pos0 + (len(ref) - 1),
ref,
residue_mode=residue_mode,
coordinate_type=residue_mode,
)
if invalid_ref_msg:
warnings.append(invalid_ref_msg)
Expand Down Expand Up @@ -198,7 +198,7 @@ async def translate(
pos0 = grch38_data.pos0 - 1
pos1 = grch38_data.pos0 if grch38_data.pos1 is None else grch38_data.pos1
mane_genes = grch38_data.mane_genes
residue_mode = ResidueMode.INTER_RESIDUE
residue_mode = CoordinateType.INTER_RESIDUE
self.is_valid(classification.gene_token, ac, pos0, pos1, errors)

if errors:
Expand All @@ -211,7 +211,7 @@ async def translate(
pos1,
"g",
try_longest_compatible=True,
residue_mode=residue_mode,
coordinate_type=residue_mode,
gene=classification.gene_token.token
if classification.gene_token
else None,
Expand All @@ -223,7 +223,7 @@ async def translate(
vrs_seq_loc_ac_status = mane.status
pos0 = mane.pos[0] + mane.coding_start_site
pos1 = mane.pos[1] + mane.coding_start_site
residue_mode = ResidueMode.INTER_RESIDUE
residue_mode = CoordinateType.INTER_RESIDUE
else:
return None

Expand All @@ -239,7 +239,7 @@ async def translate(
if alt_type == AltType.INSERTION:
alt = classification.inserted_sequence

start = pos0 if residue_mode == ResidueMode.INTER_RESIDUE else pos0 - 1
start = pos0 if residue_mode == CoordinateType.INTER_RESIDUE else pos0 - 1
end = pos1 if pos1 else pos0

refget_accession = get_refget_accession(self.seqrepo_access, ac, warnings)
Expand Down
8 changes: 4 additions & 4 deletions src/variation/translators/genomic_delins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for Genomic DelIns Translation."""

from cool_seq_tool.schemas import AnnotationLayer, ResidueMode
from cool_seq_tool.schemas import AnnotationLayer, CoordinateType
from ga4gh.vrs import models

from variation.schemas.app_schemas import Endpoint
Expand Down Expand Up @@ -70,7 +70,7 @@ async def translate(
else classification.pos0,
AnnotationLayer.GENOMIC,
try_longest_compatible=True,
residue_mode=ResidueMode.RESIDUE,
coordinate_type=CoordinateType.RESIDUE,
gene=gene,
)

Expand Down Expand Up @@ -103,7 +103,7 @@ async def translate(
warnings,
alt=classification.inserted_sequence,
cds_start=mane.coding_start_site if gene else None,
residue_mode=ResidueMode.INTER_RESIDUE,
residue_mode=CoordinateType.INTER_RESIDUE,
extensions=extensions,
)
else:
Expand All @@ -116,7 +116,7 @@ async def translate(
AltType.DELINS,
warnings,
alt=classification.inserted_sequence,
residue_mode=ResidueMode.RESIDUE,
residue_mode=CoordinateType.RESIDUE,
)

if vrs_allele and vrs_seq_loc_ac:
Expand Down
8 changes: 4 additions & 4 deletions src/variation/translators/genomic_insertion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for Genomic Insertion Translation."""

from cool_seq_tool.schemas import AnnotationLayer, ResidueMode
from cool_seq_tool.schemas import AnnotationLayer, CoordinateType
from ga4gh.vrs import models

from variation.schemas.app_schemas import Endpoint
Expand Down Expand Up @@ -71,7 +71,7 @@ async def translate(
classification.pos1,
AnnotationLayer.GENOMIC,
try_longest_compatible=True,
residue_mode=ResidueMode.RESIDUE,
coordinate_type=CoordinateType.RESIDUE,
gene=gene,
)

Expand Down Expand Up @@ -104,7 +104,7 @@ async def translate(
warnings,
alt=classification.inserted_sequence,
cds_start=mane.coding_start_site if gene else None,
residue_mode=ResidueMode.INTER_RESIDUE,
residue_mode=CoordinateType.INTER_RESIDUE,
extensions=extensions,
)
else:
Expand All @@ -117,7 +117,7 @@ async def translate(
AltType.INSERTION,
warnings,
alt=classification.inserted_sequence,
residue_mode=ResidueMode.RESIDUE,
residue_mode=CoordinateType.RESIDUE,
)

if vrs_allele and vrs_seq_loc_ac:
Expand Down
8 changes: 4 additions & 4 deletions src/variation/translators/genomic_reference_agree.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for Genomic Reference Agree Translation."""

from cool_seq_tool.schemas import AnnotationLayer, ResidueMode
from cool_seq_tool.schemas import AnnotationLayer, CoordinateType
from ga4gh.vrs import models

from variation.schemas.app_schemas import Endpoint
Expand Down Expand Up @@ -70,7 +70,7 @@ async def translate(
classification.pos,
AnnotationLayer.GENOMIC,
try_longest_compatible=True,
residue_mode=ResidueMode.RESIDUE,
coordinate_type=CoordinateType.RESIDUE,
gene=gene,
)

Expand Down Expand Up @@ -101,7 +101,7 @@ async def translate(
AltType.REFERENCE_AGREE,
warnings,
cds_start=mane.coding_start_site if gene else None,
residue_mode=ResidueMode.INTER_RESIDUE,
residue_mode=CoordinateType.INTER_RESIDUE,
extensions=extensions,
)
else:
Expand All @@ -113,7 +113,7 @@ async def translate(
AnnotationLayer.GENOMIC,
AltType.REFERENCE_AGREE,
warnings,
residue_mode=ResidueMode.RESIDUE,
residue_mode=CoordinateType.RESIDUE,
)

if vrs_allele and vrs_seq_loc_ac:
Expand Down
8 changes: 4 additions & 4 deletions src/variation/translators/genomic_substitution.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for Genomic Substitution Translation."""

from cool_seq_tool.schemas import AnnotationLayer, ResidueMode, Strand
from cool_seq_tool.schemas import AnnotationLayer, CoordinateType, Strand
from ga4gh.vrs import models

from variation.schemas.app_schemas import Endpoint
Expand Down Expand Up @@ -73,7 +73,7 @@ async def translate(
classification.pos,
AnnotationLayer.GENOMIC,
try_longest_compatible=True,
residue_mode=ResidueMode.RESIDUE,
coordinate_type=CoordinateType.RESIDUE,
gene=gene,
)

Expand Down Expand Up @@ -124,7 +124,7 @@ async def translate(
errors,
alt=classification.alt,
cds_start=mane.coding_start_site if gene else None,
residue_mode=ResidueMode.INTER_RESIDUE,
residue_mode=CoordinateType.INTER_RESIDUE,
extensions=extensions,
)
else:
Expand All @@ -137,7 +137,7 @@ async def translate(
AltType.SUBSTITUTION,
errors,
alt=classification.alt,
residue_mode=ResidueMode.RESIDUE,
residue_mode=CoordinateType.RESIDUE,
)

if vrs_allele and vrs_seq_loc_ac:
Expand Down
Loading

0 comments on commit 47db4d5

Please sign in to comment.