Skip to content

Commit 425cf14

Browse files
authored
feat: configurable basic layout (#90)
* feat: configurable basic layout * fix: added missing layouting infor for github
1 parent d1e5f76 commit 425cf14

37 files changed

+155
-3
lines changed

config/config.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,25 @@ instructor:
33
affiliation: "Institution Line"
44
affiliation2: "2nd Institution line, if wanted" # may be empty
55

6+
layout:
7+
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
8+
# with 'CambridgeUS'
9+
colortheme: "beaver" # you can choose any, the slides are tested with
10+
# 'beaver'
11+
# choose any preconfigured color or those from the preamble
12+
beamercolor_structure: "fg=UniRot"
13+
beamercolor_title: "fg=UniRot"
14+
beamercolor_title_head: "fg=UniRot"
15+
16+
beamercolor_block_title: "bg=UniRot!20,fg=darkred"
17+
beamercolor_block_body: "fg=black, bg=plightgrey2"
18+
19+
beamercolor_block_title_alerted: "fg=white,bg=UniRot"
20+
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"
21+
622
course:
723
date: "datestring" # maybe: "\today"
24+
edition: "edition 4"
825
# Editors recommendations are a matter of taste and technological
926
# setups (e.g. on-demand setups). Hence, specify an editor-slide,
1027
# here:

config/config_Mainz_NHR.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ instructor:
22
name: "Dr. Christian Meesters"
33
affiliation: "Johannes Gutenberg Universität Mainz"
44
affiliation2: "NHR SüdWest" # may be empty
5+
6+
layout:
7+
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
8+
# with 'CambridgeUS'
9+
colortheme: "beaver" # you can choose any, the slides are tested with
10+
# 'beaver'
11+
# choose any preconfigured color or those from the preamble
12+
beamercolor_structure: "fg=UniRot"
13+
beamercolor_title: "fg=UniRot"
14+
beamercolor_title_head: "fg=UniRot"
15+
16+
beamercolor_block_title: "bg=UniRot!20,fg=darkred"
17+
beamercolor_block_body: "fg=black, bg=plightgrey2"
18+
19+
beamercolor_block_title_alerted: "fg=white,bg=UniRot"
20+
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"
521

622
course:
723
date: "datestring" # maybe: "\today"
@@ -14,6 +30,9 @@ course:
1430
# a condarc file on a cluster, copy and adjust
1531
# for your cluster.
1632
condarcfile: "common/condarc_mogon.tex"
33+
# We provide a common software stack to avoid long
34+
# installation sessions.
35+
softwarepath: "/lustre/project/m2\_jgu-ngstraining/software"
1736
# these are the path names to contain sample data
1837
# see the README for explanations.
1938
pathtosetup: "/lustre/project/m2\_jgu-ngstraining/workflows"

config/config_for_github.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ instructor:
22
name: "N.N."
33
affiliation: "Snakemake Teaching Alliance"
44
affiliation2: "" # may be empty
5+
6+
layout:
7+
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
8+
# with 'CambridgeUS'
9+
colortheme: "beaver" # you can choose any, the slides are tested with
10+
# 'beaver'
11+
# choose any preconfigured color or those from the preamble
12+
beamercolor_structure: "fg=UniRot"
13+
beamercolor_title: "fg=UniRot"
14+
beamercolor_title_head: "fg=UniRot"
15+
16+
beamercolor_block_title: "bg=UniRot!20,fg=darkred"
17+
beamercolor_block_body: "fg=black, bg=plightgrey2"
18+
19+
beamercolor_block_title_alerted: "fg=white,bg=UniRot"
20+
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"
521

622
# The configuration for github needs valid file strings!
723

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

setup_users/Snakefiles/Snakefile

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
configfile: "config/config.yaml"
2+
3+
rule all:
4+
input:
5+
"plots/quals.svg",
6+
"calls/all.vcf"
7+
8+
9+
def get_bwa_map_input_fastqs(wildcards):
10+
return config["samples"][wildcards.sample]
11+
12+
rule bwa_map:
13+
input:
14+
"data/genome.fa",
15+
get_bwa_map_input_fastqs
16+
output:
17+
temp("mapped_reads/{sample}.bam")
18+
params:
19+
rg=config["bwa_map"]["rg"]
20+
log: "logs/bwa_mem/{sample}.log"
21+
threads: 8
22+
shell:
23+
"(bwa mem -R '{params.rg}' -t {threads} {input} | "
24+
"samtools view -Sb - > {output}) 2> {log}"
25+
26+
27+
rule samtools_sort:
28+
input:
29+
"mapped_reads/{sample}.bam"
30+
output:
31+
temp("sorted_reads/{sample}.bam")
32+
log: "logs/samtools_sort/{sample}.log"
33+
shell:
34+
"samtools sort -T sorted_reads/{wildcards.sample} "
35+
"-O bam {input} > {output} 2> {log}"
36+
37+
38+
rule samtools_index:
39+
input:
40+
"sorted_reads/{sample}.bam"
41+
output:
42+
"sorted_reads/{sample}.bam.bai"
43+
log: "logs/samtools_index/{sample}.log
44+
shell:
45+
"samtools index {input} &> {log}"
46+
47+
48+
rule bcftools_call:
49+
input:
50+
fa="data/genome.fa",
51+
bam=expand("sorted_reads/{sample}.bam", sample=config["samples"]),
52+
bai=expand("sorted_reads/{sample}.bam.bai", sample=config["samples"])
53+
output:
54+
"calls/all.vcf"
55+
log: "logs/bcftools_call.log"
56+
shell:
57+
"(bcftools mpileup -f {input.fa} {input.bam} | "
58+
"bcftools call -mv - > {output}) &> {log}"
59+
60+
61+
rule plot_quals:
62+
input:
63+
"calls/all.vcf"
64+
output:
65+
"plots/quals.svg"
66+
log: "logs/plot_quals.log"
67+
script:
68+
"scripts/plot-quals.py"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
samples:
2+
A: A.fastq
3+
B: B.fastq
4+
5+
bwa_map:
6+
rg=r"@RG\tID:{sample}\tSM:{sample}"
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
default-resources:
2+
slurm_partition=barnard
3+
4+
set-resources:
5+
bwa_map:
6+
runtime: 5 # real scenarios will take more
7+
mem_mb_per_cpu: 1800
8+
9+
samtools_sort:
10+
runtime: 5
11+
mem_mb_per_cpu: 1800
12+
13+
samtools_index:
14+
runtime: 5
15+
mem_mb_per_cpu: 1800
16+
17+
bcftools_call:
18+
runtime: 15
19+
mem_mb_per_cpu: 1800

setup_users/install_mamba.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
4+
5+
bash Miniforge3-Linux-x86_64.sh
6+
7+
rm Miniforge3-Linux-x86_64.sh

slides/common/preamble.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
\definecolor{UrlColor}{rgb}{0,0.08,0.45}
3838
\definecolor{links}{rgb}{0,0,0}
3939

40-
\usetheme{CambridgeUS} % Pittsburgh, CambridgeUS
41-
\usecolortheme{beaver} %wolverine | crane | beaver | seahorse
40+
\usetheme{<++layout.theme++>} % Pittsburgh, CambridgeUS
41+
\usecolortheme{<++layout.colortheme++>} %wolverine | crane | beaver | seahorse
4242
\useinnertheme{rounded}
4343
\useoutertheme{default}
4444
\usefonttheme{default}
@@ -51,7 +51,7 @@
5151
% side margins
5252
\setbeamersize{text margin left=0.5cm, text margin right=0.5cm}
5353

54-
\setbeamercolor{structure}{fg=UniRot}% to modify immediately all palettes
54+
\setbeamercolor{structure}{<++layout.beamercolor_structure++>}% to modify immediately all palettes
5555
\setbeamercolor{title}{fg=UniRot}
5656
\setbeamercolor{title in head/foot}{fg=UniRot}
5757

0 commit comments

Comments
 (0)