Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create gene heatmap nftest #102

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
12 changes: 12 additions & 0 deletions modules/local/create_gene_heatmap/environment.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')))")
Expand Down
43 changes: 43 additions & 0 deletions modules/local/create_gene_heatmap/meta.yml
Original file line number Diff line number Diff line change
@@ -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:
atrigila marked this conversation as resolved.
Show resolved Hide resolved
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"
34 changes: 34 additions & 0 deletions modules/local/create_gene_heatmap/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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()
}
)
}
}
}
17 changes: 17 additions & 0 deletions modules/local/create_gene_heatmap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
18 changes: 9 additions & 9 deletions tests/test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
}
18 changes: 9 additions & 9 deletions tests/test_samples.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
}
18 changes: 9 additions & 9 deletions tests/test_scores.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
}
Loading