Skip to content

Commit 7a70be5

Browse files
feat: Add dedicated demo pipeline for VHS recordings
- Create tests/pipelines/demo with 12 samples, 9 rules - Staggered timing shows job accumulation and progression - Fan-out pattern (3 regions per sample) demonstrates dependency chains - Update demo.tape with longer recording showing Jobs/Rules views - Update generate.sh to use demo pipeline with 4 cores - Add clean-demo task to pixi.toml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9f1e546 commit 7a70be5

File tree

8 files changed

+218
-21
lines changed

8 files changed

+218
-21
lines changed

docs/images/demo.gif

688 KB
Loading

docs/images/quickstart.gif

-22.9 KB
Loading

docs/tapes/demo.tape

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,80 @@ Type "# charmer - Snakemake Pipeline Monitor"
1515
Enter
1616
Sleep 1s
1717

18-
# Show help
18+
# Show help briefly
1919
Type "charmer --help"
2020
Enter
21-
Sleep 3s
21+
Sleep 2s
2222

2323
# Clear and start the TUI
2424
Hide
2525
Type "clear"
2626
Enter
2727
Show
2828

29-
# Start charmer with test data
30-
Type "charmer tests/pipelines/simple"
29+
# Start charmer with demo pipeline
30+
Type "charmer tests/pipelines/demo"
3131
Enter
32+
33+
# Watch jobs accumulate
34+
Sleep 3s
35+
36+
# Navigate down to see dependency chain highlighting
37+
Type "j"
38+
Sleep 400ms
39+
Type "j"
40+
Sleep 400ms
41+
Type "j"
42+
Sleep 400ms
43+
Type "j"
44+
Sleep 400ms
45+
Type "j"
46+
Sleep 1s
47+
48+
# Watch more jobs complete
3249
Sleep 2s
3350

34-
# Navigate through jobs
51+
# Go to bottom to see more jobs
52+
Type "G"
53+
Sleep 1.5s
54+
55+
# Back to top
56+
Type "g"
3557
Sleep 1s
58+
59+
# Switch to Rules view
60+
Type@100ms "Tab"
61+
Sleep 2s
62+
63+
# Navigate rules
3664
Type "j"
3765
Sleep 500ms
3866
Type "j"
3967
Sleep 500ms
4068
Type "j"
41-
Sleep 500ms
69+
Sleep 1s
4270

43-
# Show filtering
44-
Type "f"
71+
# Back to Jobs view
72+
Type@100ms "Tab"
4573
Sleep 1s
74+
75+
# Filter to running jobs only
4676
Type "f"
47-
Sleep 1s
77+
Sleep 1.5s
78+
79+
# Filter to completed
80+
Type "f"
81+
Sleep 1.5s
82+
83+
# Back to all jobs
84+
Type "f"
85+
Sleep 500ms
4886
Type "f"
4987
Sleep 1s
5088

51-
# Show sorting
89+
# Change sort order
90+
Type "s"
91+
Sleep 1s
5292
Type "s"
5393
Sleep 1s
5494
Type "s"
@@ -60,12 +100,9 @@ Sleep 2s
60100
Type "?"
61101
Sleep 500ms
62102

63-
# Navigate more
64-
Type "G"
65-
Sleep 1s
66-
Type "g"
67-
Sleep 1s
103+
# Final view of accumulating jobs
104+
Sleep 2s
68105

69106
# Quit
70107
Type "q"
71-
Sleep 1s
108+
Sleep 500ms

docs/tapes/generate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ cd "$ROOT_DIR"
99
# Install charmer binary
1010
cargo install --path crates/charmer
1111

12-
# Clean and start the test pipeline
13-
pixi run clean-test
14-
snakemake --cores 2 --snakefile tests/pipelines/simple/Snakefile --directory tests/pipelines/simple &
12+
# Clean and start the demo pipeline
13+
pixi run clean-demo
14+
snakemake --cores 4 --snakefile tests/pipelines/demo/Snakefile --directory tests/pipelines/demo &
1515
PIPELINE_PID=$!
1616

1717
# Wait for jobs to register

docs/tapes/quickstart.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Type "# Start monitoring"
1818
Enter
1919
Sleep 500ms
2020

21-
Type "charmer tests/pipelines/simple"
21+
Type "charmer tests/pipelines/demo"
2222
Enter
2323
Sleep 3s
2424

pixi.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ platforms = ["osx-arm64", "osx-64", "linux-64"]
1010
test-pipeline = "cd tests/pipelines/simple && snakemake --cores 2 --snakefile Snakefile"
1111

1212
# Clean test pipeline outputs (including .snakemake metadata)
13-
clean-test = "cd tests/pipelines/simple && rm -rf results .snakemake"
13+
clean-test = "cd tests/pipelines/simple && rm -rf results logs .snakemake"
14+
15+
# Clean demo pipeline outputs
16+
clean-demo = "cd tests/pipelines/demo && rm -rf results logs .snakemake"
1417

1518
# Dry run to see what would be executed
1619
dry-run = "cd tests/pipelines/simple && snakemake --cores 2 --dry-run"

tests/pipelines/demo/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
results/
2+
logs/
3+
.snakemake/

tests/pipelines/demo/Snakefile

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Demo pipeline optimized for charmer VHS recordings
2+
# Designed to show: job accumulation, dependency chains, multiple rules
3+
4+
SAMPLES = [f"sample{i}" for i in range(1, 13)] # 12 samples
5+
REGIONS = ["region_A", "region_B", "region_C"]
6+
7+
rule all:
8+
input:
9+
"results/final_summary.txt"
10+
11+
rule download:
12+
"""Download raw data - fast, runs first for all samples."""
13+
output:
14+
"results/raw/{sample}.fastq"
15+
params:
16+
delay = lambda wc: 2 + (hash(wc.sample) % 3) # 2-4 seconds, varies by sample
17+
log:
18+
"logs/download/{sample}.log"
19+
shell:
20+
"""
21+
exec > {log} 2>&1
22+
echo "Downloading {wildcards.sample}..."
23+
sleep {params.delay}
24+
echo "Downloaded" > {output}
25+
"""
26+
27+
rule quality_check:
28+
"""QC step - depends on download."""
29+
input:
30+
"results/raw/{sample}.fastq"
31+
output:
32+
"results/qc/{sample}_qc.txt"
33+
params:
34+
delay = lambda wc: 3 + (hash(wc.sample) % 4) # 3-6 seconds
35+
log:
36+
"logs/qc/{sample}.log"
37+
shell:
38+
"""
39+
exec > {log} 2>&1
40+
echo "Running QC on {wildcards.sample}..."
41+
sleep {params.delay}
42+
echo "QC passed" > {output}
43+
"""
44+
45+
rule align:
46+
"""Alignment - depends on QC, longer running."""
47+
input:
48+
fastq = "results/raw/{sample}.fastq",
49+
qc = "results/qc/{sample}_qc.txt"
50+
output:
51+
"results/aligned/{sample}.bam"
52+
params:
53+
delay = lambda wc: 5 + (hash(wc.sample) % 5) # 5-9 seconds
54+
log:
55+
"logs/align/{sample}.log"
56+
shell:
57+
"""
58+
exec > {log} 2>&1
59+
echo "Aligning {wildcards.sample}..."
60+
sleep {params.delay}
61+
echo "Aligned" > {output}
62+
"""
63+
64+
rule call_peaks:
65+
"""Peak calling per region - creates fan-out from alignment."""
66+
input:
67+
"results/aligned/{sample}.bam"
68+
output:
69+
"results/peaks/{sample}_{region}.bed"
70+
params:
71+
delay = lambda wc: 4 + (hash(wc.sample + wc.region) % 4) # 4-7 seconds
72+
log:
73+
"logs/peaks/{sample}_{region}.log"
74+
shell:
75+
"""
76+
exec > {log} 2>&1
77+
echo "Calling peaks for {wildcards.sample} in {wildcards.region}..."
78+
sleep {params.delay}
79+
echo "Peaks found" > {output}
80+
"""
81+
82+
rule merge_peaks:
83+
"""Merge peaks per sample - depends on all regions."""
84+
input:
85+
expand("results/peaks/{{sample}}_{region}.bed", region=REGIONS)
86+
output:
87+
"results/merged/{sample}_peaks.bed"
88+
params:
89+
delay = 3
90+
log:
91+
"logs/merge/{sample}.log"
92+
shell:
93+
"""
94+
exec > {log} 2>&1
95+
echo "Merging peaks for {wildcards.sample}..."
96+
sleep {params.delay}
97+
cat {input} > {output}
98+
"""
99+
100+
rule annotate:
101+
"""Annotate merged peaks."""
102+
input:
103+
"results/merged/{sample}_peaks.bed"
104+
output:
105+
"results/annotated/{sample}_annotated.txt"
106+
params:
107+
delay = 4
108+
log:
109+
"logs/annotate/{sample}.log"
110+
shell:
111+
"""
112+
exec > {log} 2>&1
113+
echo "Annotating {wildcards.sample}..."
114+
sleep {params.delay}
115+
echo "Annotated" > {output}
116+
"""
117+
118+
rule sample_report:
119+
"""Per-sample report - end of chain per sample."""
120+
input:
121+
annotated = "results/annotated/{sample}_annotated.txt",
122+
bam = "results/aligned/{sample}.bam"
123+
output:
124+
"results/reports/{sample}_report.txt"
125+
params:
126+
delay = 2
127+
log:
128+
"logs/report/{sample}.log"
129+
shell:
130+
"""
131+
exec > {log} 2>&1
132+
echo "Generating report for {wildcards.sample}..."
133+
sleep {params.delay}
134+
echo "Report for {wildcards.sample}" > {output}
135+
"""
136+
137+
rule final_summary:
138+
"""Final summary - depends on all sample reports."""
139+
input:
140+
expand("results/reports/{sample}_report.txt", sample=SAMPLES)
141+
output:
142+
"results/final_summary.txt"
143+
params:
144+
delay = 3
145+
log:
146+
"logs/final_summary.log"
147+
shell:
148+
"""
149+
exec > {log} 2>&1
150+
echo "Creating final summary..."
151+
sleep {params.delay}
152+
echo "Pipeline complete" > {output}
153+
cat {input} >> {output}
154+
"""

0 commit comments

Comments
 (0)