Skip to content

Commit

Permalink
2.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tdayris committed May 31, 2024
1 parent db97c01 commit 5c6ece9
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 101 deletions.
6 changes: 0 additions & 6 deletions .test/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,32 @@ all: report.txt


dag.png:
mamba activate test-snakemake-wrappers && \
snakemake -s ../workflow/Snakefile \
--rulegraph --forceall | dot -Tpng > dag.png && \
cp --verbose dag.png ../dag.png


report.txt: pipeline.txt
mamba activate test-snakemake-wrappers && \
snakemake -s ../workflow/Snakefile --profile local \
--report report.zip 2>&1 | tee report.txt


pipeline.txt: linter.txt
mamba activate test-snakemake-wrappers && \
snakemake -s ../workflow/Snakefile \
--cores 2 \
--profile local \
2>&1 | tee pipeline.txt


linter.txt: format.txt black.txt
mamba activate test-snakemake-wrappers && \
snakemake -s ../workflow/Snakefile \
--lint 2>&1 | tee linter.txt


format.txt:
mamba activate test-snakemake-wrappers && \
snakefmt $(snakefiles) 2>&1 | tee format.txt

black.txt:
mamba activate test-snakemake-wrappers && \
black $(python_scripts) 2>&1 | tee black.txt


Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2.2.8

## Features

* Update snakemake wrappers to 3.10.2
* Report update
* More readable tmp and logs

# 2.2.7

## Fix
Expand Down
2 changes: 1 addition & 1 deletion workflow/report/fastq_screen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ This PNG_ image contains FastqScreen_ quality reports for sample {{ snakemake.wi
It is a stand-alone file, and can be opened in your favorite web-browser.

.. _PNG: https://en.wikipedia.org/wiki/PNG
.. _FastqScreen: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/fastq_screen.html
.. _FastqScreen: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/fastq_screen.html
2 changes: 1 addition & 1 deletion workflow/report/fastqc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ This HTML_ file contains FastQC_ quality reports for sample {{ snakemake.wildcar
It is a stand-alone file, and can be opened in your favorite web-browser.

.. _HTML: https://en.wikipedia.org/wiki/HTML
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/fastqc.html
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/fastqc.html
6 changes: 3 additions & 3 deletions workflow/report/material_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ whole pipeline was powered by Snakemake_ [#snakemakepaper]_.
.. [#snakemakepaper] Köster, Johannes, and Sven Rahmann. "Snakemake—a scalable bioinformatics workflow engine." Bioinformatics 28.19 (2012): 2520-2522.
.. _MultiQC: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/multiqc.html
.. _MultiQC: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/multiqc.html
.. _Snakemake: https://snakemake.readthedocs.io
.. _Github: https://github.com/tdayris/fair_fastqc_multiqc
.. _`Snakemake workflow`: https://snakemake.github.io/snakemake-workflow-catalog?usage=tdayris/fair_fastqc_multiqc
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/fastqc.html
.. _FastqScreen: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/fastq_screen.html
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/fastqc.html
.. _FastqScreen: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/fastq_screen.html


:Authors:
Expand Down
2 changes: 1 addition & 1 deletion workflow/report/multiqc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ This HTML_ file contains quality reports of FastQC_ for all samples.
It is a stand-alone file, and can be opened in your favorite `web-browser`_.

.. _HTML: https://en.wikipedia.org/wiki/HTML
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.7.0/wrappers/fastqc.html
.. _FastQC: https://snakemake-wrappers.readthedocs.io/en/v3.10.2/wrappers/fastqc.html
.. _`web-browser`: https://en.wikipedia.org/wiki/Firefox
2 changes: 1 addition & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ snakemake.utils.validate(genomes, "../schemas/genomes.schema.yaml")
report: "../report/workflows.rst"


snakemake_wrappers_prefix: str = "v3.7.0"
snakemake_wrappers_prefix: str = "v3.10.2"
stream_list: list[str] = ["1", "2"]
tmp: str = f"{os.getcwd()}/tmp"

Expand Down
24 changes: 12 additions & 12 deletions workflow/rules/fastq_screen.smk
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
rule fair_fastqc_multiqc_fastq_screen_single_ended:
input:
sample="tmp/fair_fastqc_multiqc/link_or_concat_single_ended_input/{sample}.fastq.gz",
sample="tmp/fair_fastqc_multiqc_link_or_concat_single_ended_input/{sample}.fastq.gz",
output:
txt=temp(
"tmp/fair_fastqc_multiqc/fastq_screen_single_ended/{sample}.fastq_screen.txt"
"tmp/fair_fastqc_multiqc_fastq_screen_single_ended/{sample}.fastq_screen.txt"
),
tmp="results/QC/fastq_screen/{sample}.fastq_screen.png",
threads: 20
resources:
mem_mb=lambda wildcards, attempt: attempt * 512,
mem_mb=lambda wildcards, attempt: attempt * 500,
runtime=lambda wildcards, input, attempt: attempt
* 15
* max(1, int(input.size_mb / 1024)),
tmpdir=tmp,
log:
"logs/fair_fastqc_multiqc/fastq_screen_single_ended/{sample}.log",
"logs/fair_fastqc_multiqc_fastq_screen_single_ended/{sample}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/fastq_screen_single_ended/{sample}.tsv"
"benchmark/fair_fastqc_multiqc_fastq_screen_single_ended/{sample}.tsv"
params:
subset=lookup_config(
dpath="params/fair_fastqc_multiqc/fastq_screen/subset",
dpath="params/fair_fastqc_multiqc_fastq_screen/subset",
default=10000,
),
aligner=lookup_config(
dpath="params/fair_fastqc_multiqc/fastq_screen/aligner",
dpath="params/fair_fastqc_multiqc_fastq_screen/aligner",
default="bowtie2",
),
fastq_screen_config=lookup_config(
dpath="params/fair_fastqc_multiqc/fastq_screen/fastq_screen_config",
dpath="params/fair_fastqc_multiqc_fastq_screen/fastq_screen_config",
),
wrapper:
f"{snakemake_wrappers_prefix}/bio/fastq_screen"


use rule fair_fastqc_multiqc_fastq_screen_single_ended as fair_fastqc_multiqc_fastq_screen_pair_ended with:
input:
sample="tmp/fair_fastqc_multiqc/link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz",
sample="tmp/fair_fastqc_multiqc_link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz",
output:
txt=temp(
"tmp/fair_fastqc_multiqc/fastq_screen_pair_ended/{sample}.{stream}.fastq_screen.txt"
"tmp/fair_fastqc_multiqc_fastq_screen_pair_ended/{sample}.{stream}.fastq_screen.txt"
),
tmp="results/QC/fastq_screen/{sample}.{stream}.fastq_screen.png",
log:
"logs/fair_fastqc_multiqc/fastq_screen_pair_ended/{sample}.{stream}.log",
"logs/fair_fastqc_multiqc_fastq_screen_pair_ended/{sample}.{stream}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/fastq_screen_pair_ended/{sample}.{stream}.tsv"
"benchmark/fair_fastqc_multiqc_fastq_screen_pair_ended/{sample}.{stream}.tsv"
14 changes: 7 additions & 7 deletions workflow/rules/fastqc.smk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rule fair_fastqc_multiqc_fastqc_pair_ended:
input:
sample="tmp/fair_fastqc_multiqc/link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz",
sample="tmp/fair_fastqc_multiqc_link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz",
output:
html=report(
"results/QC/report_pe/{sample}.{stream}.html",
Expand All @@ -22,18 +22,18 @@ rule fair_fastqc_multiqc_fastqc_pair_ended:
* max(1, int(input.size_mb / 1024)),
tmpdir=tmp,
log:
"logs/fair_fastqc_multiqc/fastqc_pair_ended/{sample}.{stream}.log",
"logs/fair_fastqc_multiqc_fastqc_pair_ended/{sample}.{stream}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/fastqc_pair_ended/{sample}.{stream}.tsv"
"benchmark/fair_fastqc_multiqc_fastqc_pair_ended/{sample}.{stream}.tsv"
params:
extra=lookup_config(dpath="params/fair_fastqc_multiqc/fastqc", default=""),
extra=lookup_config(dpath="params/fair_fastqc_multiqc_fastqc", default=""),
wrapper:
f"{snakemake_wrappers_prefix}/bio/fastqc"


use rule fair_fastqc_multiqc_fastqc_pair_ended as fair_fastqc_multiqc_fastqc_single_ended with:
input:
sample="tmp/fair_fastqc_multiqc/link_or_concat_single_ended_input/{sample}.fastq.gz",
sample="tmp/fair_fastqc_multiqc_link_or_concat_single_ended_input/{sample}.fastq.gz",
output:
html=report(
"results/QC/report_pe/{sample}.html",
Expand All @@ -48,6 +48,6 @@ use rule fair_fastqc_multiqc_fastqc_pair_ended as fair_fastqc_multiqc_fastqc_sin
),
zip="results/QC/report_pe/{sample}_fastqc.zip",
log:
"logs/fair_fastqc_multiqc/fastqc_single_ended/{sample}.log",
"logs/fair_fastqc_multiqc_fastqc_single_ended/{sample}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/fastqc_single_ended/{sample}.tsv"
"benchmark/fair_fastqc_multiqc_fastqc_single_ended/{sample}.tsv"
48 changes: 25 additions & 23 deletions workflow/rules/multiqc.smk
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
rule fair_fastqc_multiqc_bigr_logo:
output:
"tmp/fair_fastqc_multiqc/bigr_logo.png",
"tmp/fair_fastqc_multiqc_bigr_logo.png",
threads: 1
resources:
mem_mb=lambda wildcards, attempt: attempt * 512,
runtime=lambda wildcards, attempt: attempt * 10,
tmpdir=tmp,
localrule: True
log:
"logs/fair_fastqc_multiqc/bigr_logo.log",
"logs/fair_fastqc_multiqc_bigr_logo/bigr_logo.log",
benchmark:
"benchmark/fair_fastqc_multiqc/bigr_logo.tsv"
"benchmark/fair_fastqc_multiqc_bigr_logo/bigr_logo.tsv"
params:
extra=lookup_config(
dpath="params/fair_fastqc_multiqc/wget", default="--verbose"
dpath="params/fair_genome_indexer_wget", default="--verbose"
),
address="https://raw.githubusercontent.com/tdayris/fair_fastqc_multiqc/main/images/bigr_logo.png",
conda:
Expand All @@ -24,22 +24,22 @@ rule fair_fastqc_multiqc_bigr_logo:

rule fair_fastqc_multiqc_multiqc_config:
input:
"tmp/fair_fastqc_multiqc/bigr_logo.png",
"tmp/fair_fastqc_multiqc_bigr_logo.png",
output:
temp("tmp/fair_fastqc_multiqc/multiqc_config.yaml"),
temp("tmp/fair_fastqc_multiqc_multiqc_config.yaml"),
threads: 1
resources:
mem_mb=lambda wildcards, attempt: attempt * 512,
runtime=lambda wildcards, attempt: attempt * 5,
tmpdir=tmp,
localrule: True
log:
"logs/fair_fastqc_multiqc/multiqc_config.log",
"logs/fair_fastqc_multiqc_multiqc_config.log",
benchmark:
"benchmark/fair_fastqc_multiqc/multiqc_config.tsv"
"benchmark/fair_fastqc_multiqc_multiqc_config.tsv"
params:
extra=lambda wildcards, input: lookup_config(
dpath="params/fair_fastqc_multiqc/multiqc/config",
dpath="params/fair_fastqc_multiqc_multiqc_config",
default={
"title": "Raw quality control report",
"subtitle": "Produced on raw fastq recieved from sequencer",
Expand Down Expand Up @@ -67,12 +67,14 @@ rule fair_fastqc_multiqc_multiqc_config:
"Quality controls": {
"fastqc": "1.12.1",
"fastq_screen": "0.15.3",
"bowtie2": "1.3.1",
"multiqc": "1.20.0",
"bowtie2": "2.5.3",
"bowtie1": "1.3.1",
"multiqc": "1.21.0",
},
"Pipeline": {
"snakemake": "8.5.3",
"fair_fastqc_multiqc": "2.1.0",
"snakemake-wrappers-utils": "0.6.2",
"fair_fastqc_multiqc": "2.2.8",
},
},
"disable_version_detection": True,
Expand All @@ -82,8 +84,8 @@ rule fair_fastqc_multiqc_multiqc_config:
],
"report_section_order": {
"fastqc": {"order": 1000},
"fastq_screen": {"before": "fastqc"},
"software_versions": {"before": "fastq_screen"},
"fastq_screen": {"order": "900"},
"software_versions": {"order": "800"},
},
},
),
Expand All @@ -106,7 +108,7 @@ rule fair_fastqc_multiqc_multiqc_report:
),
fastq_screen_single_ended=branch(
lookup_config(
dpath="params/fair_fastqc_multiqc/fastq_screen/fastq_screen_config"
dpath="params/fair_fastqc_multiqc_fastq_screen/fastq_screen_config"
),
then=collect(
"tmp/fair_fastqc_multiqc/fastq_screen_single_ended/{single_ended_data.sample_id}.fastq_screen.txt",
Expand All @@ -116,17 +118,17 @@ rule fair_fastqc_multiqc_multiqc_report:
),
fastq_screen_pair_ended=branch(
lookup_config(
dpath="params/fair_fastqc_multiqc/fastq_screen/fastq_screen_config"
dpath="params/fair_fastqc_multiqc_fastq_screen/fastq_screen_config"
),
then=collect(
"tmp/fair_fastqc_multiqc/fastq_screen_pair_ended/{pair_ended_data.sample_id}.{stream}.fastq_screen.txt",
"tmp/fair_fastqc_multiqc_fastq_screen_pair_ended/{pair_ended_data.sample_id}.{stream}.fastq_screen.txt",
pair_ended_data=get_pair_ended_samples(),
stream=stream_list,
),
otherwise=[],
),
config="tmp/fair_fastqc_multiqc/multiqc_config.yaml",
logo="tmp/fair_fastqc_multiqc/bigr_logo.png",
config="tmp/fair_fastqc_multiqc_multiqc_config.yaml",
logo="tmp/fair_fastqc_multiqc_bigr_logo.png",
output:
report(
"results/QC/MultiQC_FastQC.html",
Expand All @@ -148,16 +150,16 @@ rule fair_fastqc_multiqc_multiqc_report:
tmpdir=tmp,
params:
extra=lookup_config(
dpath="params/fair_fastqc_multiqc/multiqc/extra",
dpath="params/fair_fastqc_multiqc_multiqc/extra",
default="--verbose --no-megaqc-upload --no-ansi --force",
),
use_input_files_only=lookup_config(
dpath="params/fair_fastqc_multiqc/multiqc/use_input_file_only",
dpath="params/fair_fastqc_multiqc_multiqc/use_input_file_only",
default=True,
),
log:
"logs/fair_fastqc_multiqc/multiqc_report.log",
"logs/fair_fastqc_multiqc_multiqc_report.log",
benchmark:
"benchmark/fair_fastqc_multiqc/multiqc_report.tsv"
"benchmark/fair_fastqc_multiqc_multiqc_report.tsv"
wrapper:
f"{snakemake_wrappers_prefix}/bio/multiqc"
12 changes: 6 additions & 6 deletions workflow/rules/prepare_input.smk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rule fair_fastqc_multiqc_link_or_concat_single_ended_input:
output:
temp(
"tmp/fair_fastqc_multiqc/link_or_concat_single_ended_input/{sample}.fastq.gz"
"tmp/fair_fastqc_multiqc_link_or_concat_single_ended_input/{sample}.fastq.gz"
),
threads: 1
resources:
Expand All @@ -11,9 +11,9 @@ rule fair_fastqc_multiqc_link_or_concat_single_ended_input:
* 15,
tmpdir=tmp,
log:
"logs/fair_fastqc_multiqc/link_or_concat_single_ended_input/{sample}.log",
"logs/fair_fastqc_multiqc_link_or_concat_single_ended_input/{sample}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/link_or_concat_single_ended_input/{sample}.tsv"
"benchmark/fair_fastqc_multiqc_link_or_concat_single_ended_input/{sample}.tsv"
params:
in_files=collect(
"{sample.upstream_file}",
Expand All @@ -31,12 +31,12 @@ rule fair_fastqc_multiqc_link_or_concat_single_ended_input:
use rule fair_fastqc_multiqc_link_or_concat_single_ended_input as fair_fastqc_multiqc_link_or_concat_pair_ended_input with:
output:
temp(
"tmp/fair_fastqc_multiqc/link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz"
"tmp/fair_fastqc_multiqc_link_or_concat_pair_ended_input/{sample}.{stream}.fastq.gz"
),
log:
"logs/fair_fastqc_multiqc/link_or_concat_pair_ended_input/{sample}.{stream}.log",
"logs/fair_fastqc_multiqc_link_or_concat_pair_ended_input/{sample}.{stream}.log",
benchmark:
"benchmark/fair_fastqc_multiqc/link_or_concat_pair_ended_input/{sample}.{stream}.tsv"
"benchmark/fair_fastqc_multiqc_link_or_concat_pair_ended_input/{sample}.{stream}.tsv"
params:
in_files=branch(
evaluate("{stream} == '1'"),
Expand Down
Loading

0 comments on commit 5c6ece9

Please sign in to comment.