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

Update: create test nacho normalize #99

Merged
merged 21 commits into from
Nov 21, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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`.
- [#99](https://github.com/nf-core/nanostring/pull/99) - Added nf-tests for local module `NACHO_NORMALIZE`.
- [#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`.
Expand Down
9 changes: 9 additions & 0 deletions modules/local/nacho/normalize/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
channels:
- conda-forge
dependencies:
- conda-forge::r-dplyr=1.1.4
- conda-forge::r-fs=1.6.4
- conda-forge::r-ggplot2=3.4.4
- conda-forge::r-nacho=2.0.6
- conda-forge::r-readr=2.1.5
- conda-forge::r-tidyr=1.3.0
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
process NACHO_NORMALIZE {
tag "$sample_sheet"
label 'process_single'

conda "r-nacho=2.0.6 r-dplyr=1.1.4 r-ggplot2=3.4.4 r-fs=1.6.4 r-readr=2.1.5 r-tidyr=1.3.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-9d27fb90b747ac2e521703d90daacce9cc1f33c5:98395a5d2e19da46499873cd2d76be73d6a0950d-0' :
'biocontainers/mulled-v2-9d27fb90b747ac2e521703d90daacce9cc1f33c5:98395a5d2e19da46499873cd2d76be73d6a0950d-0' }"
conda "${moduleDir}/environment.yml"
container "community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:9bb487ee68105a77"

input:
path rcc_files
Expand Down Expand Up @@ -35,4 +34,22 @@ process NACHO_NORMALIZE {
r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))")
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
"""
touch normalized_counts.tsv
touch normalized_counts_wo_HKnorm.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
r-nacho: \$(Rscript -e "library(NACHO); cat(as.character(packageVersion('NACHO')))")
r-dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))")
r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))")
r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))")
r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))")
r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))")
END_VERSIONS
"""
}
33 changes: 33 additions & 0 deletions modules/local/nacho/normalize/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
nextflow_process {

name "Test Process NACHO_NORMALIZE"
script "../main.nf"
process "NACHO_NORMALIZE"
tag "modules"

test("Should run without failures") {

when {
process {
"""
// RCC Files: Collect from sample sheet
input[0] = Channel.fromPath(params.pipelines_testdata_base_path + 'nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true)
.splitCsv(header: true)
.map { row -> row.RCC_FILE } // Select first column: path to file
.collect()

// Sample sheet
input[1] = file(params.pipelines_testdata_base_path + 'nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
31 changes: 31 additions & 0 deletions modules/local/nacho/normalize/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"Should run without failures": {
"content": [
{
"0": [
"normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f"
],
"1": [
"normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e"
],
"2": [
"versions.yml:md5,0b8556f7dd763f21894470ecc737ca3b"
],
"normalized_counts": [
"normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f"
],
"normalized_counts_wo_HK": [
"normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e"
],
"versions": [
"versions.yml:md5,0b8556f7dd763f21894470ecc737ca3b"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-19T19:00:09.938938106"
}
}
2 changes: 1 addition & 1 deletion subworkflows/local/normalize/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Perform normalizations (currently using Nacho)
//

include { NACHO_NORMALIZE } from '../../../modules/local/nacho/normalize'
include { NACHO_NORMALIZE } from '../../../modules/local/nacho/normalize/main'
nschcolnicov marked this conversation as resolved.
Show resolved Hide resolved

workflow NORMALIZE {
take:
Expand Down
4 changes: 2 additions & 2 deletions tests/test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"r-fs": "1.6.4"
},
"NACHO_NORMALIZE": {
"r-base": "4.3.2",
"r-base": "4.3.3",
"r-nacho": "2.0.6",
"r-dplyr": "1.1.4",
"r-ggplot2": "3.4.4",
"r-tidyr": "1.3.0",
"r-readr": "2.1.5",
"r-fs": "1.6.2"
"r-fs": "1.6.4"
},
"NACHO_QC": {
"r-base": "4.3.3",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_samples.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"r-fs": "1.6.4"
},
"NACHO_NORMALIZE": {
"r-base": "4.3.2",
"r-base": "4.3.3",
"r-nacho": "2.0.6",
"r-dplyr": "1.1.4",
"r-ggplot2": "3.4.4",
"r-tidyr": "1.3.0",
"r-readr": "2.1.5",
"r-fs": "1.6.2"
"r-fs": "1.6.4"
},
"NACHO_QC": {
"r-base": "4.3.3",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_scores.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"r-fs": "1.6.4"
},
"NACHO_NORMALIZE": {
"r-base": "4.3.2",
"r-base": "4.3.3",
"r-nacho": "2.0.6",
"r-dplyr": "1.1.4",
"r-ggplot2": "3.4.4",
"r-tidyr": "1.3.0",
"r-readr": "2.1.5",
"r-fs": "1.6.2"
"r-fs": "1.6.4"
},
"NACHO_QC": {
"r-base": "4.3.3",
Expand Down Expand Up @@ -138,9 +138,9 @@
]
],
"meta": {
"nf-test": "0.9.0",
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-19T21:26:05.626984239"
"timestamp": "2024-11-20T20:01:05.948521351"
}
}
}
Loading