Skip to content

Commit 409697f

Browse files
committed
add test case for new zero intercept models
1 parent a4bd9ee commit 409697f

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
contrasts:
2+
- id: treatment_effect_classic_comparison
3+
comparison: ["treatment", "Control", "Treated"]
4+
5+
- id: treatment_plus_genotype
6+
formula: "~ treatment + genotype"
7+
make_contrasts_str: "treatmentTreated"
8+
9+
- id: interaction_genotype_treatment
10+
formula: "~ genotype * treatment"
11+
make_contrasts_str: "genotypeWT.treatmentTreated"
12+
13+
- id: full_model_with_interactions
14+
formula: "~ genotype * treatment * time"
15+
make_contrasts_str: "genotypeWT.treatmentTreated.time"
16+
17+
- id: zero_intercept_model_1
18+
formula: "~ 0 + genotype"
19+
make_contrasts_str: "genotypeWT"
20+
21+
- id: zero_intercept_model_2
22+
formula: "~ genotype - 1"
23+
make_contrasts_str: "genotypeWT"

tests/test_rnaseq_dream.nf.test

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,33 @@ nextflow_pipeline {
6767
}
6868
}
6969

70+
test("Test rnaseq dream profile - complex contrast - with zero intercept") {
71+
when {
72+
params {
73+
outdir = "$outputDir"
74+
contrasts_yml = "$projectDir/tests/assets/zero_intercept_contrasts.yml"
75+
}
76+
}
77+
78+
then {
79+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
80+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
81+
// stable_path: All files in ${params.outdir}/ with stable content
82+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
83+
assertAll(
84+
{ assert workflow.success},
85+
{ assert snapshot(
86+
// Number of successful tasks
87+
workflow.trace.succeeded().size(),
88+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
89+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_versions.yml"),
90+
// All stable path name, with a relative path
91+
stable_name,
92+
// All files with stable contents
93+
stable_path
94+
).match() }
95+
)
96+
}
97+
}
98+
7099
}

tests/test_rnaseq_dream.nf.test.snap

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,59 @@
9898
"nextflow": "25.04.6"
9999
},
100100
"timestamp": "2025-07-30T16:32:49.712383975"
101+
},
102+
"Test rnaseq dream profile - complex contrast - with zero intercept": {
103+
"content": [
104+
14,
105+
{
106+
"CUSTOM_FILTERDIFFERENTIALTABLE": {
107+
"pandas": "1.5.2"
108+
},
109+
"GTF_TO_TABLE": {
110+
"atlas-gene-annotation-manipulation": "1.1.1"
111+
},
112+
"GUNZIP_GTF": {
113+
"gunzip": 1.1
114+
},
115+
"VALIDATOR": {
116+
"r-shinyngs": "2.2.4"
117+
},
118+
"VARIANCEPARTITION_DREAM": {
119+
"r-base": "4.3.3",
120+
"bioconductor-edger": "4.0.16",
121+
"variancePartition": "1.32.2"
122+
},
123+
"Workflow": {
124+
"nf-core/differentialabundance": "v1.6.0dev"
125+
}
126+
},
127+
[
128+
"pipeline_info",
129+
"pipeline_info/collated_versions.yml",
130+
"pipeline_info/nf_core_differentialabundance_software_versions.yml",
131+
"tables",
132+
"tables/annotation",
133+
"tables/annotation/SRP254919.anno.tsv",
134+
"tables/differential",
135+
"tables/differential/full_model_with_interactions_SRP254919.dream.results.tsv",
136+
"tables/differential/full_model_with_interactions_SRP254919.dream.results_filtered.tsv",
137+
"tables/differential/interaction_genotype_treatment_SRP254919.dream.results.tsv",
138+
"tables/differential/interaction_genotype_treatment_SRP254919.dream.results_filtered.tsv",
139+
"tables/differential/treatment_plus_genotype_SRP254919.dream.results.tsv",
140+
"tables/differential/treatment_plus_genotype_SRP254919.dream.results_filtered.tsv",
141+
"tables/differential/zero_intercept_model_1_SRP254919.dream.results.tsv",
142+
"tables/differential/zero_intercept_model_1_SRP254919.dream.results_filtered.tsv",
143+
"tables/differential/zero_intercept_model_2_SRP254919.dream.results.tsv",
144+
"tables/differential/zero_intercept_model_2_SRP254919.dream.results_filtered.tsv"
145+
],
146+
[
147+
"SRP254919.anno.tsv:md5,c1d7f21e64bd00f845ec6545c123a1fb"
148+
]
149+
],
150+
"meta": {
151+
"nf-test": "0.9.2",
152+
"nextflow": "25.04.7"
153+
},
154+
"timestamp": "2025-10-01T17:12:51.093884289"
101155
}
102156
}

0 commit comments

Comments
 (0)