Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
50ad636
feat: Add alignoth_report meta-wrapper
fxwiegand Oct 28, 2025
f1a2d96
Refactor alignoth_report workflow for VCF.gz input and table handling
fxwiegand Oct 28, 2025
c1372e9
Use dynamic coverage path in datavzrd template
fxwiegand Oct 28, 2025
ae08dd8
Merge branch 'master' into alignoth-report
fxwiegand Oct 28, 2025
efe86a8
change format
FelixMoelder Oct 28, 2025
30b22ef
add linkouts
FelixMoelder Oct 28, 2025
f87660c
fixed linkout
FelixMoelder Oct 28, 2025
8c3f917
Add default view and adjust visibility settings in datavzrd template
FelixMoelder Oct 28, 2025
589ca1c
Add pills plot for REF and ALT columns in template yaml
fxwiegand Oct 28, 2025
73474c4
Nest plot settings under pills for REF and ALT
fxwiegand Oct 28, 2025
13d92f7
Update alignoth rules to use BCF format and remove VCF files
FelixMoelder Oct 28, 2025
8153920
Add highlight dataset and view to datavzrd template
fxwiegand Oct 28, 2025
d86cefb
Merge branch 'master' into alignoth-report
fxwiegand Oct 29, 2025
706c152
Rename input parameter 'csi' to 'idx'
fxwiegand Oct 29, 2025
ff1639b
fix: set path_var
FelixMoelder Oct 29, 2025
7f0cdb8
Update template.datavzrd.yaml configuration
fxwiegand Oct 30, 2025
3b22008
disable linting for now
johanneskoester Oct 30, 2025
60923ac
Merge branch 'alignoth-report' of github.com:snakemake/snakemake-wrap…
johanneskoester Oct 30, 2025
4a165b9
Use --around-vcf-record
fxwiegand Oct 30, 2025
9d2b65e
prepare autobumping and set versions to the latest ones for now.
johanneskoester Oct 31, 2025
147ad2f
Merge branch 'master' into alignoth-report
fxwiegand Oct 31, 2025
0cea9a9
do not use wrapper prefix for meta-wrappers
johanneskoester Oct 31, 2025
5dd1f75
Merge branch 'alignoth-report' of github.com:snakemake/snakemake-wrap…
johanneskoester Oct 31, 2025
928c136
update all meta-wrappers to concrete wrapper versions (otherwise, the…
johanneskoester Oct 31, 2025
23b45e6
re-enable linting, but for the right files
johanneskoester Oct 31, 2025
977d157
comment
johanneskoester Oct 31, 2025
9bfc274
fix linting
johanneskoester Oct 31, 2025
b197187
fix: Add required alignment and reference index files
fxwiegand Nov 2, 2025
823146d
Update wrapper paths to use specific commit hashes (temporaray)
fxwiegand Nov 2, 2025
0f04ba8
Reorder columns in vembrane table output
fxwiegand Nov 3, 2025
779ba29
Update labels for SAMPLE, CHROM, POS, REF, and ALT
fxwiegand Nov 3, 2025
ea7f2a5
Merge branch 'master' into alignoth-report
fxwiegand Nov 3, 2025
13b9176
Update wrappers to version 7.9.1
fxwiegand Nov 4, 2025
f921508
try using relative paths in test snakefile and git path in wrapper pr…
johanneskoester Nov 4, 2025
204814c
Merge branch 'alignoth-report' of github.com:snakemake/snakemake-wrap…
johanneskoester Nov 4, 2025
ce6df8a
Move alignoth helper functions to common.smk
fxwiegand Nov 4, 2025
fd8b6b8
Remove unused pandas import
fxwiegand Nov 4, 2025
5900daf
remove breakpoint
johanneskoester Nov 5, 2025
bbef664
Merge branch 'alignoth-report' of github.com:snakemake/snakemake-wrap…
johanneskoester Nov 5, 2025
bae161f
start wrapper linting from the test snakefile
johanneskoester Nov 6, 2025
a1df503
fixes
johanneskoester Nov 6, 2025
24019a5
move functions into the meta wrapper itself (linter needs to be updated)
johanneskoester Nov 6, 2025
ebc924a
fix
johanneskoester Nov 7, 2025
5b793d2
fix
johanneskoester Nov 7, 2025
9707385
fixes
johanneskoester Nov 7, 2025
9285259
fix qc
johanneskoester Nov 10, 2025
4847c28
do not fail on linting errors in meta-wrappers for now
johanneskoester Nov 10, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/autobump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ jobs:
with:
subcommand: update-conda-envs
args: "*/${{ matrix.prefix }}*/environment.yaml */${{ matrix.prefix }}*/*/environment.yaml --create-prs --warn-on-error --entity-regex '(?P<entity>.+)/environment.yaml' --pr-add-label --pin-envs"


# TODO add snakedeploy update-wrappers command applied to all meta-wrappers once it has the --create-prs option
12 changes: 8 additions & 4 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ jobs:
run: |
declare -i ERRORS=0
# get all modified and added files, not those that are deleted
for f in $(git diff origin/master --name-only --diff-filter=d | grep Snakefile)
for f in $(git diff origin/master --name-only --diff-filter=d | grep -P "(test/Snakefile|meta_wrapper.smk)")
do
echo "Linting $f"
(cd $(dirname $f) && snakemake --lint)
ERRORS+=$?
# lint meta_wrapper.smk and test/Snakefile of normal wrappers
if [[ $f == meta/**/meta_wrapper.smk || $f != meta/**/test/Snakefile ]]
then
echo "Linting $f"
(cd $(dirname $f) && snakemake --lint --snakefile $(basename $f))
ERRORS+=$?
fi
done
if (( $ERRORS > 0 ))
then
Expand Down
5 changes: 5 additions & 0 deletions meta/bio/alignoth_report/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: alignoth_report
description: Export variants via vembrane and create alignment plots with alignoth for a Datavzrd report.
authors:
- Felix Wiegand
- Felix Mölder
61 changes: 61 additions & 0 deletions meta/bio/alignoth_report/meta_wrapper.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import pandas as pd

checkpoint vembrane_table:
input:
"<results>/{sample}.bcf",
output:
"<results>/tables/{sample}.tsv"
log:
"<logs>/vembrane_table/{sample}.log"
params:
expression="INDEX, CHROM, POS, REF, ALT",
extra=""
wrapper:
"v7.6.1/bio/vembrane/table"


rule alignoth:
input:
bam="<results>/mapped/{sample}.bam",
bam_idx="<results>/mapped/{sample}.bam.bai",
reference="resources/genome.fa",
reference_idx="resources/genome.fa.fai",
vcf="<results>/{sample}.bcf",
vcf_idx="<results>/{sample}.bcf.csi",
overview="<results>/tables/{sample}.tsv"
output:
directory("<results>/alignoth/{sample}/{index}/")
params:
extra=lambda wc, input: f"--around-vcf-record {wc.index} -f tsv"
log:
"<logs>/alignoth/{sample}_{index}.log"
wrapper:
"v7.9.1/bio/alignoth"


rule datavzrd:
input:
config=workflow.source_path("resources/template.datavzrd.yaml"),
overview="<results>/tables/{sample}.tsv",
plot_tables=lambda wc: get_alignoth_tables(wc, "<results>")
output:
report(
directory("<results>/datavzrd-report/{sample}"),
htmlindex="index.html",
),
# config = "resources/datavzrd/{sample}.rendered_config.yaml"
params:
max_index=lambda wc: count_variants(wc)
log:
"<logs>/datavzrd/{sample}.log",
wrapper:
"v7.9.1/utils/datavzrd"


def get_alignoth_tables(wildcards, results_dir):
count = count_variants(wildcards)
return [f"{results_dir}/alignoth/{{sample}}/{i}/" for i in range(count)]


def count_variants(wildcards):
return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Address linting failure: convert count_variants to lambda.

The linting error indicates that small one-liner functions should be defined as lambda expressions. The count_variants function is a good candidate for this conversion.

Apply this diff:

-def count_variants(wildcards):
-    return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
+count_variants = lambda wildcards: sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1

This will resolve the linting error reported in the pipeline failure: "Mixed rules and functions in same snakefile. Small one-liner functions should be defined as lambda."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def get_alignoth_tables(wildcards, results_dir):
count = count_variants(wildcards)
return [f"{results_dir}/alignoth/{{sample}}/{i}/" for i in range(count)]
def count_variants(wildcards):
return sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
def get_alignoth_tables(wildcards, results_dir):
count = count_variants(wildcards)
return [f"{results_dir}/alignoth/{{sample}}/{i}/" for i in range(count)]
count_variants = lambda wildcards: sum(1 for _ in open(checkpoints.vembrane_table.get(sample=wildcards.sample).output[0], "r")) - 1
🤖 Prompt for AI Agents
In meta/bio/alignoth_report/meta_wrapper.smk around lines 55 to 61, replace the
one-line def count_variants(wildcards): ... with a lambda assigned to the name
count_variants to satisfy the linter; specifically, change the function
definition into a single-line assignment using lambda that accepts wildcards and
returns the same sum expression, leaving get_alignoth_tables unchanged so it
continues to call count_variants(wildcards).

56 changes: 56 additions & 0 deletions meta/bio/alignoth_report/resources/template.datavzrd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
__use_yte__: true

default-view: variants

datasets:
variants:
path: ?input.overview
separator: "\t"
links:
alignment plot:
column: INDEX
view: "{value}"
?for i in range(params.max_index):
?f"{i}.coverage":
path: ?f"{input.plot_tables[i]}/{wildcards.sample}.coverage.tsv"
separator: "\t"
?f"{i}.reference":
path: ?f"{input.plot_tables[i]}/{wildcards.sample}.reference.tsv"
separator: "\t"
?f"{i}.reads":
path: ?f"{input.plot_tables[i]}/{wildcards.sample}.reads.tsv"
separator: "\t"
?f"{i}.highlight":
path: ?f"{input.plot_tables[i]}/{wildcards.sample}.highlight.tsv"
separator: "\t"
views:
variants:
dataset: variants
render-table:
columns:
SAMPLE:
label: sample
CHROM:
label: chromosome
POS:
label: position
INDEX:
display-mode: hidden
REF:
label: reference allele
spell:
url: v1.5.0/med/alleles
ALT:
label: alternative allele
spell:
url: v1.5.0/med/alleles
?for i in range(params.max_index):
?i:
hidden: true
datasets:
reads: ?f"{i}.reads"
reference: ?f"{i}.reference"
coverage: ?f"{i}.coverage"
highlight: ?f"{i}.highlight"
render-plot:
spec-path: ?f"{input.plot_tables[i]}/{wildcards.sample}.vl.json"
8 changes: 8 additions & 0 deletions meta/bio/alignoth_report/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from snakemake.utils import min_version

min_version("9.13.1")

module alignoth_report:
meta_wrapper: "file:../master/meta/bio/alignoth_report"

use rule * from alignoth_report
2 changes: 2 additions & 0 deletions meta/bio/alignoth_report/test/resources/genome.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>1
TGTGCACCCAGGCTAATTAATGTTCATGGGAACTAATTAGAGCTGACATGTACAGCCAGCCTTTTGCTTACTCTGCGGGATCTTGTTCTGTGTGATTTCTCTAGGGGGAGCCTGCTCACTTTGAGTATTTGATGTATCCATTGCACTCAGCACCCATCACCGGTCTAGCTACCTGCATCCGCAAACCCCTTATAGCCACCTGTTCTCTGGATCGATCCATCCGCCTTTGGAATTATGAAACAAAGTAAGGAATGAAAGGCTTGCCTACTTTATTATGCAAGACCCCAGTTGTGAATTTATGTGAATTATTTTAATTACAGTGTTCCAAACTTTAATTATTTAGAAGCTTTCAGTTGGAAAAGATTTTTAAAAAATCAAGTCAGTCAACCTACCTGTTTCTCACTCTTGCGTGGGCTAGAAAACTACTTTGTGGTTTATTTAATGCTTACCACATGCTAGACACTGGGGACATGAAGAGATGAAGACAACACCTCAGTCTCTCACCTTCTTACATAAACTCCTGGGTCCCTCCAGCTCTCCTATCCCCTTGTTTCCCACAGGAACTGCTCTTTGCTTCAGGGAGCTCTCCAGACCCTTTCTTCCTCATCTTTCTCCCAGGACATCACTATCTCAACCACCCCCAACTCCCTCCTGACTTTACCTTCCAGCACAGCTTCCCTGGGAAGCTCCAACCCTAGGTGGACCCCCACCCCCTACTGTTTTCTTTGTTCTTATGTACAACTTCTGGGGCTTCTGGGGAAAAAATACTTGGACAATACTCATGAATTTTGGAATATAAACAGAGCTATGTCTTCAGCATCGCTAGACCACACCTTGACCAGTCTCCCTATCTACCATGCTCCACGCTGGACATTATCCCCTAATAACCAAGATCTAGAAAAGAGAGGAACCAACAATTGCAAACAGTAGTGTGTCTCAAATACGATGATAACAATATATATCAGATACAGTAGATGACTGGAAGGATTTAGTGAGCTAAGCTTACAATTCAGTAATTGATCTTTTTCACAGCACCCTGGAACTATTTAAGGAATACCAAGAAGAGGCATATTCCATCAGCCTTCATCCATCTGGACACTTCATTGTAGTAGGGTTTGCTGACAAACTACGCCTCATGAATCTACTCATTGATGATATACGTTCTTTCAAAGAATACTCTGTTAGAGGATGCGGAGAGGTAAAAAAAAAACTGCTGAAGACAAAAGTCCAGTTTCTTAGAAAGCCACGGCTGAAATATCAGGAACTAACATGATCTGGGGAGGTGGGACCAAAATCTGTCTTGGAGAACTACAGTGGCTTAAAAAAAGGGGGAAGGAGGAAATCCAGTTATTTTCCCAGCAACCTTATTGAGTATATGGTTCCATCCCCATATTCTTATGTCCACCAGACTATTTCATTGAACCTAAAACCTTGTGAGATCCCCGCTATGATAAGTCCTGTCTGTAATTGTGGAATATTAACAAATATTTTAAAAGAAAAGTAATCTCAGAATCAGAGTCACAGCTAAGAAGGTGAGGTTGGAGACGGAGGAGCCAGGGAAAAATAAGCATCAATGGTGAGAGGTAATAAAGAGCGCATCAGCTTTCCCTGAGGTGTCTTGCAGAAACAAGGCAATGATTTCAGGAATTACTTCCCCGGCTCTGAAACATGCTTCTACAGGCAAAATGATTGCTTGTGGTCCCAACGGCTTAATGATTTGTGGGCCTGACAGTGTCAGCATCTGGCCACTATGAGTTACAGGAATAATGAAAGTGTCTGAAAATGTCAGCCACTCCTCAGTCTCATTTGCACCTTCCCCCCACTCCCACCCTCACACGTAGTTTCAGTCTGAACTCGTTGGGAAAAGCACCTCTTGACTGTAACCTCTAATTAGACTGCTCACTTCCTGCTTGCTTGCTCTCTTGCTGTCTTTCCCTATAGTGTTCCTTTAGCAATGGAGGTCACCTGTTTGCTGCAGTCAATGGAAATGTGATTCACGTTTACACCACCACGAGCCTAGAGAACATCTCAAGCCTGAAAGGACACACAGGGAAGGTAAGTGAGTGAACAGTCTCTGGGGAAACAAGGGGCACGGAGCCAAGTATGCCGCCAGCCAGTGGGATACAGGTGAACAAAAGAGAGATGGTTCCTTTCCTCATGGGTTCACTGTCTACTTGGGGAAAGAGACAATAAAACAAATGCACAGACAAATGTAGTTACTAATTGCAGTTCCACTGAAAGAAAAACATGGTGTTGTTGTGAGAGAAATAATGAAGGGGGCGGCATAATTTAGGTGGCTGTATTTGCAAAGGCTTGGTCCTATAAGAGTGAGTAGGAGTTAATCAGACACAACTGGTGGGGATAATCACTGCAGATAGGGATCCAAAGGCCAGAGATGGGAGACTCATAGG
1 change: 1 addition & 0 deletions meta/bio/alignoth_report/test/resources/genome.fa.fai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2411 3 2411 2412
Binary file added meta/bio/alignoth_report/test/results/NA12878.bcf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions meta/bio/alignoth_report/used_wrappers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wrappers:
- bio/vembrane/table
- bio/alignoth
- utils/datavzrd
12 changes: 6 additions & 6 deletions meta/bio/bowtie2_sambamba/meta_wrapper.smk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule bowtie2_build:
extra="",
threads: 8
wrapper:
"master/bio/bowtie2/build"
"v3.11.0/bio/bowtie2/build"


rule bowtie2_alignment:
Expand All @@ -43,7 +43,7 @@ rule bowtie2_alignment:
),
threads: 8
wrapper:
"master/bio/bowtie2/align"
"v7.6.0/bio/bowtie2/align"


rule sambamba_sort:
Expand All @@ -57,7 +57,7 @@ rule sambamba_sort:
"<logs>/sambamba-sort/{sample}.log",
threads: 8
wrapper:
"master/bio/sambamba/sort"
"v3.11.0/bio/sambamba/sort"


rule sambamba_view:
Expand All @@ -74,7 +74,7 @@ rule sambamba_view:
"logs/sambamba-view/{sample}.log",
threads: 8
wrapper:
"master/bio/sambamba/view"
"v6.1.0/bio/sambamba/view"


rule sambamba_markdup:
Expand All @@ -88,7 +88,7 @@ rule sambamba_markdup:
"<logs>/sambamba-markdup/{sample}.log",
threads: 8
wrapper:
"master/bio/sambamba/markdup"
"v6.1.0/bio/sambamba/markdup"


rule sambamba_index:
Expand All @@ -102,4 +102,4 @@ rule sambamba_index:
"<logs>/sambamba-index/{sample}.log",
threads: 8
wrapper:
"master/bio/sambamba/index"
"v6.1.0/bio/sambamba/index"
2 changes: 1 addition & 1 deletion meta/bio/bowtie2_sambamba/test/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ min_version("9.13.1")
configfile: "config.yaml"

module bowtie2_sambamba:
meta_wrapper: "master/meta/bio/bowtie2_sambamba"
meta_wrapper: "file:../master/meta/bio/bowtie2_sambamba"
config: config

use rule * from bowtie2_sambamba
6 changes: 3 additions & 3 deletions meta/bio/bwa_mapping/meta_wrapper.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule bwa_index:
log:
"<logs>/bwa_index.log",
wrapper:
"master/bio/bwa/index"
"v5.10.0/bio/bwa/index"


rule bwa_mem:
Expand All @@ -24,7 +24,7 @@ rule bwa_mem:
sort_extra="" # Extra args for samtools/picard.
threads: 8
wrapper:
"master/bio/bwa/mem"
"v7.6.0/bio/bwa/mem"


rule samtools_index:
Expand All @@ -37,4 +37,4 @@ rule samtools_index:
params:
"" # optional params string
wrapper:
"master/bio/samtools/index"
"v7.3.0/bio/samtools/index"
2 changes: 1 addition & 1 deletion meta/bio/bwa_mapping/test/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ min_version("9.13.1")
configfile: "config.yaml"

module bwa_mapping:
meta_wrapper: "master/meta/bio/bwa_mapping"
meta_wrapper: "file:../master/meta/bio/bwa_mapping"
config: config

use rule * from bwa_mapping
12 changes: 6 additions & 6 deletions meta/bio/calc_consensus_reads/meta_wrapper.smk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule calc_consensus_reads:
log:
"<logs>/consensus/{sample}.log",
wrapper:
"master/bio/rbt/collapse_reads_to_fragments-bam"
"v3.9.0/bio/rbt/collapse_reads_to_fragments-bam"


rule bwa_index:
Expand All @@ -28,7 +28,7 @@ rule bwa_index:
log:
"<logs>/bwa_index.log",
wrapper:
"master/bio/bwa/index"
"v5.10.0/bio/bwa/index"


rule map_consensus_reads:
Expand All @@ -52,7 +52,7 @@ rule map_consensus_reads:
"<logs>/bwa_mem/{sample}.{read_type}.consensus.log",
threads: 8
wrapper:
"master/bio/bwa/mem"
"v7.6.0/bio/bwa/mem"


rule sort_skipped_reads:
Expand All @@ -68,7 +68,7 @@ rule sort_skipped_reads:
# Samtools takes additional threads through its option -@
threads: 8 # This value - 1 will be sent to -@.
wrapper:
"master/bio/samtools/sort"
"v7.6.0/bio/samtools/sort"


rule mark_duplicates_skipped:
Expand All @@ -88,7 +88,7 @@ rule mark_duplicates_skipped:
resources:
mem_mb=1024,
wrapper:
"master/bio/picard/markduplicates"
"v7.6.0/bio/picard/markduplicates"


rule merge_consensus_reads:
Expand All @@ -102,4 +102,4 @@ rule merge_consensus_reads:
"<logs>/samtools_merge/{sample}.log",
threads: 8
wrapper:
"master/bio/samtools/merge"
"v7.6.0/bio/samtools/merge"
2 changes: 1 addition & 1 deletion meta/bio/calc_consensus_reads/test/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ min_version("9.13.1")
configfile: "config.yaml"

module calc_consensus_reads:
meta_wrapper: "master/meta/bio/calc_consensus_reads"
meta_wrapper: "file:../master/meta/bio/calc_consensus_reads"
config: config

use rule * from calc_consensus_reads
Loading
Loading