diff --git a/CHANGELOG.md b/CHANGELOG.md index dd44453b..c41dd5ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- [[#266](https://github.com/nf-core/differentialabundance/pull/266)] - Fix logging by specifying assays to log ([@pinin4fjords](https://github.com/pinin4fjords), review by [@WackerO](https://github.com/WackerO)) - [[#259](https://github.com/nf-core/differentialabundance/pull/259)] - Bump gtf2featureannotation to fix GTF handling error ([@pinin4fjords](https://github.com/pinin4fjords), review by [@WackerO](https://github.com/WackerO)) - [[#257](https://github.com/nf-core/differentialabundance/pull/257)] - Added maxquant profile to nextflow.config to make it available ([@WackerO](https://github.com/WackerO), review by [@pinin4fjords](https://github.com/pinin4fjords)) - [[#254](https://github.com/nf-core/differentialabundance/pull/254)] - Some parameter changes, added qbic credits ([@WackerO](https://github.com/WackerO), review by [@pinin4fjords](https://github.com/pinin4fjords)) diff --git a/assets/differentialabundance_report.Rmd b/assets/differentialabundance_report.Rmd index fa8787f1..7bf41c12 100644 --- a/assets/differentialabundance_report.Rmd +++ b/assets/differentialabundance_report.Rmd @@ -38,7 +38,7 @@ params: features_metadata_cols: NULL features_gtf_feature_type: NULL features_gtf_table_first_field: NULL - features_log2_assays: NULL + exploratory_log2_assays: NULL raw_matrix: null # e.g. 0_salmon.merged.gene_counts_length_scaled.tsv normalised_matrix: null variance_stabilised_matrix: null # e.g. test_files/3_treatment-WT-P23H.vst.tsv @@ -310,11 +310,12 @@ assay_data <- lapply(assay_files, function(x) { mat }) -if (!is.null(params$features_log2_assays)) { +log2_assays <- params$exploratory_log2_assays +if (!is.null(log2_assays)) { # Remove brackets from assay list. TODO: remove if this is added to cond_log2_transform_assays - params$features_log2_assays <- gsub('\\]$', '', gsub('^\\[', '', params$features_log2_assays)) + log2_assays <- gsub('\\]$', '', gsub('^\\[', '', log2_assays)) } -assay_data <- cond_log2_transform_assays(assay_data, params$features_log2_assays) +assay_data <- cond_log2_transform_assays(assay_data, log2_assays, prettify_names = FALSE) # Now we can rename the observations rows using the title field rownames(observations) <- observations[[observations_name_col]] diff --git a/conf/affy.config b/conf/affy.config index 7d953d3b..d0ceb7a3 100644 --- a/conf/affy.config +++ b/conf/affy.config @@ -27,6 +27,7 @@ params { // Exploratory exploratory_assay_names = 'raw,normalised' exploratory_final_assay = 'normalised' + exploratory_log2_assays = null // Differential options differential_file_suffix = ".limma.results.tsv" diff --git a/conf/maxquant.config b/conf/maxquant.config index 57caf2d4..8adf03c8 100644 --- a/conf/maxquant.config +++ b/conf/maxquant.config @@ -28,6 +28,7 @@ params { // Exploratory exploratory_assay_names = "raw,normalised" exploratory_final_assay = "normalised" + exploratory_log2_assays = null // Differential options differential_file_suffix = ".limma.results.tsv" diff --git a/conf/modules.config b/conf/modules.config index c5eee153..9313457d 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -375,7 +375,7 @@ process { "--final_assay \"${params.exploratory_final_assay}\"", "--outlier_mad_threshold ${params.exploratory_mad_threshold}", "--palette_name \"${params.exploratory_palette_name}\"", - ( (params.study_type == 'maxquant') ? "--log2_assays ''" : (((params.features_log2_assays == null) ? '' : "--log2_assays \"$params.features_log2_assays\"".replace('[', '').replace(']', ''))) ) + ( (params.study_type == 'maxquant') ? "--log2_assays ''" : (((params.exploratory_log2_assays == null) ? '' : "--log2_assays \"$params.exploratory_log2_assays\"".replace('[', '').replace(']', ''))) ) ].join(' ').trim() } } @@ -428,8 +428,8 @@ process { } withName: RMARKDOWNNOTEBOOK { - conda = "bioconda::r-shinyngs=1.8.4" - container = { "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.4--r43hdfd78af_0' : 'biocontainers/r-shinyngs:1.8.4--r43hdfd78af_0' }" } + conda = "bioconda::r-shinyngs=1.8.8" + container = { "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.8--r43hdfd78af_0' : 'biocontainers/r-shinyngs:1.8.8--r43hdfd78af_0' }" } publishDir = [ [ path: { "${params.outdir}/report" }, diff --git a/conf/rnaseq.config b/conf/rnaseq.config index 10427bf1..c79d4828 100644 --- a/conf/rnaseq.config +++ b/conf/rnaseq.config @@ -27,6 +27,7 @@ params { // Exploratory exploratory_assay_names = "raw,normalised,variance_stabilised" exploratory_final_assay = "variance_stabilised" + exploratory_log2_assays = 'raw,normalised' // Differential options differential_file_suffix = ".deseq2.results.tsv" diff --git a/conf/soft.config b/conf/soft.config index 5109b25d..832ebc17 100644 --- a/conf/soft.config +++ b/conf/soft.config @@ -33,6 +33,7 @@ params { // Exploratory exploratory_assay_names = 'normalised' exploratory_final_assay = 'normalised' + exploratory_log2_assays = null // Differential options differential_file_suffix = ".limma.results.tsv" diff --git a/modules.json b/modules.json index c313b064..6362693e 100644 --- a/modules.json +++ b/modules.json @@ -72,22 +72,22 @@ }, "shinyngs/app": { "branch": "master", - "git_sha": "d2d6072ae4c3a9d394dfe773bb0751f34df7a896", + "git_sha": "85519fe9deccf2c5f7ff1f3b5d3494c61a794643", "installed_by": ["modules"] }, "shinyngs/staticdifferential": { "branch": "master", - "git_sha": "d2d6072ae4c3a9d394dfe773bb0751f34df7a896", + "git_sha": "85519fe9deccf2c5f7ff1f3b5d3494c61a794643", "installed_by": ["modules"] }, "shinyngs/staticexploratory": { "branch": "master", - "git_sha": "d2d6072ae4c3a9d394dfe773bb0751f34df7a896", + "git_sha": "85519fe9deccf2c5f7ff1f3b5d3494c61a794643", "installed_by": ["modules"] }, "shinyngs/validatefomcomponents": { "branch": "master", - "git_sha": "d2d6072ae4c3a9d394dfe773bb0751f34df7a896", + "git_sha": "85519fe9deccf2c5f7ff1f3b5d3494c61a794643", "installed_by": ["modules"] }, "untar": { @@ -111,7 +111,7 @@ }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3", "installed_by": ["subworkflows"] }, "utils_nfvalidation_plugin": { diff --git a/modules/nf-core/shinyngs/app/environment.yml b/modules/nf-core/shinyngs/app/environment.yml index 9d051f47..0e6de401 100644 --- a/modules/nf-core/shinyngs/app/environment.yml +++ b/modules/nf-core/shinyngs/app/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::r-shinyngs=1.8.5 + - bioconda::r-shinyngs=1.8.8 diff --git a/modules/nf-core/shinyngs/app/main.nf b/modules/nf-core/shinyngs/app/main.nf index 3a023aa1..ef05a863 100644 --- a/modules/nf-core/shinyngs/app/main.nf +++ b/modules/nf-core/shinyngs/app/main.nf @@ -15,8 +15,8 @@ process SHINYNGS_APP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' : - 'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.8--r43hdfd78af_0' : + 'biocontainers/r-shinyngs:1.8.8--r43hdfd78af_0' }" input: tuple val(meta), path(sample), path(feature_meta), path(assay_files) // Experiment-level info @@ -49,8 +49,23 @@ process SHINYNGS_APP { cat <<-END_VERSIONS > versions.yml "${task.process}": - r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))") END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: meta.id + + """ + mkdir -p $prefix + touch ${prefix}/data.rds + touch ${prefix}/app.R + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))") + END_VERSIONS + """ + } diff --git a/modules/nf-core/shinyngs/app/tests/main.nf.test b/modules/nf-core/shinyngs/app/tests/main.nf.test new file mode 100644 index 00000000..39d6e27e --- /dev/null +++ b/modules/nf-core/shinyngs/app/tests/main.nf.test @@ -0,0 +1,133 @@ +nextflow_process { + + name "Test Process SHINYNGS_APP" + script "../main.nf" + process "SHINYNGS_APP" + + tag "modules" + tag "modules_nfcore" + tag "shinyngs" + tag "shinyngs/app" + + test("mouse - multi matrix") { + + config './nextflow.config' + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true) + expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true) + + // Copy some inputs for testing the multi-matrix functionality + raw_expression_matrix_file.copyTo('normalised.tsv') + normalised_expression_matrix_file = file('normalised.tsv') + expression_differential.copyTo('second_contrast_stats.tsv') + second_contrast_stats = file('second_contrast_stats.tsv') + + contrast_stats_assay = Channel.value(1) + + input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file, normalised_expression_matrix_file ] ] + input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ] + input[2] = contrast_stats_assay + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.app[0][1]).name, + process.out.app[0][2], + process.out.versions + ).match() } + ) + } + } + + test("mouse - single matrix") { + + config './nextflow.config' + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true) + expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true) + + // Copy some inputs for testing the multi-matrix functionality + expression_differential.copyTo('second_contrast_stats.tsv') + second_contrast_stats = file('second_contrast_stats.tsv') + + contrast_stats_assay = Channel.value(1) + + input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file ] ] + input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ] + input[2] = contrast_stats_assay + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.app[0][1]).name, + process.out.app[0][2], + process.out.versions + ).match() } + ) + } + } + + test("mouse - stub") { + + options "-stub" + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true) + expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true) + + // Copy some inputs for testing the multi-matrix functionality + expression_differential.copyTo('second_contrast_stats.tsv') + second_contrast_stats = file('second_contrast_stats.tsv') + + contrast_stats_assay = Channel.value(1) + + input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file ] ] + input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ] + input[2] = contrast_stats_assay + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.app[0][1]).name, + process.out.app[0][2], + process.out.versions + ).match() } + ) + } + } +} diff --git a/modules/nf-core/shinyngs/app/tests/main.nf.test.snap b/modules/nf-core/shinyngs/app/tests/main.nf.test.snap new file mode 100644 index 00000000..f87c17d7 --- /dev/null +++ b/modules/nf-core/shinyngs/app/tests/main.nf.test.snap @@ -0,0 +1,44 @@ +{ + "mouse - stub": { + "content": [ + "data.rds", + "app.R:md5,d41d8cd98f00b204e9800998ecf8427e", + [ + "versions.yml:md5,9a3135ae8ff362a9671b280dcc5781da" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:47:11.758494" + }, + "mouse - multi matrix": { + "content": [ + "data.rds", + "app.R:md5,bedcfc45b6cdcc2b8fe3627987e2b17a", + [ + "versions.yml:md5,9a3135ae8ff362a9671b280dcc5781da" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:46:37.144273" + }, + "mouse - single matrix": { + "content": [ + "data.rds", + "app.R:md5,bedcfc45b6cdcc2b8fe3627987e2b17a", + [ + "versions.yml:md5,9a3135ae8ff362a9671b280dcc5781da" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:46:57.227288" + } +} \ No newline at end of file diff --git a/modules/nf-core/shinyngs/app/tests/nextflow.config b/modules/nf-core/shinyngs/app/tests/nextflow.config new file mode 100644 index 00000000..b5fffed1 --- /dev/null +++ b/modules/nf-core/shinyngs/app/tests/nextflow.config @@ -0,0 +1,14 @@ +process { + //withName: test_shinyngs_app:SHINYNGS_APP { + // secret 'SHINYAPPS_TOKEN' + // secret 'SHINYAPPS_SECRET' + //} + withName: test_shinyngs_app:SHINYNGS_APP { + ext.prefix = { "${meta.id}_test" } + ext.args = { "--contrast_stats_assay 1" } + } + withName: test_shinyngs_app_multi_matrix:SHINYNGS_APP { + ext.prefix = { "${meta.id}_test" } + ext.args = { "--assay-names raw,normalised --contrast_stats_assay 2" } + } +} diff --git a/modules/nf-core/shinyngs/app/tests/tags.yml b/modules/nf-core/shinyngs/app/tests/tags.yml new file mode 100644 index 00000000..07331846 --- /dev/null +++ b/modules/nf-core/shinyngs/app/tests/tags.yml @@ -0,0 +1,2 @@ +shinyngs/app: + - "modules/nf-core/shinyngs/app/**" diff --git a/modules/nf-core/shinyngs/staticdifferential/environment.yml b/modules/nf-core/shinyngs/staticdifferential/environment.yml index 65ef5971..bec57084 100644 --- a/modules/nf-core/shinyngs/staticdifferential/environment.yml +++ b/modules/nf-core/shinyngs/staticdifferential/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::r-shinyngs=1.8.5 + - bioconda::r-shinyngs=1.8.8 diff --git a/modules/nf-core/shinyngs/staticdifferential/main.nf b/modules/nf-core/shinyngs/staticdifferential/main.nf index 823eadc0..c61ccb4a 100644 --- a/modules/nf-core/shinyngs/staticdifferential/main.nf +++ b/modules/nf-core/shinyngs/staticdifferential/main.nf @@ -4,8 +4,8 @@ process SHINYNGS_STATICDIFFERENTIAL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' : - 'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.8--r43hdfd78af_0' : + 'biocontainers/r-shinyngs:1.8.8--r43hdfd78af_0' }" input: tuple val(meta), path(differential_result) // Differential info: contrast and differential stats diff --git a/modules/nf-core/shinyngs/staticexploratory/environment.yml b/modules/nf-core/shinyngs/staticexploratory/environment.yml index 8fbe76e2..1c923f1b 100644 --- a/modules/nf-core/shinyngs/staticexploratory/environment.yml +++ b/modules/nf-core/shinyngs/staticexploratory/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::r-shinyngs=1.8.5 + - bioconda::r-shinyngs=1.8.8 diff --git a/modules/nf-core/shinyngs/staticexploratory/main.nf b/modules/nf-core/shinyngs/staticexploratory/main.nf index fbbb26c3..1a3104b3 100644 --- a/modules/nf-core/shinyngs/staticexploratory/main.nf +++ b/modules/nf-core/shinyngs/staticexploratory/main.nf @@ -4,8 +4,8 @@ process SHINYNGS_STATICEXPLORATORY { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' : - 'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.8--r43hdfd78af_0' : + 'biocontainers/r-shinyngs:1.8.8--r43hdfd78af_0' }" input: tuple val(meta), path(sample), path(feature_meta), path(assay_files) @@ -43,7 +43,29 @@ process SHINYNGS_STATICEXPLORATORY { cat <<-END_VERSIONS > versions.yml "${task.process}": - r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') + r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))") + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: meta.id + """ + mkdir -p ${prefix}/png ${prefix}/html + touch ${prefix}/png/boxplot.png + touch ${prefix}/html/boxplot.html + touch ${prefix}/png/density.png + touch ${prefix}/html/density.html + touch ${prefix}/png/pca2d.png + touch ${prefix}/html/pca3d.html + touch ${prefix}/png/pca3d.png + touch ${prefix}/html/pca2d.html + touch ${prefix}/png/mad_correlation.png + touch ${prefix}/html/mad_correlation.html + touch ${prefix}/png/sample_dendrogram.png + + cat <<-END_VERSIONS > versions.yml + "${task.process}": r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))") END_VERSIONS """ diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test b/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test new file mode 100644 index 00000000..3338aba1 --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test @@ -0,0 +1,154 @@ +nextflow_process { + + name "Test Process SHINYNGS_STATICEXPLORATORY" + script "../main.nf" + process "SHINYNGS_STATICEXPLORATORY" + + tag "modules" + tag "modules_nfcore" + tag "shinyngs" + tag "shinyngs/staticexploratory" + + test("mouse - defaults") { + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + + input[0] = [ [ "id":"treatment" ], expression_sample_sheet, expression_feature_meta, [ expression_matrix_file ] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.boxplots_png[0][1]).name, + file(process.out.densities_png[0][1]).name, + file(process.out.mad_png[0][1]).name, + file(process.out.pca2d_png[0][1]).name, + file(process.out.pca3d_png[0][1]).name, + file(process.out.dendro[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("mouse - defaults - stub") { + + options "-stub" + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + + input[0] = [ [ "id":"treatment" ], expression_sample_sheet, expression_feature_meta, [ expression_matrix_file ] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.boxplots_png[0][1]).name, + file(process.out.densities_png[0][1]).name, + file(process.out.mad_png[0][1]).name, + file(process.out.pca2d_png[0][1]).name, + file(process.out.pca3d_png[0][1]).name, + file(process.out.dendro[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("mouse - specify log") { + + config './nextflow_specify_log.conf' + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + + input[0] = [ [ "id":"treatment" ], expression_sample_sheet, expression_feature_meta, [ expression_matrix_file ] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.boxplots_png[0][1]).name, + file(process.out.densities_png[0][1]).name, + file(process.out.mad_png[0][1]).name, + file(process.out.pca2d_png[0][1]).name, + file(process.out.pca3d_png[0][1]).name, + file(process.out.dendro[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("mouse - html") { + + config './nextflow_html.conf' + + when { + process { + """ + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true) + expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true) + expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) + + input[0] = [ [ "id":"treatment" ], expression_sample_sheet, expression_feature_meta, [ expression_matrix_file ] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.boxplots_png[0][1]).name, + file(process.out.densities_png[0][1]).name, + file(process.out.mad_png[0][1]).name, + file(process.out.pca2d_png[0][1]).name, + file(process.out.pca3d_png[0][1]).name, + file(process.out.dendro[0][1]).name, + path(process.out.boxplots_html[0][1]).readLines().contains('ENSMUSG00000027456","Gm37080'), + path(process.out.densities_html[0][1]).readLines().contains('-1.4916353753463203,-1.3078530974016225,-1.1240708194569247,-0.94028854151222707'), + path(process.out.mad_html[0][1]).readLines().contains('0,-0.74295280067699376,0.67449075947659531,-0.6744907594765952'), + path(process.out.pca2d_html[0][1]).readLines().contains('SRX8042381","SRX8042382'), + path(process.out.pca3d_html[0][1]).readLines().contains('SRX8042381","SRX8042382'), + process.out.versions + ).match() } + ) + } + + } +} diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test.snap b/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test.snap new file mode 100644 index 00000000..b95d031c --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/main.nf.test.snap @@ -0,0 +1,79 @@ +{ + "mouse - defaults - stub": { + "content": [ + "boxplot.png", + "density.png", + "mad_correlation.png", + "pca2d.png", + "pca3d.png", + "sample_dendrogram.png", + [ + "versions.yml:md5,526fbe61b95ad3a722d7470ca1874ca3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:48:20.908769" + }, + "mouse - defaults": { + "content": [ + "boxplot.png", + "density.png", + "mad_correlation.png", + "pca2d.png", + "pca3d.png", + "sample_dendrogram.png", + [ + "versions.yml:md5,526fbe61b95ad3a722d7470ca1874ca3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:48:06.589763" + }, + "mouse - specify log": { + "content": [ + "boxplot.png", + "density.png", + "mad_correlation.png", + "pca2d.png", + "pca3d.png", + "sample_dendrogram.png", + [ + "versions.yml:md5,526fbe61b95ad3a722d7470ca1874ca3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:48:41.352789" + }, + "mouse - html": { + "content": [ + "boxplot.png", + "density.png", + "mad_correlation.png", + "pca2d.png", + "pca3d.png", + "sample_dendrogram.png", + false, + false, + false, + false, + false, + [ + "versions.yml:md5,526fbe61b95ad3a722d7470ca1874ca3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-03T08:49:04.969108" + } +} \ No newline at end of file diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/nextflow.config b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow.config new file mode 100644 index 00000000..399ac590 --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: 'test_shinyngs_staticexploratory_specify_log:SHINYNGS_STATICEXPLORATORY' { + ext.args = { "--log2_assays '1'" } + } + withName: 'test_shinyngs_staticexploratory_html:SHINYNGS_STATICEXPLORATORY' { + ext.args = { "--write_html" } + } +} \ No newline at end of file diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_html.conf b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_html.conf new file mode 100644 index 00000000..b7a293a4 --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_html.conf @@ -0,0 +1,5 @@ +process { + withName: 'SHINYNGS_STATICEXPLORATORY' { + ext.args = { "--write_html" } + } +} diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_specify_log.conf b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_specify_log.conf new file mode 100644 index 00000000..0872df66 --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/nextflow_specify_log.conf @@ -0,0 +1,5 @@ +process { + withName: 'SHINYNGS_STATICEXPLORATORY' { + ext.args = { "--log2_assays '1'" } + } +} diff --git a/modules/nf-core/shinyngs/staticexploratory/tests/tags.yml b/modules/nf-core/shinyngs/staticexploratory/tests/tags.yml new file mode 100644 index 00000000..8e507165 --- /dev/null +++ b/modules/nf-core/shinyngs/staticexploratory/tests/tags.yml @@ -0,0 +1,2 @@ +shinyngs/staticexploratory: + - "modules/nf-core/shinyngs/staticexploratory/**" diff --git a/modules/nf-core/shinyngs/validatefomcomponents/environment.yml b/modules/nf-core/shinyngs/validatefomcomponents/environment.yml index 9fd7dfd8..4f3067bc 100644 --- a/modules/nf-core/shinyngs/validatefomcomponents/environment.yml +++ b/modules/nf-core/shinyngs/validatefomcomponents/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::r-shinyngs=1.8.5 + - bioconda::r-shinyngs=1.8.8 diff --git a/modules/nf-core/shinyngs/validatefomcomponents/main.nf b/modules/nf-core/shinyngs/validatefomcomponents/main.nf index 88a6153a..fad3948a 100644 --- a/modules/nf-core/shinyngs/validatefomcomponents/main.nf +++ b/modules/nf-core/shinyngs/validatefomcomponents/main.nf @@ -4,8 +4,8 @@ process SHINYNGS_VALIDATEFOMCOMPONENTS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' : - 'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.8--r43hdfd78af_0' : + 'biocontainers/r-shinyngs:1.8.8--r43hdfd78af_0' }" input: tuple val(meta), path(sample), path(assay_files) diff --git a/nextflow.config b/nextflow.config index abb083f8..6390c9bf 100644 --- a/nextflow.config +++ b/nextflow.config @@ -44,7 +44,6 @@ params { features_id_col = 'gene_id' features_name_col = 'gene_name' features_metadata_cols = 'gene_id,gene_name,gene_biotype' - features_log2_assays = null // GTF parsing options features_gtf_feature_type = 'transcript' @@ -86,6 +85,7 @@ params { exploratory_mad_threshold = -5 exploratory_assay_names = "raw,normalised,variance_stabilised" exploratory_final_assay = "variance_stabilised" + exploratory_log2_assays = 'raw,normalised' exploratory_palette_name = 'Set1' // Differential options diff --git a/nextflow_schema.json b/nextflow_schema.json index f131c166..7e329647 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -190,11 +190,6 @@ "default": "gene_id", "description": "Where a GTF file is supplied, which field should go first in the converted output table", "fa_icon": "fas fa-fast-backward" - }, - "features_log2_assays": { - "type": "string", - "description": "Of which assays to compute the log2. Not necessary for maxquant data as this is controlled by the pipeline.", - "help_text": "Either comma-separated of assay positions, e.g. '[1,2,3]', or empty list '[]' to not log any assay. If not set, will guess which assays need to be logged (those with a maximum > 20)." } }, "required": ["features_id_col", "features_name_col", "features_type"], @@ -403,6 +398,11 @@ "description": "Specifies final assay to be used for exploratory analysis, platform-specific", "fa_icon": "fas fa-sort-down" }, + "exploratory_log2_assays": { + "type": "string", + "description": "Of which assays to compute the log2 during exploratory analysis. Not necessary for maxquant data as this is controlled by the pipeline.", + "help_text": "Either comma-separated of assay positions, e.g. '[1,2,3]', or empty list '[]' to not log any assay. If not set, will guess which assays need to be logged (those with a maximum > 20)." + }, "exploratory_palette_name": { "type": "string", "default": "Set1", diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index a8b55d6f..14558c39 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -65,9 +65,15 @@ def checkProfileProvided(nextflow_cli_args) { // Citation string for pipeline // def workflowCitation() { + def temp_doi_ref = "" + String[] manifest_doi = workflow.manifest.doi.tokenize(",") + // Using a loop to handle multiple DOIs + // Removing `https://doi.org/` to handle pipelines using DOIs vs DOI resolvers + // Removing ` ` since the manifest.doi is a string and not a proper list + for (String doi_ref: manifest_doi) temp_doi_ref += " https://doi.org/${doi_ref.replace('https://doi.org/', '').replace(' ', '')}\n" return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + "* The pipeline\n" + - " ${workflow.manifest.doi}\n\n" + + temp_doi_ref + "\n" + "* The nf-core framework\n" + " https://doi.org/10.1038/s41587-020-0439-x\n\n" + "* Software dependencies\n" +