Skip to content

Commit ea29ed6

Browse files
committed
resolve conflicts
2 parents 8efb6b1 + 36d306b commit ea29ed6

File tree

7 files changed

+116
-2
lines changed

7 files changed

+116
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- [#82](https://github.com/nf-core/nanostring/pull/82) - Updated to nf-core template 3.0.2
1717
- [#95](https://github.com/nf-core/nanostring/pull/95) - Add pipeline level nf-tests.
1818
- [#96](https://github.com/nf-core/nanostring/pull/96) - Remove timestamp suffix from nacho_norm.R and write_out_prepared_gex.R
19+
- [#99](https://github.com/nf-core/nanostring/pull/99) - Add nf-test for local module nacho_normalize.
1920

2021
### `Dependencies`
2122

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- conda-forge::r-nacho=2.0.6
5+
- conda-forge::r-dplyr=1.2.2
6+
- conda-forge::r-ggplot2=3.4.4
7+
- conda-forge::r-fs=1.6.2
8+
- conda-forge::r-readr=2.1.5
9+
- conda-forge::r-tidyr=1.3.0
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
process NACHO_NORMALIZE {
2+
tag '$sample_sheet'
23
label 'process_single'
34

4-
conda "r-nacho=2.0.6 r-dplyr=1.2.2 r-ggplot2=3.4.4 r-fs=1.6.2 r-readr=2.1.5 r-tidyr=1.3.0"
5+
conda "${moduleDir}/environment.yml"
56
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
67
'https://depot.galaxyproject.org/singularity/mulled-v2-9d27fb90b747ac2e521703d90daacce9cc1f33c5:98395a5d2e19da46499873cd2d76be73d6a0950d-0' :
78
'biocontainers/mulled-v2-9d27fb90b747ac2e521703d90daacce9cc1f33c5:98395a5d2e19da46499873cd2d76be73d6a0950d-0' }"
@@ -35,4 +36,22 @@ process NACHO_NORMALIZE {
3536
r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))")
3637
END_VERSIONS
3738
"""
39+
40+
stub:
41+
def args = task.ext.args ?: ''
42+
"""
43+
touch normalized_counts.tsv
44+
touch normalized_counts_wo_HKnorm.tsv
45+
46+
cat <<-END_VERSIONS > versions.yml
47+
"${task.process}":
48+
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
49+
r-nacho: \$(Rscript -e "library(NACHO); cat(as.character(packageVersion('NACHO')))")
50+
r-dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))")
51+
r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))")
52+
r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))")
53+
r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))")
54+
r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))")
55+
END_VERSIONS
56+
"""
3857
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
nextflow_process {
2+
3+
name "Test Process NACHO_NORMALIZE"
4+
script "../main.nf"
5+
process "NACHO_NORMALIZE"
6+
7+
test("Should run without failures") {
8+
9+
when {
10+
params {
11+
pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/'
12+
input = params.pipelines_testdata_base_path + 'nanostring/samplesheets/samplesheet_test.csv'
13+
}
14+
process {
15+
"""
16+
// RCC Files: Collect from samplesheet
17+
input[0] = Channel.fromPath(params.input, checkIfExists: true)
18+
.splitCsv(header: true)
19+
.map { row -> row.RCC_FILE } // Select first column: path to file
20+
.collect()
21+
22+
// Sample sheet
23+
input[1] = file(params.input, checkIfExists: true)
24+
"""
25+
}
26+
}
27+
28+
then {
29+
assert process.success
30+
assert snapshot(process.out).match()
31+
}
32+
33+
}
34+
35+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"Should run without failures": {
3+
"content": [
4+
{
5+
"0": [
6+
"normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f"
7+
],
8+
"1": [
9+
"normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e"
10+
],
11+
"2": [
12+
"versions.yml:md5,dd0bb0b151596e1316c29a51f38f5a2e"
13+
],
14+
"normalized_counts": [
15+
"normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f"
16+
],
17+
"normalized_counts_wo_HK": [
18+
"normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e"
19+
],
20+
"versions": [
21+
"versions.yml:md5,dd0bb0b151596e1316c29a51f38f5a2e"
22+
]
23+
}
24+
],
25+
"meta": {
26+
"nf-test": "0.9.0",
27+
"nextflow": "24.10.1"
28+
},
29+
"timestamp": "2024-11-19T15:00:56.669733561"
30+
}
31+
}

subworkflows/local/normalize.nf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// Perform normalizations (currently using Nacho)
3+
//
4+
5+
include { NACHO_NORMALIZE } from '../../modules/local/nacho/normalize/main'
6+
7+
workflow NORMALIZE {
8+
take:
9+
counts // channel: [ meta, path(rcc) ]
10+
samplesheet // file: /path/to/samplesheet.csv
11+
12+
main:
13+
NACHO_NORMALIZE ( counts, samplesheet )
14+
15+
emit:
16+
normalized_counts = NACHO_NORMALIZE.out.normalized_counts // channel: [ val(meta), [ counts ] ]
17+
normalized_counts_wo_HK = NACHO_NORMALIZE.out.normalized_counts_wo_HK // channel: [ samplesheet.valid.csv ]
18+
versions = NACHO_NORMALIZE.out.versions // channel: [ versions.yml ]
19+
}

subworkflows/local/normalize/main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Perform normalizations (currently using Nacho)
33
//
44

5-
include { NACHO_NORMALIZE } from '../../../modules/local/nacho/normalize'
5+
include { NACHO_NORMALIZE } from '../../../modules/local/nacho/normalize/main'
66

77
workflow NORMALIZE {
88
take:

0 commit comments

Comments
 (0)