Skip to content

Commit

Permalink
Update snakemake to 8.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmar-van-den-Berg committed Oct 24, 2024
1 parent 78dd35b commit 86d3ddb
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
**********
v2.2.0-dev
**********
* Update snakemake to version 8.23. **Important: re-build the conda environment**

**********
v2.1.1
Expand Down
34 changes: 18 additions & 16 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ rule create_summary:
fusion_json=fusion.module_output.json,
snv_indels_json=align.module_output.json,
itd_json=itd.module_output.json,
scr=srcdir("scripts/create_summary.py"),
scr=workflow.source_path("scripts/create_summary.py"),
params:
pipeline_ver=PIPELINE_VERSION,
output:
Expand All @@ -154,11 +154,12 @@ rule generate_report:
"""Generates a PDF report of the essential results."""
input:
summary=rules.create_summary.output.js,
css=srcdir("report/assets/style.css"),
templates=srcdir("report/templates"),
imgs=srcdir("report/assets/img"),
toc=srcdir("report/assets/toc.xsl"),
scr=srcdir("scripts/generate_report.py"),
css=workflow.source_path("report/assets/style.css"),
toc=workflow.source_path("report/assets/toc.xsl"),
scr=workflow.source_path("scripts/generate_report.py"),
params:
templates="report/templates",
imgs="report/assets/img",
output:
"{sample}/hamlet_report.{sample}.pdf",
log:
Expand All @@ -168,8 +169,8 @@ rule generate_report:
shell:
"""
python3 {input.scr} \
--templates-dir {input.templates} \
--imgs-dir {input.imgs} \
--templates-dir {params.templates} \
--imgs-dir {params.imgs} \
--css-path {input.css} \
--toc-path {input.toc} \
{input.summary} \
Expand All @@ -181,11 +182,12 @@ rule generate_html_report:
"""Generates a HTML report of the essential results, used for testing only"""
input:
summary=rules.create_summary.output.js,
css=srcdir("report/assets/style.css"),
templates=srcdir("report/templates"),
imgs=srcdir("report/assets/img"),
toc=srcdir("report/assets/toc.xsl"),
scr=srcdir("scripts/generate_report.py"),
css=workflow.source_path("report/assets/style.css"),
toc=workflow.source_path("report/assets/toc.xsl"),
scr=workflow.source_path("scripts/generate_report.py"),
params:
templates="report/templates",
imgs="report/assets/img",
output:
"{sample}/hamlet_report.{sample}.html",
log:
Expand All @@ -195,8 +197,8 @@ rule generate_html_report:
shell:
"""
python3 {input.scr} \
--templates-dir {input.templates} \
--imgs-dir {input.imgs} \
--templates-dir {params.templates} \
--imgs-dir {params.imgs} \
--css-path {input.css} \
--toc-path {input.toc} \
{input.summary} \
Expand All @@ -208,7 +210,7 @@ rule multiqc:
input:
qc_stats=qc_seq.module_output.multiqc_files,
snv_indel_stats=align.module_output.multiqc_files,
config=srcdir("cfg/multiqc.yml"),
config=workflow.source_path("cfg/multiqc.yml"),
params:
filelist="multiqc_filelist.txt",
depth=2,
Expand Down
15 changes: 7 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ channels:
- bioconda
- conda-forge
dependencies:
- bs4=4.11
- peppy>=0.35
- pytest-workflow>=1.6.0
- snakemake-minimal=7.32
- snakefmt=0.10.0
- black=24.3.0
- sphinx=7.1.2
- sphinx-rtd-theme
- bs4=4.12
- peppy=0.40.7
- pytest-workflow=2.1.0
- snakemake-minimal=8.24.1
- snakefmt=0.10.2
- sphinx=8.1.3
- sphinx-rtd-theme=3.0.0
5 changes: 3 additions & 2 deletions includes/expression/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ rule bed_coverage:
input:
bam=get_bam,
bed=config["bed"],
src=srcdir("scripts/coverage.py"),
src=workflow.source_path("scripts/coverage.py"),
gtf_file=workflow.source_path("scripts/gtf.py"),
output:
coverage="{sample}/expression/coverage.csv",
log:
Expand All @@ -35,7 +36,7 @@ rule normalized_coverage:
coverage=rules.bed_coverage.output.coverage,
counts=get_counts,
gtf=config["gtf"],
src=srcdir("scripts/expression.py"),
src=workflow.source_path("scripts/expression.py"),
params:
strand=get_strand,
housekeeping=config["housekeeping"],
Expand Down
12 changes: 6 additions & 6 deletions includes/fusion/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ rule arriba:
rule filter_fusions:
input:
fusions="{sample}/fusion/arriba/fusions.raw.tsv",
to_json=srcdir("scripts/arriba2json.py"),
to_tsv=srcdir("scripts/json2arriba.py"),
to_json=workflow.source_path("scripts/arriba2json.py"),
to_tsv=workflow.source_path("scripts/json2arriba.py"),
report_genes=config["report_genes"],
output:
json="{sample}/fusion/arriba/fusions.json",
Expand All @@ -54,8 +54,8 @@ rule filter_fusions:
containers["arriba"]
shell:
"""
{input.to_json} {input.fusions} --report-genes {input.report_genes} > {output.json} 2> {log}
{input.to_tsv} {output.json} > {output.tsv} 2>> {log}
python3 {input.to_json} {input.fusions} --report-genes {input.report_genes} > {output.json} 2> {log}
python3 {input.to_tsv} {output.json} > {output.tsv} 2>> {log}
"""


Expand Down Expand Up @@ -109,7 +109,7 @@ rule json_output:
input:
json="{sample}/fusion/arriba/fusions.json",
plots="{sample}/fusion/arriba/plots",
src=srcdir("scripts/json-output.py"),
src=workflow.source_path("scripts/json-output.py"),
output:
json="{sample}/fusion/fusion-output.json",
log:
Expand All @@ -119,5 +119,5 @@ rule json_output:
containers["arriba"]
shell:
"""
{input.src} {input.json} {input.plots} > {output} 2> {log}
python3 {input.src} {input.json} {input.plots} > {output} 2> {log}
"""
2 changes: 1 addition & 1 deletion includes/itd/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ rule json_output:
flt3_plot="{sample}/itd/{sample}.flt3.png",
kmt2a_csv="{sample}/itd/{sample}.kmt2a.csv",
kmt2a_plot="{sample}/itd/{sample}.kmt2a.png",
src=srcdir("scripts/json-output.py"),
src=workflow.source_path("scripts/json-output.py"),
output:
"{sample}/itd/itd-output.json",
log:
Expand Down
2 changes: 1 addition & 1 deletion includes/qc-seq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ rule sequali:
rule multiqc:
input:
stats=module_output.multiqc_files,
config=srcdir("../../cfg/multiqc.yml"),
config=workflow.source_path("../../cfg/multiqc.yml"),
params:
filelist="multiqc_filelist.txt",
depth=2,
Expand Down
8 changes: 4 additions & 4 deletions includes/snv-indels/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ rule exon_cov:
bed=".tmp.exon_cov_ref.bed",
genome=".tmp.genome.txt",
idm=config["ref_id_mapping"],
scr=srcdir("scripts/aggr_exon_cov.py"),
scr=workflow.source_path("scripts/aggr_exon_cov.py"),
output:
json="{sample}/snv-indels/{sample}.exon_cov_stats.json",
log:
Expand Down Expand Up @@ -376,7 +376,7 @@ rule filter_vep:
vep="{sample}/snv-indels/{sample}.vep.txt.gz",
ref_id_mapping=config["ref_id_mapping"],
hotspots="{sample}/snv-indels/{sample}.hotspot.vcf",
scr=srcdir("scripts/filter_vep.py"),
scr=workflow.source_path("scripts/filter_vep.py"),
blacklist=config.get("blacklist", []),
params:
vep_consequences=config["vep_include_consequence"],
Expand Down Expand Up @@ -413,7 +413,7 @@ rule json_output:
insert_stats="{sample}/snv-indels/{sample}.insert_stats",
exon_cov_stats="{sample}/snv-indels/{sample}.exon_cov_stats.json",
vep_stats="{sample}/snv-indels/{sample}.vep_stats.txt",
src=srcdir("scripts/json-output.py"),
src=workflow.source_path("scripts/json-output.py"),
output:
"{sample}/snv-indels/snv-indels-output.json",
log:
Expand All @@ -436,7 +436,7 @@ rule json_output:
rule multiqc:
input:
stats=module_output.multiqc_files,
config=srcdir("../../cfg/multiqc.yml"),
config=workflow.source_path("../../cfg/multiqc.yml"),
params:
filelist="multiqc_filelist.txt",
depth=2,
Expand Down
4 changes: 1 addition & 3 deletions test/test_utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
command: >
snakemake -n
--snakefile utilities/deps/Snakefile
--reason
--printshellcmds
--verbose
--workflow-profile test
stdout:
contains:
- rule create_call_region
16 changes: 8 additions & 8 deletions utilities/deps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ rule rewrite_gtf:
""" Add the 'chr' prefix to the chromosome names """
input:
gtf=rules.download_gtf.output,
rewrite=srcdir("scripts/rewrite-gtf.py"),
rewrite=workflow.source_path("scripts/rewrite-gtf.py"),
output:
gtf=gtf_renamed,
singularity:
Expand Down Expand Up @@ -171,7 +171,7 @@ rule create_refflat:
rule rewrite_refflat:
input:
gtf=rules.create_refflat.output,
scr=srcdir("scripts/rewrite-refflat.py"),
scr=workflow.source_path("scripts/rewrite-refflat.py"),
output:
"ucsc_gencode.refFlat",
singularity:
Expand All @@ -184,7 +184,7 @@ rule rewrite_refflat:

rule create_id_mappings:
input:
srcdir("small-files/id_mappings.tsv"),
workflow.source_path("small-files/id_mappings.tsv"),
output:
"id_mappings.tsv",
singularity:
Expand All @@ -197,7 +197,7 @@ rule create_id_mappings:

rule create_blacklist:
input:
srcdir("small-files/blacklist.txt"),
workflow.source_path("small-files/blacklist.txt"),
output:
"blacklist.txt",
singularity:
Expand All @@ -210,7 +210,7 @@ rule create_blacklist:

rule create_call_region:
input:
srcdir("small-files/call_regions.bed"),
workflow.source_path("small-files/call_regions.bed"),
output:
"call_regions.bed",
singularity:
Expand Down Expand Up @@ -252,7 +252,7 @@ rule create_rRNA_refflat:

rule genome_hotspots:
input:
srcdir("small-files/hotspots_genome.bed"),
workflow.source_path("small-files/hotspots_genome.bed"),
output:
"hotspots_genome.bed",
singularity:
Expand All @@ -266,7 +266,7 @@ rule genome_hotspots:
rule create_report_genes:
input:
folder="arriba",
genes=srcdir("small-files/report_genes.txt"),
genes=workflow.source_path("small-files/report_genes.txt"),
output:
"arriba/report_genes.txt",
singularity:
Expand Down Expand Up @@ -307,7 +307,7 @@ rule unpack_vep_cache:
rule copy_itd:
"""All the needed files are in small-files/itd, so we just copy them"""
input:
fasta=srcdir("small-files/itd/itd_genes.fa"),
fasta=workflow.source_path("small-files/itd/itd_genes.fa"),
output:
itd=directory("itd"),
singularity:
Expand Down

0 comments on commit 86d3ddb

Please sign in to comment.