Skip to content

Commit 9fa6a00

Browse files
committed
update tests
1 parent 6e45682 commit 9fa6a00

11 files changed

Lines changed: 1181 additions & 95 deletions

tests/default.nf.test

Lines changed: 198 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,206 @@
11
nextflow_pipeline {
22

3-
name "Test pipeline"
3+
name "Test Workflow main.nf - DIFFERENTIALABUNDANCE (test)"
44
script "../main.nf"
5+
tag "test"
56
tag "pipeline"
7+
config "../conf/rnaseq.config"
8+
profile "test"
69

7-
test("-profile test") {
10+
test("Test profile - with toolsheet") {
811

912
when {
1013
params {
11-
outdir = "$outputDir"
14+
outdir = "$outputDir"
15+
paramset_name = "deseq2_rnaseq_gsea"
16+
differential_method = null
17+
functional_method = null
18+
19+
study_name = 'SRP254919'
20+
config_profile_name = 'Test profile'
21+
config_profile_description = 'Minimal test dataset to check pipeline function'
22+
23+
// Input data
24+
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.csv'
25+
matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.tsv'
26+
transcript_length_matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.spoofed_lengths.tsv'
27+
contrasts_yml = 'https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/differentialabundance/testdata/SRP254919.contrasts.yaml'
28+
29+
// To do: replace this with a cut-down mouse GTF matching the matrix for testing
30+
gtf = 'https://ftp.ensembl.org/pub/release-81/gtf/mus_musculus/Mus_musculus.GRCm38.81.gtf.gz'
31+
32+
// Observations
33+
observations_id_col = 'sample'
34+
observations_name_col = 'sample'
35+
36+
// Apply a higher filter to check that the filtering works
37+
filtering_min_abundance = 10
38+
39+
// Exploratory
40+
exploratory_main_variable = 'contrasts'
41+
42+
// Test dataset is too small for the nsub default value
43+
deseq2_vst_nsub = 500
44+
45+
// IMMUNEDECONV
46+
immunedeconv_run = true
47+
immunedeconv_method = "mmcp_counter"
48+
immunedeconv_function = "deconvolute_mouse"
49+
50+
// Activate GSEA
51+
functional_method = 'gsea'
52+
gene_sets_files = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/gene_set_analysis/mh.all.v2022.1.Mm.symbols.gmt'
53+
gsea_rnd_seed = '10'
54+
55+
// Report options
56+
report_contributors = 'Jane Doe\nDirector of Institute of Microbiology\nUniversity of Smallville;John Smith\nPhD student\nInstitute of Microbiology\nUniversity of Smallville'
57+
58+
// Other
59+
round_digits = 3
60+
61+
}
62+
}
63+
64+
then {
65+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
66+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
67+
// stable_path: All files in ${params.outdir}/ with stable content
68+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
69+
assertAll(
70+
{ assert workflow.success},
71+
{ assert snapshot(
72+
// Number of successful tasks
73+
workflow.trace.succeeded().size(),
74+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
75+
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
76+
// All stable path name, with a relative path
77+
stable_name,
78+
// All files with stable contents
79+
stable_path
80+
).match() }
81+
)
82+
}
83+
}
84+
85+
test("Test profile - csv contrasts") { // make sure we keep backwards compatibility with csv contrasts
86+
87+
when {
88+
params {
89+
90+
study_name = 'SRP254919'
91+
config_profile_name = 'Test profile'
92+
config_profile_description = 'Minimal test dataset to check pipeline function'
93+
94+
// Input data
95+
96+
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.csv'
97+
matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.tsv'
98+
transcript_length_matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.spoofed_lengths.tsv'
99+
contrasts_yml = 'https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/differentialabundance/testdata/SRP254919.contrasts.yaml'
100+
101+
// To do: replace this with a cut-down mouse GTF matching the matrix for testing
102+
gtf = 'https://ftp.ensembl.org/pub/release-81/gtf/mus_musculus/Mus_musculus.GRCm38.81.gtf.gz'
103+
104+
// Observations
105+
observations_id_col = 'sample'
106+
observations_name_col = 'sample'
107+
108+
// Apply a higher filter to check that the filtering works
109+
filtering_min_abundance = 10
110+
111+
// Exploratory
112+
exploratory_main_variable = 'contrasts'
113+
114+
// Test dataset is too small for the nsub default value
115+
deseq2_vst_nsub = 500
116+
117+
// IMMUNEDECONV
118+
immunedeconv_run = true
119+
immunedeconv_method = "mmcp_counter"
120+
immunedeconv_function = "deconvolute_mouse"
121+
122+
// Activate GSEA
123+
functional_method = 'gsea'
124+
gene_sets_files = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/gene_set_analysis/mh.all.v2022.1.Mm.symbols.gmt'
125+
gsea_rnd_seed = '10'
126+
127+
// Report options
128+
report_contributors = 'Jane Doe\nDirector of Institute of Microbiology\nUniversity of Smallville;John Smith\nPhD student\nInstitute of Microbiology\nUniversity of Smallville'
129+
130+
// Other
131+
round_digits = 3
132+
outdir = "$outputDir"
133+
contrasts_yml = null
134+
contrasts = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.contrasts.csv"
135+
}
136+
}
137+
138+
then {
139+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
140+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
141+
// stable_path: All files in ${params.outdir}/ with stable content
142+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
143+
assertAll(
144+
{ assert workflow.success},
145+
{ assert snapshot(
146+
// Number of successful tasks
147+
workflow.trace.succeeded().size(),
148+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
149+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_versions.yml"),
150+
// All stable path name, with a relative path
151+
stable_name,
152+
// All files with stable contents
153+
stable_path
154+
).match() }
155+
)
156+
}
157+
}
158+
test("Test profile - yml no formula") { // make sure we keep backwards compatibility with yaml contrasts that don't use formula
159+
160+
when {
161+
params {
162+
study_name = 'SRP254919'
163+
config_profile_name = 'Test profile'
164+
config_profile_description = 'Minimal test dataset to check pipeline function'
165+
166+
// Input data
167+
168+
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.samplesheet.csv'
169+
matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.tsv'
170+
transcript_length_matrix = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.spoofed_lengths.tsv'
171+
contrasts_yml = 'https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/differentialabundance/testdata/SRP254919.contrasts.yaml'
172+
173+
// To do: replace this with a cut-down mouse GTF matching the matrix for testing
174+
gtf = 'https://ftp.ensembl.org/pub/release-81/gtf/mus_musculus/Mus_musculus.GRCm38.81.gtf.gz'
175+
176+
// Observations
177+
observations_id_col = 'sample'
178+
observations_name_col = 'sample'
179+
180+
// Apply a higher filter to check that the filtering works
181+
filtering_min_abundance = 10
182+
183+
// Exploratory
184+
exploratory_main_variable = 'contrasts'
185+
186+
// Test dataset is too small for the nsub default value
187+
deseq2_vst_nsub = 500
188+
189+
// IMMUNEDECONV
190+
immunedeconv_run = true
191+
immunedeconv_method = "mmcp_counter"
192+
immunedeconv_function = "deconvolute_mouse"
193+
194+
// Activate GSEA
195+
functional_method = 'gsea'
196+
gene_sets_files = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/gene_set_analysis/mh.all.v2022.1.Mm.symbols.gmt'
197+
gsea_rnd_seed = '10'
198+
199+
// Report options
200+
report_contributors = 'Jane Doe\nDirector of Institute of Microbiology\nUniversity of Smallville;John Smith\nPhD student\nInstitute of Microbiology\nUniversity of Smallville'
201+
202+
203+
outdir = "$outputDir"
12204
}
13205
}
14206

@@ -22,14 +214,14 @@ nextflow_pipeline {
22214
{ assert snapshot(
23215
// Number of successful tasks
24216
workflow.trace.succeeded().size(),
25-
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
26-
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_mqc_versions.yml"),
217+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
218+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_versions.yml"),
27219
// All stable path name, with a relative path
28220
stable_name,
29221
// All files with stable contents
30222
stable_path
31223
).match() }
32-
)
224+
)
33225
}
34226
}
35227
}

0 commit comments

Comments
 (0)