Skip to content

Commit abe7427

Browse files
authored
Merge pull request #82 from qbic-pipelines/dev
Release 1.3.2
2 parents 7d3a1e7 + 616badf commit abe7427

File tree

10 files changed

+64
-34
lines changed

10 files changed

+64
-34
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
3232
- name: Build new docker image
3333
if: env.GIT_DIFF
34-
run: docker build --no-cache . -t qbicpipelines/rnadeseq:1.3.1
34+
run: docker build --no-cache . -t qbicpipelines/rnadeseq:1.3.2
3535

3636
- name: Pull docker image
3737
if: ${{ !env.GIT_DIFF }}
3838
run: |
3939
docker pull qbicpipelines/rnadeseq:dev
40-
docker tag qbicpipelines/rnadeseq:dev qbicpipelines/rnadeseq:1.3.1
40+
docker tag qbicpipelines/rnadeseq:dev qbicpipelines/rnadeseq:1.3.2
4141
4242
- name: Install Nextflow
4343
run: |
@@ -69,13 +69,13 @@ jobs:
6969
7070
- name: Build new docker image
7171
if: env.GIT_DIFF
72-
run: docker build --no-cache . -t qbicpipelines/rnadeseq:1.3.1
72+
run: docker build --no-cache . -t qbicpipelines/rnadeseq:1.3.2
7373

7474
- name: Pull docker image
7575
if: ${{ !env.GIT_DIFF }}
7676
run: |
7777
docker pull qbicpipelines/rnadeseq:dev
78-
docker tag qbicpipelines/rnadeseq:dev qbicpipelines/rnadeseq:1.3.1
78+
docker tag qbicpipelines/rnadeseq:dev qbicpipelines/rnadeseq:1.3.2
7979
8080
- name: Install Nextflow
8181
run: |

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# qbic-pipelines/rnadeseq: Changelog
22

3+
## 1.3.2 - Almond Blossoms hotfix II
4+
5+
### Added
6+
7+
- Bump versions to 1.3.2
8+
- write deseq2 table to file
9+
10+
### Fixed
11+
- Contrast names in report plots
12+
- Convert species name to lower case also in report
13+
- LogFC is also reported in the report and set in volcano plots
14+
315
## 1.3.1 - Almond Blossoms hotfix
416

517
### Added

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ RUN apt-get update -qq && \
99
apt-get install -y zip procps ghostscript
1010

1111
# Add conda installation dir to PATH
12-
ENV PATH /opt/conda/envs/qbic-pipelines-rnadeseq-1.3.1/bin:$PATH
12+
ENV PATH /opt/conda/envs/qbic-pipelines-rnadeseq-1.3.2/bin:$PATH
1313

1414
# Dump the details of the installed packates to a file for posterity
15-
RUN conda env export --name qbic-pipelines-rnadeseq-1.3.1 > qbic-pipelines-rnadeseq-1.3.1.yml
15+
RUN conda env export --name qbic-pipelines-rnadeseq-1.3.2 > qbic-pipelines-rnadeseq-1.3.2.yml
1616

1717
# Instruct R processes to use these empty files instead of clashing with a local config
1818
RUN touch .Rprofile

assets/RNAseq_report.Rmd

+11-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ params:
2222
path_quote: ""
2323
organism: ""
2424
batch_effect: ""
25+
log_FC: ""
2526
revision: ""
2627
# Author: Silvia Morini, Gisela Gabernet, Simon Heumos
2728
---
@@ -54,7 +55,8 @@ description = as.character(df$Description)
5455
library(yaml)
5556
report_options <- read_yaml(params$path_report_options)
5657
design_deseq2 <- paste(readLines(params$path_design), collapse=" ")
57-
#if(batch_effect=="Yes"){batch_effect=TRUE}else{batch_effect=FALSE}
58+
log_FC_text <- as.character(params$log_FC)
59+
log_FC_num <- as.numeric(params$log_FC)
5860
```
5961

6062
---
@@ -355,7 +357,8 @@ for (i in 1:length(contrnames)){
355357
## List of differentially expressed genes
356358

357359
The analysis of the differential gene expression was performed using `DESeq2`.
358-
Genes were considered differentially expressed (DE) when the adjusted p-value was lower than 0.05 (padj < 0.05).
360+
Genes were considered differentially expressed (DE) when the adjusted p-value was lower than 0.05 (padj < 0.05).
361+
Genes were further considered differentially expressed (DE) if the log2 Fold Change in expression between the two considered groups was above the threshold of `r log_FC_text` in absolute terms.
359362
The adjusted p-value is calculated in the `DESeq2` package with the Benjamini-Hochberg method. P-value adjustment
360363
helps reduce the number of false postives (not real differentially expressed genes).
361364

@@ -389,7 +392,7 @@ kable(df, escape=F,row.names =F) %>%
389392

390393
Volcano plots display the DE genes in Log2 Fold Change values (x axis)
391394
against their adjusted p-value (y axis) in a form of a -log10. Only significantly DE genes are shown (padj < 0.05).
392-
It is recommended to select differentially expressed genes with a Log2FC > 1 or < -1 (blue lines show that threshold).
395+
Genes were further considered DE with a Log2FC > `r log_FC_text` or < -`r log_FC_text` (the blue lines show this threshold).
393396
Here, volcano plots for all considered contrasts are shown. Hover over the dots to show the gene names.
394397

395398
```{r, echo=F, message =F}
@@ -417,7 +420,7 @@ Here, volcano plots for all considered contrasts are shown. Hover over the dots
417420
# label: gene_name
418421
# x: log2FoldChange
419422
# y: -log10(padj)
420-
table_list <- append(table_list, list(DE_genes), 0)
423+
table_list <- append(table_list, list(DE_genes))
421424
}
422425
DE_all <- ldply(table_list, rbind)
423426
DE_all$logpval <- -log10(DE_all$padj)
@@ -426,8 +429,8 @@ Here, volcano plots for all considered contrasts are shown. Hover over the dots
426429
pg <- ggplot(DE_all, aes(x=log2FoldChange, y=logpval, text=paste("Gene: ", gene_name, "<br>", "Log2FC: ", formatC(log2FoldChange, digits=2)))) +
427430
geom_point(aes(alpha=0.3)) +
428431
geom_hline(yintercept = 16, linetype= "dashed", size = 0.2, color = "grey") +
429-
geom_vline(xintercept = 1, size = 0.2, color = "blue") +
430-
geom_vline(xintercept = -1, size = 0.2, color = "blue") +
432+
geom_vline(xintercept = log_FC_num, size = 0.2, color = "blue") +
433+
geom_vline(xintercept = -log_FC_num, size = 0.2, color = "blue") +
431434
scale_y_continuous(limits = c(1, 18)) +
432435
scale_x_continuous(limits = c(-5,5), breaks = c(-5:5)) +
433436
facet_wrap(~contrast, ncol=1, scales = "free_x", shrink = FALSE) +
@@ -511,15 +514,15 @@ The table below provides more detail on all enriched pathways."))
511514
next
512515
}
513516
q = as.character(DE_genes$Ensembl_ID)
514-
q_list <- append(q_list, list(q), 0)
517+
q_list <- append(q_list, list(q))
515518
q_names <- append(q_names, fname)
516519
}
517520
datasources <- c("KEGG","REAC")
518521
names(q_list) <- q_names
519522
520523
#gost query
521524
gostres <- gost(query=q_list,
522-
organism=params$organism,
525+
organism=tolower(params$organism),
523526
significant=T,
524527
correction_method="fdr",
525528
sources=datasources,

bin/DESeq2.R

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ cds <- DESeq(cds, parallel = FALSE)
177177
# SizeFactors(cds) as indicator of library sequencing depth
178178
write.table(sizeFactors(cds),paste("differential_gene_expression/gene_counts_tables/sizeFactor_libraries.tsv",sep=""), append = FALSE, quote = FALSE, sep = "\t",eol = "\n", na = "NA", dec = ".", row.names = T, col.names = F, qmethod = c("escape", "double"))
179179

180+
# Write cds assay table to file
181+
write.table(counts(cds, normalized=T), paste("differential_gene_expression/gene_counts_tables/deseq2_table.tsv", sep=""), append=F, quote = F, sep = "\t", eol = "\n", na = "NA", dec = ".", row.names = T, col.names = T, qmethod = c("escape", "double"))
182+
180183
# Write raw counts to file
181184
count_table_names <- merge(x=gene_names, y=count.table, by.x = "Ensembl_ID", by.y="row.names")
182185
write.table(count_table_names, paste("differential_gene_expression/gene_counts_tables/raw_gene_counts.tsv",sep=""), append = FALSE, quote = FALSE, sep = "\t",eol = "\n", na = "NA", dec = ".", row.names = F, qmethod = c("escape", "double"))

bin/Execute_report.R

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ option_list = list(
1515
make_option(c("-q", "--quote"), type="character", default=NULL, help="path to the signed quote PDF file", metavar="character"),
1616
make_option(c("-g", "--organism"), type="character", default=NULL, help="Organism, e.g. Hsapiens."),
1717
make_option(c("-b", "--batch_effect"), action="store_true", default=FALSE, help="Batch effect correction."),
18+
make_option(c("-f", "--log_FC"), type="double", default=NULL, help="Log Fold Change threshold to consider a gene DE."),
1819
make_option(c("-x", "--revision"), type="character", default=NULL, help="rnadeseq workflow revision", metavar="character")
1920
)
2021

@@ -40,4 +41,5 @@ rmarkdown::render(opt$report, output_file = opt$output, knit_root_dir = wd, outp
4041
path_quote = opt$quote,
4142
organism = opt$organism,
4243
batch_effect = opt$batch_effect,
44+
log_FC = opt$log_FC,
4345
revision = opt$revision))

bin/pathway_analysis.R

+16-14
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ theme_set(theme_classic())
117117

118118
# For each contrast do pathway analysis
119119

120+
# TODO debugging summary table
120121
# Defining summary variables
121-
contrast <- c()
122-
number_DE_genes <- c()
123-
number_enriched_pathways <- c()
124-
list_DE_genes <- list()
125-
list_enriched_pathways <- list()
122+
# contrast <- c()
123+
# number_DE_genes <- c()
124+
# number_enriched_pathways <- c()
125+
# list_DE_genes <- list()
126+
# list_enriched_pathways <- list()
126127

127128
for (file in contrast_files){
128129
#Reading DE genes list
@@ -183,12 +184,13 @@ for (file in contrast_files){
183184
file = paste0(outdir, "/", fname, "/", fname, "_pathway_enrichment_results.tsv"),
184185
sep="\t", quote = F, col.names = T, row.names = F)
185186

187+
# TODO debugging summary table
186188
# Collecting summary variables
187-
contrast <- append(contrast, fname)
188-
number_DE_genes <- append(number_DE_genes, length(DE_genes$Ensembl_ID))
189-
number_enriched_pathways <- append(number_enriched_pathways, summary(as.factor(pathway_gostres_table$source)))
190-
list_DE_genes <- append(list_DE_genes, DE_genes$Ensembl_ID)
191-
list_enriched_pathways <- append(list_enriched_pathways, pathway_gostres_table$term_id)
189+
# contrast <- append(contrast, fname)
190+
# number_DE_genes <- append(number_DE_genes, length(DE_genes$Ensembl_ID))
191+
# number_enriched_pathways <- append(number_enriched_pathways, summary(as.factor(pathway_gostres_table$source)))
192+
# list_DE_genes <- append(list_DE_genes, DE_genes$Ensembl_ID)
193+
# list_enriched_pathways <- append(list_enriched_pathways, pathway_gostres_table$term_id)
192194

193195
# Printing summary variables
194196
print("------------------------------------")
@@ -289,10 +291,10 @@ for (file in contrast_files){
289291
}
290292

291293
# Writing DE gene summary table
292-
df_summary <- data.frame(Contrast = contrast, Number_DE_genes = number_DE_genes, Number_enriched_pathways = number_enriched_pathways, DE_genes_list = list_DE_genes, Enriched_pathways_list = list_enriched_pathways)
293-
write.table(df_summary,
294-
file = paste0(outdir, "/", fname, "/", fname, "_pathway_enrichment_summary.tsv"),
295-
sep="\t", quote = F, col.names = T, row.names = F)
294+
# df_summary <- data.frame(Contrast = contrast, Number_DE_genes = number_DE_genes, Number_enriched_pathways = number_enriched_pathways, DE_genes_list = list_DE_genes, Enriched_pathways_list = list_enriched_pathways)
295+
# write.table(df_summary,
296+
# file = paste0(outdir, "/", fname, "/", fname, "_pathway_enrichment_summary.tsv"),
297+
# sep="\t", quote = F, col.names = T, row.names = F)
296298

297299

298300
# Plotting heatmap for provided gene list

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# You can use this file to create a conda environment for this pipeline:
22
# conda env create -f environment.yml
33
# use this to find packages: https://anaconda.org/
4-
name: qbic-pipelines-rnadeseq-1.3.1
4+
name: qbic-pipelines-rnadeseq-1.3.2
55
channels:
66
- conda-forge
77
- bioconda

main.nf

+11-3
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,17 @@ process Report {
333333
mkdir QC
334334
mv MultiQC/multiqc_plots/ MultiQC/multiqc_data/ MultiQC/multiqc_report.html QC/
335335
Execute_report.R --report '$baseDir/assets/RNAseq_report.Rmd' \
336-
--output 'RNAseq_report.html' --proj_summary $proj_summary \
337-
--versions $softwareversions --model $model --report_options $report_options --revision $workflow.revision \
338-
--contrasts $contrnames $genelistopt --organism $params.species $batchopt
336+
--output 'RNAseq_report.html' \
337+
--proj_summary $proj_summary \
338+
--versions $softwareversions \
339+
--model $model \
340+
--report_options $report_options \
341+
--revision $workflow.revision \
342+
--contrasts $contrnames \
343+
$genelistopt \
344+
--organism $params.species \
345+
--log_FC $params.logFCthreshold \
346+
$batchopt
339347
zip -r report.zip RNAseq_report.html differential_gene_expression/ QC/ pathway_analysis/ $quoteopt
340348
"""
341349
}

nextflow.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ params {
4646

4747
// Container slug. Stable releases should specify release tag!
4848
// Developmental code should specify :dev
49-
process.container = 'qbicpipelines/rnadeseq:1.3.1'
49+
process.container = 'qbicpipelines/rnadeseq:1.3.2'
5050

5151
// Load base.config by default for all pipelines
5252
includeConfig 'conf/base.config'
@@ -102,7 +102,7 @@ manifest {
102102
description = 'Downstream differential gene expression analysis with DESeq2'
103103
mainScript = 'main.nf'
104104
nextflowVersion = '>=19.04'
105-
version = '1.3.1'
105+
version = '1.3.2'
106106
}
107107

108108
// Function to ensure that resource requirements don't go beyond

0 commit comments

Comments
 (0)