diff --git a/CHANGELOG.md b/CHANGELOG.md index 355dc75..592496b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` -- [#94](https://github.com/nf-core/nanostring/pull/94) - Added nf-tests for local subworkflows normalize and quality_control. +- [#94](https://github.com/nf-core/nanostring/pull/94) - Added nf-tests for local subworkflows `NORMALIZE` and `QUALITY_CONTROL`. - [#100](https://github.com/nf-core/nanostring/pull/100) - Added nf-tests for local module `NACHO_QC`. - [#101](https://github.com/nf-core/nanostring/pull/101) - Added nf-tests for local module `COMPUTE_GENE_SCORES`. +- [#102](https://github.com/nf-core/nanostring/pull/102) - Added nf-tests for local module `CREATE_GENE_HEATMAP`. ### `Fixed` diff --git a/modules/local/create_gene_heatmap/environment.yml b/modules/local/create_gene_heatmap/environment.yml new file mode 100644 index 0000000..57bb8d4 --- /dev/null +++ b/modules/local/create_gene_heatmap/environment.yml @@ -0,0 +1,12 @@ +channels: + - conda-forge + - bioconda +dependencies: + - conda-forge::r-dplyr=1.1.4 + - conda-forge::r-ggplot2=3.4.4 + - conda-forge::r-rlang=1.1.1 + - conda-forge::r-fs=1.6.4 + - bioconda::bioconductor-complexheatmap=2.14.0 + - conda-forge::r-circlize=0.4.15 + - conda-forge::r-yaml=2.3.8 + - conda-forge::r-ragg=1.3.1 diff --git a/modules/local/create_gene_heatmap.nf b/modules/local/create_gene_heatmap/main.nf similarity index 64% rename from modules/local/create_gene_heatmap.nf rename to modules/local/create_gene_heatmap/main.nf index 9b68c14..4af97ff 100644 --- a/modules/local/create_gene_heatmap.nf +++ b/modules/local/create_gene_heatmap/main.nf @@ -1,10 +1,8 @@ process CREATE_GENE_HEATMAP { label 'process_single' - conda "r-dplyr=1.1.4 r-ggplot2=3.4.4 r-rlang=1.1.1 r-fs=1.6.2 bioconductor-complexheatmap=2.14.0 r-circlize=0.4.15 r-yaml=2.3.7 r-ragg=1.2.5" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-2e8e9d8610faa60024ab107974b3decf00600ddc:e99bc7b45df42fd6b3bd3e4019336741e068897b-0' : - 'biocontainers/mulled-v2-2e8e9d8610faa60024ab107974b3decf00600ddc:e99bc7b45df42fd6b3bd3e4019336741e068897b-0' }" + conda "${moduleDir}/environment.yml" + container "community.wave.seqera.io/library/bioconductor-complexheatmap_r-base_r-circlize_r-dplyr_pruned:58d1af3dbaeba617" input: path annotated_counts @@ -27,8 +25,8 @@ process CREATE_GENE_HEATMAP { cat <<-END_VERSIONS > versions.yml "${task.process}": r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') - r-dplyr: \$(Rscript -e "library(tidyverse); cat(as.character(packageVersion('dplyr')))") - r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot')))") + r-dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))") + r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))") r-rlang: \$(Rscript -e "library(rlang); cat(as.character(packageVersion('rlang')))") bioconductor-ComplexHeatmap: \$(Rscript -e "library(ComplexHeatmap); cat(as.character(packageVersion('ComplexHeatmap')))") r-circlize: \$(Rscript -e "library(circlize); cat(as.character(packageVersion('circlize')))") diff --git a/modules/local/create_gene_heatmap/meta.yml b/modules/local/create_gene_heatmap/meta.yml new file mode 100644 index 0000000..19e3f6d --- /dev/null +++ b/modules/local/create_gene_heatmap/meta.yml @@ -0,0 +1,43 @@ +name: create_gene_heatmap +description: Generate a gene count heatmap based on annotated and filtered gene counts data. +keywords: + - bioinformatics tools + - data visualization + - gene heatmap +tools: + - create_gene_heatmap: + description: | + The create_gene_heatmap module generates a heatmap of gene counts. + It supports gene selection via additional files and provides a log-transformed visualization of the data. +input: + - - annotated_counts: + type: file + description: | + A tab-separated file containing annotated counts. + pattern: "*ENDO.tsv" + - - counts: + type: file + description: | + A tab-separated file containing counts data for genes, used when no gene set YAML is provided. + pattern: "*normalized_counts.tsv" + - - heatmap_genes_to_filter: + type: file + description: | + Path to yml file (list, one item per line) to specify which genes should be used for the gene-count heatmap. +output: + - gene_heatmap: + - "*gene_heatmap_mqc.png": + type: file + description: | + A PNG image containing the gene count heatmap, suitable for inclusion in MultiQC reports. + pattern: "*gene_heatmap_mqc.png" + - versions: + - versions.yml: + type: file + description: File containing the software versions. + pattern: "versions.yml" +authors: + - "@apeltzer" + - "@christopher-mohr" +maintainers: + - "@nschcolnicov" diff --git a/modules/local/create_gene_heatmap/tests/main.nf.test b/modules/local/create_gene_heatmap/tests/main.nf.test new file mode 100644 index 0000000..2e884bb --- /dev/null +++ b/modules/local/create_gene_heatmap/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process CREATE_GENE_HEATMAP" + script "../main.nf" + process "CREATE_GENE_HEATMAP" + + tag "modules" + tag "modules_nfcore" + tag "CREATE_GENE_HEATMAP" + + test("test profile") { + + when { + process { + """ + input[0] = file(params.pipelines_testdata_base_path + 'nanostring/modules_test_data/test_profile/counts_Norm_GEX_ENDO.tsv', checkIfExists: true ) + input[1] = file(params.pipelines_testdata_base_path + 'nanostring/modules_test_data/test_profile/normalized_counts.tsv', checkIfExists: true ) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success}, + { assert snapshot( + process.out.gene_heatmap.collect { file(it).name }, //list unstable png files + process.out.versions + ).match() + } + ) + } + } +} diff --git a/modules/local/create_gene_heatmap/tests/main.nf.test.snap b/modules/local/create_gene_heatmap/tests/main.nf.test.snap new file mode 100644 index 0000000..28aab0c --- /dev/null +++ b/modules/local/create_gene_heatmap/tests/main.nf.test.snap @@ -0,0 +1,17 @@ +{ + "test profile": { + "content": [ + [ + "gene_heatmap_mqc.png" + ], + [ + "versions.yml:md5,ce9a0b1b0e476543f0a3ff5b93f6570b" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-19T21:11:06.988380646" + } +} \ No newline at end of file diff --git a/tests/test.nf.test.snap b/tests/test.nf.test.snap index ab2968e..566c02d 100644 --- a/tests/test.nf.test.snap +++ b/tests/test.nf.test.snap @@ -10,14 +10,14 @@ "r-readr": "2.1.5" }, "CREATE_GENE_HEATMAP": { - "r-base": "4.3.2", - "r-dplyr": null, - "r-ggplot2": null, - "r-rlang": "1.1.3", - "bioconductor-ComplexHeatmap": "2.18.0", + "r-base": "4.2.3", + "r-dplyr": "1.1.4", + "r-ggplot2": "3.4.4", + "r-rlang": "1.1.1", + "bioconductor-ComplexHeatmap": "2.14.0", "r-circlize": "0.4.15", - "r-yaml": "2.3.7", - "r-fs": "1.6.2" + "r-yaml": "2.3.8", + "r-fs": "1.6.4" }, "NACHO_NORMALIZE": { "r-base": "4.3.2", @@ -115,6 +115,6 @@ "nf-test": "0.9.0", "nextflow": "24.10.1" }, - "timestamp": "2024-11-19T17:52:59.774386953" + "timestamp": "2024-11-19T21:23:55.334879021" } -} \ No newline at end of file +} diff --git a/tests/test_samples.nf.test.snap b/tests/test_samples.nf.test.snap index 62a9ef3..255eddc 100644 --- a/tests/test_samples.nf.test.snap +++ b/tests/test_samples.nf.test.snap @@ -10,14 +10,14 @@ "r-readr": "2.1.5" }, "CREATE_GENE_HEATMAP": { - "r-base": "4.3.2", - "r-dplyr": null, - "r-ggplot2": null, - "r-rlang": "1.1.3", - "bioconductor-ComplexHeatmap": "2.18.0", + "r-base": "4.2.3", + "r-dplyr": "1.1.4", + "r-ggplot2": "3.4.4", + "r-rlang": "1.1.1", + "bioconductor-ComplexHeatmap": "2.14.0", "r-circlize": "0.4.15", - "r-yaml": "2.3.7", - "r-fs": "1.6.2" + "r-yaml": "2.3.8", + "r-fs": "1.6.4" }, "NACHO_NORMALIZE": { "r-base": "4.3.2", @@ -115,6 +115,6 @@ "nf-test": "0.9.0", "nextflow": "24.10.1" }, - "timestamp": "2024-11-19T17:54:15.75754715" + "timestamp": "2024-11-19T21:24:55.10531256" } -} \ No newline at end of file +} diff --git a/tests/test_scores.nf.test.snap b/tests/test_scores.nf.test.snap index 640e66d..01bbf1a 100644 --- a/tests/test_scores.nf.test.snap +++ b/tests/test_scores.nf.test.snap @@ -21,14 +21,14 @@ "r-readr": "2.1.5" }, "CREATE_GENE_HEATMAP": { - "r-base": "4.3.2", - "r-dplyr": null, - "r-ggplot2": null, - "r-rlang": "1.1.3", - "bioconductor-ComplexHeatmap": "2.18.0", + "r-base": "4.2.3", + "r-dplyr": "1.1.4", + "r-ggplot2": "3.4.4", + "r-rlang": "1.1.1", + "bioconductor-ComplexHeatmap": "2.14.0", "r-circlize": "0.4.15", - "r-yaml": "2.3.7", - "r-fs": "1.6.2" + "r-yaml": "2.3.8", + "r-fs": "1.6.4" }, "NACHO_NORMALIZE": { "r-base": "4.3.2", @@ -141,6 +141,6 @@ "nf-test": "0.9.0", "nextflow": "24.10.1" }, - "timestamp": "2024-11-19T17:57:05.905578506" + "timestamp": "2024-11-19T21:26:05.626984239" } -} \ No newline at end of file +}