Skip to content

Commit 63f78bb

Browse files
authored
Merge pull request #425 from ggabernet/nf-test
Add nf-tests
2 parents 6e7e2e3 + 8295f74 commit 63f78bb

39 files changed

Lines changed: 7914 additions & 56 deletions

.nf-core.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
lint:
22
files_exist:
33
- conf/igenomes.config
4-
included_configs: false
54
multiqc_config:
65
- report_comment
76
nextflow_config:

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111
- [#413](https://github.com/nf-core/airrflow/pull/413) Updated nf-core template to v3.3.2.
1212
- [#413](https://github.com/nf-core/airrflow/pull/413) Speeding up tests with smaller test data.
1313
- [#416](https://github.com/nf-core/airrflow/pull/416) Update Takara protocol names and docs. Add Takara SMART-seq protocol.
14-
- [#416](https://github.com/nf-core/airrflow/pull/416) Add nf-test tests.
14+
- [#416](https://github.com/nf-core/airrflow/pull/416) Add first nf-test.
1515
- [#422](https://github.com/nf-core/airrflow/pull/422) Template update to nf-core v3.4.1
16+
- [#425](https://github.com/nf-core/airrflow/pull/416) Add all nf-tests.
1617

1718
### `Fixed`
1819

@@ -29,10 +30,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2930

3031
| Dependency | Old version | New version |
3132
| ---------- | ----------- | ----------- |
32-
| enchantr | 0.1.20 | 0.1.23 |
33+
| enchantr | 0.1.20 | 0.1.24 |
3334
| presto | 0.7.4 | 0.7.6 |
34-
| dowser | 2.3 | |
35-
| alakazam | 1.3.1 | |
35+
| dowser | 2.3 | 2.4.0 |
3636

3737
## [4.3.1] - Revelio hotfix
3838

assets/repertoire_comparison.Rmd

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,7 @@ tryCatch( {
9393
ggtitle("Number of sequences after each of the sequence assembly steps") +
9494
theme(axis.text.x= element_text(angle = 45))
9595
96-
p <- ggplotly(seqs_plot) %>%
97-
layout(shapes = list(list(type = "rect",
98-
xref = "paper", yref = "paper",
99-
x0 = -0.02, x1 = 1.02, y0 = -0.02, y1 = 1.02,
100-
line = list(color = "black", width = 1.5),
101-
fillcolor = 'rgba(0,0,0,0)',
102-
layer = 'above')))
96+
p <- ggplotly(seqs_plot)
10397
p
10498
10599
@@ -130,6 +124,8 @@ if (is.null(tab_seqs_assembled$sample_id)) {
130124
}
131125
132126
dat <- tab_seqs_assembled %>%
127+
filter( !grepl("-fail.tsv", output) ) %>%
128+
filter( !grepl("productive-F.tsv", output) ) %>%
133129
tidyr::pivot_wider(id_cols=sample_id,
134130
names_from=task,
135131
values_from=output_size)
@@ -171,11 +167,7 @@ seqs_plot_assembled <- ggplot(data=tab_seqs_assembled,
171167
theme(axis.text.x = element_text(angle = 45)
172168
)
173169
174-
p <- ggplotly(seqs_plot_assembled) |>
175-
layout(
176-
xaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE),
177-
yaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE)
178-
)
170+
p <- ggplotly(seqs_plot_assembled)
179171
p
180172
```
181173

@@ -218,11 +210,7 @@ g2 <- ggplot(family, aes(x=gene, y=seq_freq, fill=sample_id, group=sample_id)) +
218210
ylab("Frequency") +
219211
xlab("") +
220212
theme(legend.position = "right")
221-
p <- ggplotly(g2) |>
222-
layout(
223-
xaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE),
224-
yaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE)
225-
)
213+
p <- ggplotly(g2)
226214
p
227215
228216
ggsave(filename = paste0(vfamily_dir, "/V_Family_distribution_patient.pdf"), plot = g2, width = 18, height = 15, units = "cm")
@@ -247,11 +235,7 @@ g2 <- ggplot(family, aes(x=gene, y=seq_freq, fill=sample_id, group=sample_id)) +
247235
theme(axis.text.x=element_text(angle=45, hjust=1, vjust=1)) +
248236
ylab("Frequency") +
249237
xlab("")
250-
p <- ggplotly(g2) |>
251-
layout(
252-
xaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE),
253-
yaxis = list(showline = TRUE, linecolor = "black", linewidth = 0.66, mirror = TRUE)
254-
)
238+
p <- ggplotly(g2)
255239
p
256240
ggsave(filename = paste0(vfamily_dir, "/V_gene_distribution_by_sequence_patient.pdf"), plot = g2, width = 20, height = 40, units = "cm")
257241
ggsave(filename = paste0(vfamily_dir, "/V_gene_distribution_by_sequence_patient.png"), plot = g2, width = 20, height = 40, units = "cm")

conf/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ process {
495495
// V(D)J annotation
496496
// -----------------
497497

498-
withName: 'FETCH_*' {
498+
withName: 'FETCH_DATABASES' {
499499
publishDir = [
500500
path: { "${params.outdir}/databases" },
501501
mode: params.publish_dir_mode,

conf/test_fetchimgt.config

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,9 @@ params {
2222
config_profile_description = 'Test pipeline when fetching the latest version of the IMGT references.'
2323

2424
// Input data
25-
input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_small_test_airr.tsv'
26-
cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta'
27-
vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta'
25+
mode = 'assembled'
26+
input = pipelines_testdata_base_path + 'testdata-reveal/test_assembled_metadata_hs.tsv'
2827
fetch_imgt = true
29-
30-
mode = 'fastq'
31-
32-
library_generation_method = 'specific_pcr_umi'
33-
cprimer_position = 'R1'
34-
umi_length = 8
35-
umi_start = 6
36-
umi_position = 'R1'
37-
index_file = true
3828
}
3929

4030
process{

conf/test_full.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ params {
3737
lineage_trees = true
3838
embeddings = 'antiberty,antiberta2,balmpaired,esm2'
3939
embedding_chain = "HL"
40-
use_gpu = true
40+
use_gpu = false // Megatest infrastructure not ready yet for GPU
4141
}
4242

4343
process {

tests/.nftignore

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ pipeline_info/*.{html,json,txt,yml}
2424
**/*.fmt7
2525
**/*.RDS
2626
**/*.fastp.log
27-
presto/**/*
28-
vdj_annotation/01-assign-genes/**/*
29-
vdj_annotation/02-make-db/**/*
30-
vdj_annotation/04-select-productive/**/*
27+
**/*.bam
28+
**/*.bam.bai
29+
**/*.vloupe
30+
presto/**
31+
vdj_annotation/01-assign-genes/**
32+
vdj_annotation/02-make-db/**
33+
vdj_annotation/04-select-productive/**
34+
vdj_annotation/convert-db/**
35+
qc-filtering/bulk-qc-filtering/01-create-germlines/**
36+
vdj_annotation/select-locus/**/*
37+
databases/**
3138
**/reference-keys.txt

tests/default.nf.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ nextflow_pipeline {
2828
// All stable path name, with a relative path
2929
stable_name,
3030
// All files with stable contents
31-
stable_path
31+
stable_path,
32+
// Additional files that are excluded in .nftignore but need to be checked
33+
"$outputDir/repertoire_comparison/Sequence_numbers_summary/Table_sequences_assembled.tsv",
34+
"$outputDir/repertoire_comparison/Sequence_numbers_summary/Table_sequences_assembly.tsv"
3235
).match() }
3336
)
3437
}

tests/default.nf.test.snap

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"changeo": "1.3.0"
2929
},
3030
"CLONAL_ASSIGNMENT_COMPUTE": {
31-
"enchantr": "0.1.23"
31+
"enchantr": "0.1.24"
3232
},
3333
"CLONAL_ASSIGNMENT_REPORT": {
34-
"enchantr": "0.1.23"
34+
"enchantr": "0.1.24"
3535
},
3636
"COLLAPSE_DUPLICATES": {
37-
"enchantr": "0.1.23"
37+
"enchantr": "0.1.24"
3838
},
3939
"DOWSER_LINEAGES": {
40-
"enchantr": "0.1.23"
40+
"enchantr": "0.1.24"
4141
},
4242
"FASTP": {
4343
"fastp": "0.23.4"
@@ -54,14 +54,14 @@
5454
"FILTER_QUALITY": {
5555
"alakazam": "1.3.1",
5656
"optparse": "1.7.5",
57-
"stringi": "1.8.7",
57+
"stringi": "1.8.3",
5858
"dplyr": "1.1.4",
5959
"airr": "1.5.0",
6060
"DT": "0.34.0",
6161
"R": "4.5.1"
6262
},
6363
"FIND_CLONAL_THRESHOLD": {
64-
"enchantr": "0.1.23"
64+
"enchantr": "0.1.24"
6565
},
6666
"GUNZIP_UMI": {
6767
"gunzip": 1.1
@@ -121,7 +121,7 @@
121121
"presto": "0.7.6"
122122
},
123123
"REPORT_FILE_SIZE": {
124-
"enchantr": "0.1.23"
124+
"enchantr": "0.1.24"
125125
},
126126
"SAMPLESHEET_CHECK": {
127127
"python": "3.9.1",
@@ -903,12 +903,14 @@
903903
"Sample6_add-meta_command_log.txt:md5,70b00ba883c70c3070831895ccfa072c",
904904
"Sample7_add-meta_command_log.txt:md5,7f45c2264149e92259b260eb940957f8",
905905
"Sample8_add-meta_command_log.txt:md5,eaaaa70f2f95d61750d77605798a75b9"
906-
]
906+
],
907+
"Table_sequences_assembled.tsv:md5,7330606135fab6f1bc7c33de4e455512",
908+
"Table_sequences_assembly.tsv:md5,d6f5ac80a7781b76ec008c2ee4487cd6"
907909
],
908910
"meta": {
909-
"nf-test": "0.9.2",
911+
"nf-test": "0.9.3",
910912
"nextflow": "25.04.8"
911913
},
912-
"timestamp": "2025-10-21T10:38:57.492281136"
914+
"timestamp": "2025-11-04T13:26:21.925049633"
913915
}
914916
}

tests/test_10x_sc.nf.test

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
nextflow_pipeline {
2+
3+
name "Test pipeline"
4+
script "../main.nf"
5+
tag "pipeline"
6+
profile "test_10x_sc"
7+
8+
test("-profile test_10x_sc") {
9+
10+
when {
11+
params {
12+
outdir = "$outputDir"
13+
}
14+
}
15+
16+
then {
17+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
18+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
19+
// stable_path: All files in ${params.outdir}/ with stable content
20+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
21+
assertAll(
22+
{ assert workflow.success},
23+
{ assert snapshot(
24+
// Number of successful tasks
25+
workflow.trace.succeeded().size(),
26+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
27+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_airrflow_software_mqc_versions.yml"),
28+
// All stable path name, with a relative path
29+
stable_name,
30+
// All files with stable contents
31+
stable_path,
32+
// Additional files that are excluded in .nftignore but need to be checked
33+
"$outputDir/repertoire_comparison/Sequence_numbers_summary/Table_sequences_assembled.tsv"
34+
).match() }
35+
)
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)