Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: configurable basic layout #90

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,25 @@ instructor:
affiliation: "Institution Line"
affiliation2: "2nd Institution line, if wanted" # may be empty

layout:
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
# with 'CambridgeUS'
colortheme: "beaver" # you can choose any, the slides are tested with
# 'beaver'
# choose any preconfigured color or those from the preamble
beamercolor_structure: "fg=UniRot"
beamercolor_title: "fg=UniRot"
beamercolor_title_head: "fg=UniRot"

beamercolor_block_title: "bg=UniRot!20,fg=darkred"
beamercolor_block_body: "fg=black, bg=plightgrey2"

beamercolor_block_title_alerted: "fg=white,bg=UniRot"
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"

course:
date: "datestring" # maybe: "\today"
edition: "edition 4"
# Editors recommendations are a matter of taste and technological
# setups (e.g. on-demand setups). Hence, specify an editor-slide,
# here:
Expand Down
19 changes: 19 additions & 0 deletions config/config_Mainz_NHR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ instructor:
name: "Dr. Christian Meesters"
affiliation: "Johannes Gutenberg Universität Mainz"
affiliation2: "NHR SüdWest" # may be empty

layout:
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
# with 'CambridgeUS'
colortheme: "beaver" # you can choose any, the slides are tested with
# 'beaver'
# choose any preconfigured color or those from the preamble
beamercolor_structure: "fg=UniRot"
beamercolor_title: "fg=UniRot"
beamercolor_title_head: "fg=UniRot"

beamercolor_block_title: "bg=UniRot!20,fg=darkred"
beamercolor_block_body: "fg=black, bg=plightgrey2"

beamercolor_block_title_alerted: "fg=white,bg=UniRot"
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"

course:
date: "datestring" # maybe: "\today"
Expand All @@ -14,6 +30,9 @@ course:
# a condarc file on a cluster, copy and adjust
# for your cluster.
condarcfile: "common/condarc_mogon.tex"
# We provide a common software stack to avoid long
# installation sessions.
softwarepath: "/lustre/project/m2\_jgu-ngstraining/software"
# these are the path names to contain sample data
# see the README for explanations.
pathtosetup: "/lustre/project/m2\_jgu-ngstraining/workflows"
Expand Down
16 changes: 16 additions & 0 deletions config/config_for_github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ instructor:
name: "N.N."
affiliation: "Snakemake Teaching Alliance"
affiliation2: "" # may be empty

layout:
beamertheme: "CambridgeUS" # you can choose any, the slides are tested
# with 'CambridgeUS'
colortheme: "beaver" # you can choose any, the slides are tested with
# 'beaver'
# choose any preconfigured color or those from the preamble
beamercolor_structure: "fg=UniRot"
beamercolor_title: "fg=UniRot"
beamercolor_title_head: "fg=UniRot"

beamercolor_block_title: "bg=UniRot!20,fg=darkred"
beamercolor_block_body: "fg=black, bg=plightgrey2"

beamercolor_block_title_alerted: "fg=white,bg=UniRot"
beamercolor_block_title_example: "fg=white,bg=PineGreen!80"

# The configuration for github needs valid file strings!

Expand Down
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.
68 changes: 68 additions & 0 deletions setup_users/Snakefiles/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
configfile: "config/config.yaml"

rule all:
input:
"plots/quals.svg",
"calls/all.vcf"


def get_bwa_map_input_fastqs(wildcards):
return config["samples"][wildcards.sample]

rule bwa_map:
input:
"data/genome.fa",
get_bwa_map_input_fastqs
output:
temp("mapped_reads/{sample}.bam")
params:
rg=config["bwa_map"]["rg"]
log: "logs/bwa_mem/{sample}.log"
threads: 8
shell:
"(bwa mem -R '{params.rg}' -t {threads} {input} | "
"samtools view -Sb - > {output}) 2> {log}"


rule samtools_sort:
input:
"mapped_reads/{sample}.bam"
output:
temp("sorted_reads/{sample}.bam")
log: "logs/samtools_sort/{sample}.log"
shell:
"samtools sort -T sorted_reads/{wildcards.sample} "
"-O bam {input} > {output} 2> {log}"


rule samtools_index:
input:
"sorted_reads/{sample}.bam"
output:
"sorted_reads/{sample}.bam.bai"
log: "logs/samtools_index/{sample}.log
shell:
"samtools index {input} &> {log}"


rule bcftools_call:
input:
fa="data/genome.fa",
bam=expand("sorted_reads/{sample}.bam", sample=config["samples"]),
bai=expand("sorted_reads/{sample}.bam.bai", sample=config["samples"])
output:
"calls/all.vcf"
log: "logs/bcftools_call.log"
shell:
"(bcftools mpileup -f {input.fa} {input.bam} | "
"bcftools call -mv - > {output}) &> {log}"


rule plot_quals:
input:
"calls/all.vcf"
output:
"plots/quals.svg"
log: "logs/plot_quals.log"
script:
"scripts/plot-quals.py"
6 changes: 6 additions & 0 deletions setup_users/Snakefiles/config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
samples:
A: A.fastq
B: B.fastq

bwa_map:
rg=r"@RG\tID:{sample}\tSM:{sample}"
19 changes: 19 additions & 0 deletions setup_users/Snakefiles/profile/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default-resources:
slurm_partition=barnard

set-resources:
bwa_map:
runtime: 5 # real scenarios will take more
mem_mb_per_cpu: 1800

samtools_sort:
runtime: 5
mem_mb_per_cpu: 1800

samtools_index:
runtime: 5
mem_mb_per_cpu: 1800

bcftools_call:
runtime: 15
mem_mb_per_cpu: 1800
7 changes: 7 additions & 0 deletions setup_users/install_mamba.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh

bash Miniforge3-Linux-x86_64.sh

rm Miniforge3-Linux-x86_64.sh
6 changes: 3 additions & 3 deletions slides/common/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
\definecolor{UrlColor}{rgb}{0,0.08,0.45}
\definecolor{links}{rgb}{0,0,0}

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

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

Expand Down
Loading