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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ repos:
- id: mixed-line-ending
args: [ --fix=lf ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.12.1
hooks:
- id: ruff-format
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
minimum_pre_commit_version: 4.0.1
minimum_pre_commit_version: 4.2.0
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ dynamic = ["version"]

[project.optional-dependencies]
dev = [
"pre-commit>=4.0.1",
"pre-commit>=4.2.0",
"ipython",
"ipykernel",
"psycopg2-binary",
"ruff==0.8.6"
"ruff==0.12.1",
]
tests = ["pytest", "pytest-cov", "pytest-asyncio==0.18.3", "mock"]
docs = [
Expand Down
4 changes: 1 addition & 3 deletions src/cool_seq_tool/handlers/seqrepo_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ def get_reference_sequence(
f"Start inter-residue coordinate ({start}) is out of index on {ac}"
)
elif error.startswith("stop out of range"):
msg = (
f"End inter-residue coordinate ({end}) is out of " f"index on {ac}"
)
msg = f"End inter-residue coordinate ({end}) is out of index on {ac}"
else:
msg = f"{e}"
_logger.warning(msg)
Expand Down
2 changes: 1 addition & 1 deletion src/cool_seq_tool/mappers/exon_genomic_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ async def _genomic_to_tx_segment(
GRCh38 by default. Will attempt to liftover if starting assembly is GRCh37
:return: Data for a transcript segment boundary (inter-residue coordinates)
"""
params = {key: None for key in GenomicTxSeg.model_fields}
params = dict.fromkeys(GenomicTxSeg.model_fields)

# Validate inputs exist in UTA
if gene:
Expand Down
2 changes: 1 addition & 1 deletion src/cool_seq_tool/mappers/mane_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ async def _liftover_to_38(self, genomic_tx_data: GenomicTxMetadata) -> None:
query = f"""
SELECT alt_ac
FROM {self.uta_db.schema}.genomic
WHERE alt_ac LIKE '{genomic_tx_data.alt_ac.split('.')[0]}%'
WHERE alt_ac LIKE '{genomic_tx_data.alt_ac.split(".")[0]}%'
{order_by_cond}
""" # noqa: S608
nc_acs = await self.uta_db.execute_query(query)
Expand Down
12 changes: 6 additions & 6 deletions src/cool_seq_tool/sources/uta_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def _create_genomic_table(self) -> None:
WHERE table_schema = '{self.schema}'
AND table_name = 'genomic'
);
"""
""" # noqa: S608
genomic_table_exists = await self.execute_query(check_table_exists)
genomic_table_exists = genomic_table_exists[0].get("exists")
if genomic_table_exists is None:
Expand Down Expand Up @@ -250,7 +250,7 @@ async def _create_genomic_table(self) -> None:
LEFT JOIN {self.schema}.exon_aln ea ON
(((te.exon_id = ea.tx_exon_id) AND
(ae.exon_id = ea.alt_exon_id))));
"""
""" # noqa: S608
await self.execute_query(create_genomic_table)

indexes = [
Expand Down Expand Up @@ -325,13 +325,13 @@ async def get_cds_start_end(self, tx_ac: str) -> tuple[int, int] | None:
cds_start_end = await self.execute_query(query)
if cds_start_end:
cds_start_end = cds_start_end[0]
if cds_start_end[0] is not None and cds_start_end[1] is not None: # noqa: RET503
if cds_start_end[0] is not None and cds_start_end[1] is not None:
return cds_start_end[0], cds_start_end[1]
else:
_logger.warning(
"Unable to get coding start/end site for accession: %s", tx_ac
)
return None
return None

async def get_newest_assembly_ac(self, ac: str) -> list[str]:
"""Find accession associated to latest genomic assembly
Expand All @@ -352,7 +352,7 @@ async def get_newest_assembly_ac(self, ac: str) -> list[str]:
query = f"""
SELECT ac
FROM {self.schema}._seq_anno_most_recent
WHERE ac LIKE '{ac.split('.')[0]}%'
WHERE ac LIKE '{ac.split(".")[0]}%'
AND ((descr IS NULL) OR (descr = ''))
{order_by_cond}
""" # noqa: S608
Expand Down Expand Up @@ -499,7 +499,7 @@ async def get_tx_exon_aln_v_data(
AND {start_pos} BETWEEN {pos_q}
AND {end_pos} BETWEEN {pos_q}
{order_by_cond}
"""
""" # noqa: S608
result = await self.execute_query(query)
if not result:
_logger.warning("Unable to find transcript alignment for query: %s", query)
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_seqrepo_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_translate_identifier(test_seqrepo_access):
resp = test_seqrepo_access.translate_identifier("refseq_152263.3")
assert resp == (
[],
"SeqRepo unable to get translated identifiers for" " refseq_152263.3",
"SeqRepo unable to get translated identifiers for refseq_152263.3",
)


Expand Down