Skip to content

Commit

Permalink
Merge pull request #359 from atrigila/add_versions_nf-test
Browse files Browse the repository at this point in the history
Add software versions in nf-test and check column presence in `.Rmd`
  • Loading branch information
atrigila authored Nov 19, 2024
2 parents 2768b2b + be51725 commit 7b7536a
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 33 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ jobs:
nf-test test \
--ci \
--tag ${{matrix.test_profile}} \
--changed-since HEAD^ \
--profile "+${{ matrix.compute_profile }}" \
--junitxml=test.xml \
--debug
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [[#358](https://github.com/nf-core/differentialabundance/pull/358)] - Added software version check in nf-tests and gene biotype column check in `.Rmd` ([@atrigila](https://github.com/atrigila), review by [@pinin4fjords](https://github.com/pinin4fjords))
- [[#345](https://github.com/nf-core/differentialabundance/pull/345)] - Plot differentially expressed genes by gene biotype ([@atrigila](https://github.com/atrigila), review by [@grst](https://github.com/grst))
- [[#343](https://github.com/nf-core/differentialabundance/pull/343)] - Add pipeline-level nf-tests ([@atrigila](https://github.com/atrigila), review by [@pinin4fjords](https://github.com/pinin4fjords) and [@nschcolnicov](https://github.com/nschcolnicov))
- [[#286](https://github.com/nf-core/differentialabundance/pull/286)] - Integration of limma voom for rnaseq data ([@KamilMaliszArdigen](https://github.com/KamilMaliszArdigen), review by [@pinin4fjords](https://github.com/pinin4fjords))

### Fixed

- [[#358](https://github.com/nf-core/differentialabundance/pull/358)] - Fixed nf-tests not running due to `--changed-since HEAD^`([@atrigila](https://github.com/atrigila), review by [@pinin4fjords](https://github.com/pinin4fjords))
- [[#344](https://github.com/nf-core/differentialabundance/pull/344)] - Fixed replacement of NA sub-strings
([@atrigila](https://github.com/atrigila), suggested by [@BEFH](https://github.com/BEFH), review by [@apeltzer](https://github.com/apeltzer) and [@nschcolnicov](https://github.com/nschcolnicov))
- [[#342](https://github.com/nf-core/differentialabundance/pull/342)] - Fixed incorrectly colored dots in report volcano plots for logFC thresholds <1 ([@WackerO](https://github.com/WackerO), review by [@pinin4fjords](https://github.com/pinin4fjords))
Expand Down
39 changes: 21 additions & 18 deletions assets/differentialabundance_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -896,24 +896,27 @@ for (i in 1:nrow(contrasts)){
contrast_de <- round_dataframe_columns(contrast_de, digits=params$report_round_digits)
print( htmltools::tagList(datatable(contrast_de, caption = paste('Differential genes', dir, 'in', contrast_descriptions[i], " (check", differential_files[[i]], "for more detail)"), rownames = FALSE) ))
# Plot Differentially Expressed Genes by Gene Biotype
gene_biotype_table <- contrast_de %>%
group_by(`Gene biotype`) %>%
summarise(count = dplyr::n(), .groups = 'drop') %>%
filter(count > 0) %>%
arrange(desc(count))
gene_biotype_plot <- ggplot(gene_biotype_table, aes(x = reorder(`Gene biotype`, -count), y = count)) +
geom_bar(stat = "identity", position = position_dodge()) +
labs(
title = paste0("Differentially Expressed Genes by Gene Biotype (", dir, ")"),
x = "Gene Biotype",
y = "Number of Differentially Expressed Genes" ) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(gene_biotype_plot)
if ("Gene biotype" %in% colnames(contrast_de)) {
# Plot Differentially Expressed Genes by Gene Biotype
gene_biotype_table <- contrast_de %>%
group_by(`Gene biotype`) %>%
summarise(count = dplyr::n(), .groups = 'drop') %>%
filter(count > 0) %>%
arrange(desc(count))
gene_biotype_plot <- ggplot(gene_biotype_table, aes(x = reorder(`Gene biotype`, -count), y = count)) +
geom_bar(stat = "identity", position = position_dodge()) +
labs(
title = paste0("Differentially Expressed Genes by Gene Biotype (", dir, ")"),
x = "Gene Biotype",
y = "Number of Differentially Expressed Genes" ) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(gene_biotype_plot)
} else {
cat("Column 'Gene biotype' does not exist. Skipping plot.\n")
}
}else{
cat(paste0("No significantly differential '", dir, "' genes.\n\n"))
}
Expand Down
6 changes: 2 additions & 4 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ report/*.html
report/*.zip
*html
shinyngs_app/**/data.rds
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.html
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.tsv
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.html
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.tsv
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.{html,tsv}
report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.{html,tsv}
2 changes: 2 additions & 0 deletions tests/test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nextflow_pipeline {
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
34 changes: 33 additions & 1 deletion tests/test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
"Test profile": {
"content": [
21,
{
"DESEQ2_DIFFERENTIAL": {
"r-base": "4.1.3",
"bioconductor-deseq2": "1.34.0"
},
"GSEA_GSEA": {
"gsea": "4.3.2"
},
"GTF_TO_TABLE": {
"atlas-gene-annotation-manipulation": "1.1.1"
},
"GUNZIP_GTF": {
"gunzip": 1.1
},
"PLOT_DIFFERENTIAL": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"PLOT_EXPLORATORY": {
"r-shinyngs": "2.0.0"
},
"TABULAR_TO_GSEA_CHIP": {
"bash": "4.2.25 3"
},
"VALIDATOR": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"Workflow": {
"nf-core/differentialabundance": "v1.6.0dev"
}
},
[
"other",
"other/deseq2",
Expand Down Expand Up @@ -154,6 +186,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-08T14:00:03.015341477"
"timestamp": "2024-11-17T21:24:54.504828126"
}
}
8 changes: 4 additions & 4 deletions tests/test_affy.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ nextflow_pipeline {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}',
'report/gsea/phenotype_uninvolved_lesional/**/*.png',
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.html',
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.tsv',
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.html',
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.tsv'])
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_GLYCOLYSIS.{html,tsv}',
'report/gsea/phenotype_uninvolved_lesional/h.all.v2022.1.Hs.symbols/phenotype_uninvolved_lesional.h.all.v2022.1.Hs.symbols.HALLMARK_P53_PATHWAY.{html,tsv}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
32 changes: 31 additions & 1 deletion tests/test_affy.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
"Test affy profile": {
"content": [
16,
{
"AFFY_JUSTRMA_RAW": {
"r-base": "4.3.1",
"bioconductor-affy": "1.78.0"
},
"GSEA_GSEA": {
"gsea": "4.3.2"
},
"LIMMA_DIFFERENTIAL": {
"r-base": "4.3.3",
"bioconductor-limma": "3.58.1"
},
"PLOT_DIFFERENTIAL": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"PLOT_EXPLORATORY": {
"r-shinyngs": "2.0.0"
},
"TABULAR_TO_GSEA_CHIP": {
"bash": "4.2.25 3"
},
"VALIDATOR": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"Workflow": {
"nf-core/differentialabundance": "v1.6.0dev"
}
},
[
"other",
"other/affy",
Expand Down Expand Up @@ -210,6 +240,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-08T15:05:24.153458864"
"timestamp": "2024-11-17T21:29:47.480048632"
}
}
2 changes: 2 additions & 0 deletions tests/test_maxquant.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nextflow_pipeline {
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
28 changes: 27 additions & 1 deletion tests/test_maxquant.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
"Test maxquant profile": {
"content": [
20,
{
"LIMMA_DIFFERENTIAL": {
"r-base": "4.3.3",
"bioconductor-limma": "3.58.1"
},
"PLOT_DIFFERENTIAL": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"PLOT_EXPLORATORY": {
"r-shinyngs": "2.0.0"
},
"PROTEUS": {
"r-base": "4.2.1",
"r-proteus-bartongroup": "0.2.16",
"r-plotly": "4.10.2",
"bioconductor-limma": "3.54.0"
},
"VALIDATOR": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"Workflow": {
"nf-core/differentialabundance": "v1.6.0dev"
}
},
[
"other",
"other/limma",
Expand Down Expand Up @@ -147,6 +173,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-07T16:57:00.079425408"
"timestamp": "2024-11-17T21:32:05.655955914"
}
}
2 changes: 2 additions & 0 deletions tests/test_nogtf.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nextflow_pipeline {
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
22 changes: 21 additions & 1 deletion tests/test_nogtf.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
"Test no gtf profile": {
"content": [
13,
{
"DESEQ2_DIFFERENTIAL": {
"r-base": "4.1.3",
"bioconductor-deseq2": "1.34.0"
},
"PLOT_DIFFERENTIAL": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"PLOT_EXPLORATORY": {
"r-shinyngs": "2.0.0"
},
"VALIDATOR": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"Workflow": {
"nf-core/differentialabundance": "v1.6.0dev"
}
},
[
"other",
"other/deseq2",
Expand Down Expand Up @@ -82,6 +102,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-08T14:08:09.370720729"
"timestamp": "2024-11-17T21:34:30.304565869"
}
}
2 changes: 2 additions & 0 deletions tests/test_rnaseq_limma.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nextflow_pipeline {
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
34 changes: 33 additions & 1 deletion tests/test_rnaseq_limma.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
"Test rnaseq limma profile": {
"content": [
20,
{
"GSEA_GSEA": {
"gsea": "4.3.2"
},
"GTF_TO_TABLE": {
"atlas-gene-annotation-manipulation": "1.1.1"
},
"GUNZIP_GTF": {
"gunzip": 1.1
},
"LIMMA_DIFFERENTIAL": {
"r-base": "4.3.3",
"bioconductor-limma": "3.58.1"
},
"PLOT_DIFFERENTIAL": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"PLOT_EXPLORATORY": {
"r-shinyngs": "2.0.0"
},
"TABULAR_TO_GSEA_CHIP": {
"bash": "4.2.25 3"
},
"VALIDATOR": {
"r-base": "4.3.3",
"r-shinyngs": "2.0.0"
},
"Workflow": {
"nf-core/differentialabundance": "v1.6.0dev"
}
},
[
"other",
"other/limma",
Expand Down Expand Up @@ -145,6 +177,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-08T13:12:28.480773381"
"timestamp": "2024-11-17T21:37:45.162699026"
}
}
2 changes: 2 additions & 0 deletions tests/test_soft.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ nextflow_pipeline {
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
Expand Down
Loading

0 comments on commit 7b7536a

Please sign in to comment.