Skip to content

Commit 878b6e7

Browse files
committed
Added compute_gene_scores nftest and standardized format of module
1 parent 8efb6b1 commit 878b6e7

File tree

7 files changed

+136
-5
lines changed

7 files changed

+136
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### `Added`
99

1010
- [#94](https://github.com/nf-core/nanostring/pull/94) - Added nf-tests for local subworkflows normalize and quality_control.
11+
- [#101](https://github.com/nf-core/nanostring/pull/101) - Added nf-test for local module compute_gene_scores.
1112

1213
### `Fixed`
1314

conf/test_scores.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ params {
2424
config_profile_description = 'Minimal test dataset to check pipeline function'
2525

2626
// Input data
27-
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv'
28-
gene_score_yaml = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/gene_score_test.yaml'
27+
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv'
28+
gene_score_yaml = params.pipelines_testdata_base_path + 'nanostring/gene_score_test.yaml'
2929

3030
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: compute_gene_scores
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- bioconda::multiqc=1.24.1
8+
- conda-forge::r-yaml=2.3.7
9+
- conda-forge::r-ggplot2=3.4.4
10+
- conda-forge::r-dplyr=1.1.4
11+
- conda-forge::r-stringr=1.5.0
12+
- bioconda::bioconductor-gsva=1.46.0
13+
- bioconda::bioconductor-singscore=1.18.0
14+
- conda-forge::r-factominer=2.8.0
15+
- conda-forge::r-tibble=3.2.1
16+
- conda-forge::r-matrixstats=1.1.0
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
process COMPUTE_GENE_SCORES {
22
label 'process_single'
33

4-
conda "r-yaml=2.3.7 r-ggplot2=3.4.4 r-dplyr=1.1.4 r-stringr=1.5.0 bioconductor-gsva=1.46.0 bioconductor-singscore=1.18.0 r-factominer=2.8.0 r-tibble=3.2.1 r-matrixstats=1.1.0"
54
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
65
'https://depot.galaxyproject.org/singularity/mulled-v2-e6920e60d80922852a1b19630ebe16754cf5320d:75e2c0a29159bae8a964e43ae16a45c282fdf651-0' :
76
'biocontainers/mulled-v2-e6920e60d80922852a1b19630ebe16754cf5320d:75e2c0a29159bae8a964e43ae16a45c282fdf651-0' }"
@@ -11,8 +10,8 @@ process COMPUTE_GENE_SCORES {
1110
path geneset_yaml
1211

1312
output:
14-
path "*.txt", emit: scores_for_mqc
15-
path "versions.yml" , emit: versions
13+
path "*.txt" , emit: scores_for_mqc
14+
path "versions.yml" , emit: versions
1615

1716
when:
1817
task.ext.when == null || task.ext.when
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: compute_gene_scores
2+
description: calculate gene set enrichment scores using multiple methods.
3+
keywords:
4+
- bioinformatics tools
5+
tools:
6+
- compute_gene_scores:
7+
description: |
8+
Compute gene scores calculates gene set scores using various methods such as Singscore, GSVA, SSGSEA, PLAGE, and Samsscore.
9+
It includes multiple gene set transformations and scoring techniques.
10+
input:
11+
- - counts:
12+
type: file
13+
description: |
14+
A matrix or data frame containing normalized gene counts data.
15+
pattern: "*normalized_counts.tsv"
16+
- - geneset_yaml:
17+
type: file
18+
description: |
19+
This sets the YAML to be used for computing the gene scores. Needs both a name for each set of genes and respective genes to be selected.
20+
output:
21+
- scores_for_mqc:
22+
- "*.txt":
23+
type: file
24+
description: |
25+
A file containing the calculated scores to be used to create the MultiQC report.
26+
pattern: "*.txt"
27+
- versions:
28+
- versions.yml:
29+
type: file
30+
description: File containing software versions
31+
pattern: "versions.yml"
32+
33+
authors:
34+
- "@apeltzer"
35+
- "@christopher-mohr"
36+
maintainers:
37+
- "@nschcolnicov"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
nextflow_process {
2+
3+
name "Test Process COMPUTE_GENE_SCORES"
4+
script "../main.nf"
5+
process "COMPUTE_GENE_SCORES"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "compute_gene_scores"
10+
11+
test("test profile") {
12+
13+
setup {
14+
run("NACHO_NORMALIZE") {
15+
script "../../nacho/normalize.nf"
16+
process {
17+
"""
18+
input[0] = Channel.of(
19+
[
20+
file(params.pipelines_testdata_base_path + 'nanostring/RCC_files/salmon_01_01.RCC', checkIfExists: true),
21+
file(params.pipelines_testdata_base_path + 'nanostring/RCC_files/salmon_02_02.RCC', checkIfExists: true),
22+
file(params.pipelines_testdata_base_path + 'nanostring/RCC_files/salmon_03_03.RCC', checkIfExists: true),
23+
file(params.pipelines_testdata_base_path + 'nanostring/RCC_files/salmon_04_04.RCC', checkIfExists: true)
24+
]
25+
)
26+
input[1] = file(params.pipelines_testdata_base_path + 'nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true)
27+
"""
28+
}
29+
}
30+
}
31+
when {
32+
process {
33+
"""
34+
input[0] = NACHO_NORMALIZE.out.normalized_counts
35+
input[1] = file(params.pipelines_testdata_base_path + 'nanostring/gene_score_test.yaml', checkIfExists: true )
36+
"""
37+
}
38+
}
39+
40+
then {
41+
assertAll(
42+
{ assert process.success },
43+
{ assert snapshot(process.out).match() },
44+
)
45+
}
46+
}
47+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"test profile": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
"signature_scores_mqc.txt:md5,315dc730c79b02067b542074eaeb07b9",
8+
"signature_scores_qc_mqc.txt:md5,88ec48e1d7488357663557b378615923"
9+
]
10+
],
11+
"1": [
12+
"versions.yml:md5,61fc461ef40beb8b95aa31c8ee4d6760"
13+
],
14+
"scores_for_mqc": [
15+
[
16+
"signature_scores_mqc.txt:md5,315dc730c79b02067b542074eaeb07b9",
17+
"signature_scores_qc_mqc.txt:md5,88ec48e1d7488357663557b378615923"
18+
]
19+
],
20+
"versions": [
21+
"versions.yml:md5,61fc461ef40beb8b95aa31c8ee4d6760"
22+
]
23+
}
24+
],
25+
"meta": {
26+
"nf-test": "0.9.0",
27+
"nextflow": "24.10.1"
28+
},
29+
"timestamp": "2024-11-19T18:06:40.93622974"
30+
}
31+
}

0 commit comments

Comments
 (0)