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
614 changes: 349 additions & 265 deletions pixi.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ test = { features = ["test"] }
format = { features = ["format"], no-default-feature = true }

[feature.test.dependencies]
pytest = "*"
graphviz = "*"
pytest = ">=9.0.2"
graphviz = ">=12.2.1"

[feature.format.dependencies]
black = "*"
snakefmt = "*"
ruff = ">=0.15.1"
snakefmt = ">=0.11.5"
22 changes: 14 additions & 8 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ snakemake.utils.validate(
#####################
### Read Trimming ###
#####################
pathvars:
reports="reports",
stats="stats",
temp="temp",


include: "rules/utils.smk"
include: "rules/raw.smk"
include: "rules/trim.smk"
Expand Down Expand Up @@ -79,34 +85,34 @@ rule multiqc:
if is_activated("trim")
else [],
output:
html="reports/multiqc.html",
data="reports/multiqc_data.zip",
html="<reports>/multiqc.html",
data="<reports>/multiqc_data.zip",
log:
"logs/reports/multiqc.log",
"<logs>/<reports>/multiqc.log",
benchmark:
"benchmarks/reports/multiqc.jsonl"
params:
extra="--force --clean-up " + config.get("report", {}).get("multiqc", ""),
"<benchmarks>/<reports>/multiqc.jsonl"
localrule: True
threads: 1
resources:
mem=lambda w, attempt: f"{10* attempt} GiB",
runtime=lambda w, attempt: f"{30* attempt} m",
params:
extra="--force --clean-up " + config.get("report", {}).get("multiqc", ""),
wrapper:
"v8.1.1/bio/multiqc"


rule all:
default_target: True
input:
qc=rules.multiqc.output.html,
res=(
expand_pd(
"results/reads/trim/{sample}_{library}_{lane}_{read_type_trim}.fastq.gz",
"<results>/reads/trim/{sample}_{library}_{lane}_{read_type_trim}.fastq.gz",
units.explode("read_type_trim"),
)
if is_activated("trim")
else []
),
message:
"Read trimming finished successfully!"
default_target: True
14 changes: 8 additions & 6 deletions workflow/rules/raw.smk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rule get_fastq_raw:
input:
_get_input_data,
output:
"results/reads/raw/{sample}_{library}_{lane}_{read_type_raw}.fastq.gz",
"<results>/reads/raw/{sample}_{library}_{lane}_{read_type_raw}.fastq.gz",
localrule: True
threads: 1
run:
Expand All @@ -53,7 +53,9 @@ rule get_fastq_raw:
src = Path(input[0])
dst = Path(output[0])
if src.suffix != ".gz":
raise ValueError("Input FASTQ files is not GZip'ed: {}!".format(input[0]))
raise ValueError(
"Input FASTQ files is not GZip'ed: {}!".format(input[0])
)

with gzip.open(src, "rb") as f:
f.read(2)
Expand All @@ -67,12 +69,12 @@ rule fastqc_raw:
input:
rules.get_fastq_raw.output,
output:
html="stats/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.html",
zip="stats/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}_fastqc.zip",
html="<stats>/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.html",
zip="<stats>/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}_fastqc.zip",
log:
"logs/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.log",
"<logs>/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.log",
benchmark:
"benchmarks/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.jsonl"
"<benchmarks>/reads/fastqc/raw/{sample}_{library}_{lane}_{read_type_raw}.jsonl"
threads: 4
resources:
mem=lambda w, attempt: f"{3* attempt} GiB",
Expand Down
Loading
Loading