Skip to content
Open
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -27,7 +27,7 @@ repos:
language: pygrep
files: \.(py|sh|rst|yml|yaml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.14.3
hooks:
# Run the Ruff linter (flake8 alternative):
- id: ruff
Expand All @@ -46,7 +46,7 @@ repos:
'--config=format.docstring-code-format=true'
]
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
rev: v6.2.5
hooks:
- id: rstcheck
args: [
Expand All @@ -56,13 +56,13 @@ repos:
--ignore-substitutions=version
]
- repo: https://github.com/PyCQA/doc8
rev: 'v1.1.2'
rev: 'v2.0.0'
hooks:
- id: doc8
additional_dependencies: [pygments]
args: [--quiet,--ignore=D001]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
files: \.(py|sh|rst|yml|yaml)$
Expand Down
14 changes: 9 additions & 5 deletions primer_selection/isPcr_lineage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ def report_group(
except KeyError:
local_mito[more_cut] = culled
assert cut_lineage not in local_mito
assert (
sum(local_mito.values()) == total
), "Oops - culling changed the total"
assert sum(local_mito.values()) == total, (
"Oops - culling changed the total"
)
# sys.stderr.write(
# f"DEBUG '{cut_lineage}' count {culled} --> {more_cut} which is now {local_mito[more_cut]}\n"
# )
Expand Down Expand Up @@ -378,7 +378,9 @@ def report_group(
for primer_name in primer_defs:
assert (
len(local_lengths[cut_lineage, primer_name]) <= local_mito[cut_lineage]
), f"{cut_lineage} {primer_name}: {len(local_lengths[cut_lineage, primer_name])} products from {local_mito[cut_lineage]} mtDNA for {cut_lineage if cut_lineage else 'Other ' + root}"
), (
f"{cut_lineage} {primer_name}: {len(local_lengths[cut_lineage, primer_name])} products from {local_mito[cut_lineage]} mtDNA for {cut_lineage if cut_lineage else 'Other ' + root}"
)

# assert set(local_mito) == set(local_lengths)
# print(f"{len(local_lengths)} entries for {root} level {levels}")
Expand Down Expand Up @@ -529,7 +531,9 @@ def report_group(
assert (
len(local_lengths[cut_lineage, primer_name])
<= local_mito[cut_lineage]
), f"{cut_lineage} {primer_name}: {len(local_lengths[cut_lineage, primer_name])} products from {local_mito[cut_lineage]} mtDNA for {cut_lineage if cut_lineage else 'Other'}"
), (
f"{cut_lineage} {primer_name}: {len(local_lengths[cut_lineage, primer_name])} products from {local_mito[cut_lineage]} mtDNA for {cut_lineage if cut_lineage else 'Other'}"
)
worksheet = workbook.add_worksheet(f"{root} - Percent")
worksheet.set_column(0, 0, 43) # column width
worksheet.set_column(1, 1, 6.5)
Expand Down
9 changes: 4 additions & 5 deletions primer_selection/isPcr_tally.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@
metavar="TSV",
required=True,
help=(
"Deduplicated bed output file(s) from isPcr. Only the "
"first 4 columns are used."
"Deduplicated bed output file(s) from isPcr. Only the first 4 columns are used."
),
)
parser.add_argument(
Expand Down Expand Up @@ -174,9 +173,9 @@ def load_fasta(fasta_files):
continue
f_lengths = {len(f) for f, r in cocktail}
r_lengths = {len(r) for f, r in cocktail}
assert (
len(f_lengths) == 1 and len(r_lengths) == 1
), f"Assorted lengths in {name} cocktail"
assert len(f_lengths) == 1 and len(r_lengths) == 1, (
f"Assorted lengths in {name} cocktail"
)
# Do NOT add +1, the start/end are python style, len=end-start
product_len = (
int(end) - int(start) - list(f_lengths)[0] - list(r_lengths)[0]
Expand Down
6 changes: 3 additions & 3 deletions primer_selection/primer_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def load_isprc(isprc_filename, ref_name, primer_hits):
left,
right,
) in primer_hits, f"Stale cache? Why {name}, {left}, {right}"
assert (
length == f"{len(seq)}bp"
), f"Expected length {len(seq)} from sequence, yet {length}"
assert length == f"{len(seq)}bp", (
f"Expected length {len(seq)} from sequence, yet {length}"
)
seq = seq.upper()
# chrom, rest = region.rsplit(":", 1)
# if "+" in rest:
Expand Down
1 change: 0 additions & 1 deletion snakemake/snakemake_progress_bar_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from pathlib import Path

from rich.progress import Progress # or use tqdm, or ...

from snakemake.api import DAGSettings
from snakemake.api import ResourceSettings
from snakemake.api import SnakemakeApi
Expand Down