Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a6eaf38
feat: allow for multiple gene_lists, one heatmap per list, bootstrap …
dlaehnemann Oct 8, 2025
896e4bc
fix: lookup syntax
dlaehnemann Oct 8, 2025
c48cb17
chore: snakefmt
dlaehnemann Oct 8, 2025
1a67b6a
fix: typo
dlaehnemann Oct 8, 2025
dca8aef
fix: restore proper handling of topn in heatmap plotting rule
dlaehnemann Oct 9, 2025
6043b72
docs: add linkout to ensembl blog release category to determine lates…
dlaehnemann Oct 9, 2025
c9b1afb
fix: handle topn case in lookup
dlaehnemann Oct 9, 2025
5594d41
fix: provide dummy file path for topn case in heatmap rule
dlaehnemann Oct 9, 2025
b4f88d1
fix: use correct wildcard in heatmap plotting script
dlaehnemann Oct 9, 2025
fa97e67
docs: better explain diffexp/exclude in config.yaml
dlaehnemann Oct 9, 2025
3e97347
fix: correctly parse params in plot_bootstrap
dlaehnemann Oct 9, 2025
c4fb68b
fix: also test diffexp/exclude in config.yaml of CI cases
dlaehnemann Oct 9, 2025
206d244
fix: more defensive coding strategy, as suggested by @coderabbitai
dlaehnemann Oct 9, 2025
09914fb
dummy commit to trigger GitHub
dlaehnemann Oct 9, 2025
84aca9e
another dummy commit to trigger GitHub Actions
dlaehnemann Oct 9, 2025
f6709e7
docs: update comment in plot-bootstrap.R
dlaehnemann Oct 10, 2025
511cae8
fix: switch back to line-separated gene set files for plots
dlaehnemann Oct 13, 2025
e036131
fix: make boostrap plotting more modern
dlaehnemann Oct 13, 2025
107d503
fix: clean up and overhaul heatmap plotting, switch to ggalign
dlaehnemann Oct 13, 2025
a4b56c6
fix: main test config
dlaehnemann Oct 13, 2025
778f099
chore: update release versions
dlaehnemann Oct 13, 2025
b338f0e
docs: adjust wording to not use "infix"
dlaehnemann Oct 13, 2025
4c4536c
docs: write a proper sentence
dlaehnemann Oct 13, 2025
5f1c7fa
fix: length test for transcripts of interest
dlaehnemann Oct 13, 2025
626f306
fix: syntax
dlaehnemann Oct 13, 2025
4e015b3
fix: r-base to >=4.1 for scripts using native R pipe
dlaehnemann Oct 13, 2025
846b420
docs: update config/config.yaml to ensembl release 114
dlaehnemann Oct 14, 2025
8dbfca8
docs: update more 114 -> 115
dlaehnemann Oct 14, 2025
f4b0e57
docs: comment exceedingly high testing FDR .test/config/config.yaml
dlaehnemann Oct 15, 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
4 changes: 3 additions & 1 deletion .test/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ diffexp:
qq-plot: 0.05
genes_of_interest:
activate: true
genelist: "resources/gene_list.tsv"
gene_lists:
gene_list_1: "resources/gene_list.tsv"
gene_list_2: "resources/gene_list.tsv"

diffsplice:
activate: false
Expand Down
19 changes: 1 addition & 18 deletions .test/resources/gene_list.tsv
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
STAT1
IRF1
HLA-A
HLA-DRB1
TYR
PMEL
DCT
MLANA
MITF
CDK2
SOX10
ERBB3
LEF1
CTNNB1
CDH1
FN1
NGFR
AXL
STAT1 IRF1 HLA-A HLA-DRB1 TYR PMEL DCT MLANA MITF CDK2 SOX10
1 change: 1 addition & 0 deletions .test/resources/gene_list_2.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MLANA MITF CDK2 SOX10 ERBB3 LEF1 CTNNB1 CDH1 FN1 NGFR AXL
3 changes: 2 additions & 1 deletion .test/three_prime/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ diffexp:
qq-plot: 0.05
genes_of_interest:
activate: false
genelist: "resources/gene_list.tsv"
gene_lists:
gene_list_1: "resources/gene_list.tsv"

diffsplice:
activate: false
Expand Down
16 changes: 11 additions & 5 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,19 @@ diffexp:
ma-plot: 0.05
qq-plot: 0.05
# heatmap and bootstrap plots for given set of genes:
# If you want a heatmap and bootstrap plots for a particular set of genes,
# you can set `activate: true` and provide a genelist file. In this file,
# list all your HGNC gene symbols of interest in one line, separated by
# tabulators (tabs).
# If you want a heatmap and bootstrap plots for particular sets of genes,
# you can set `activate: true` and provide one or more gene list files. In
# those files, list all your HGNC gene symbols of interest in one line,
# separated by tabulators (tabs). The workflow will generate one heatmap
# plot per file, and a bootstrap plot for each of the genes contained in
# any of the provided files.
genes_of_interest:
activate: false
genelist: "config/gene_list.tsv"
gene_lists:
# use a descriptive gene list name, as this will be used as an infix in
# the filename of the resulting heatmap plot
gene_list_1: "config/gene_list.tsv"


diffsplice:
# isoformSwitchAnalyzer
Expand Down
12 changes: 2 additions & 10 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,6 @@ def kallisto_params(wildcards, input):
return extra


def input_genelist(predef_genelist):
if config["diffexp"]["genes_of_interest"]["activate"] == True:
predef_genelist = config["diffexp"]["genes_of_interest"]["genelist"]
else:
predef_genelist = []

return predef_genelist


def all_input(wildcards):
"""
Function defining all requested inputs for the rule all (below).
Expand Down Expand Up @@ -339,9 +330,10 @@ def all_input(wildcards):
wanted_input.extend(
expand(
[
"results/plots/diffexp-heatmap/{model}.diffexp-heatmap.{mode}.pdf",
"results/plots/diffexp-heatmap/{model}.{gene_list}.diffexp-heatmap.{mode}.pdf",
],
model=config["diffexp"]["models"],
gene_list=lookup(within=config, dpath("diffexp/gene_of_interest/gene_lists")),
mode=["predefined"],
)
)
Expand Down
13 changes: 8 additions & 5 deletions workflow/rules/diffexp.smk
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ rule plot_bootstrap:
color_by=config["bootstrap_plots"]["color_by"],
fdr=config["bootstrap_plots"]["FDR"],
top_n=config["bootstrap_plots"]["top_n"],
genes=config["diffexp"]["genes_of_interest"],
gene_lists=lookup(within=config, dpath="diffexp/genes_of_interest/gene_lists"),
log:
"logs/plots/bootstrap/{model}/{model}.plot_bootstrap.log",
script:
Expand Down Expand Up @@ -258,18 +258,21 @@ rule tpm_matrix:
rule plot_diffexp_heatmap:
input:
logcountmatrix_file="results/tables/logcount-matrix/{model}.logcount-matrix.tsv",
predef_genelist=input_genelist,
predef_gene_list=lookup(within=config, dpath="diffexp/genes_of_interest/gene_lists/{gene_list}"),
output:
diffexp_heatmap=report(
"results/plots/diffexp-heatmap/{model}.diffexp-heatmap.{mode}.pdf",
"results/plots/diffexp-heatmap/{model}.{gene_list}.diffexp-heatmap.{mode}.pdf",
caption="../report/plot-heatmap.rst",
category="Heatmaps",
labels={"model": "{model}-{mode}"},
labels={
"model": "{model}-{mode}",
"gene list": "{gene_list}",
},
),
params:
model=get_model,
log:
"logs/plots/diffexp-heatmap/{model}.diffexp-heatmap.{mode}.log",
"logs/plots/diffexp-heatmap/{model}.{gene_list}.diffexp-heatmap.{mode}.log",
conda:
"../envs/heatmap.yaml"
script:
Expand Down
9 changes: 6 additions & 3 deletions workflow/schemas/config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ properties:
properties:
activate:
type: boolean
genelist:
type: string
gene_lists:
type: object
patternProperties:
"^.+$":
type: string
required:
- genelist
- gene_lists
required:
- models
- genes_of_interest
Expand Down
18 changes: 13 additions & 5 deletions workflow/scripts/plot-bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ top_genes <- results %>%


if (snakemake@params[["genes"]]$activate == TRUE) {
gene_table <- read.csv(snakemake@params[["genes"]]$genelist,
sep = "\t")
names(gene_table) <- c("ext_gene")
genes_of_interest <- tibble(gene_table) %>%
distinct(ext_gene)
genes = c()
for (gene_list in unname(snakemake@params[["gene_lists"]])) {
new_genes <- read_tsv(
gene_list,
col_names = FALSE
)
genes <- union(genes, new_genes |> unlist() |> unname())
}
genes_of_interest <- enframe(
genes,
name = NULL,
value = "ext_gene"
)
} else {
# "genes" is null, if the list provided in config.yaml is empty
genes_of_interest <- tibble(ext_gene = character())
Expand Down
2 changes: 1 addition & 1 deletion workflow/scripts/plot_diffexp_heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (snakemake@wildcards[["mode"]] == "topn") {
} else if (snakemake@wildcards[["mode"]] == "predefined") {
# Adding gene list to the variable
predefine_genelist <-
read.table(snakemake@input[["predef_genelist"]],
read.table(snakemake@input[["predef_gene_list"]],
sep = "\t"
)
selectedgenes <-
Expand Down
Loading