Skip to content

Commit 14ef874

Browse files
authored
Clair3 version topics migration (nf-core#10975)
* Clair3 version topics migration * Solve conda tests * Skip conda packaged_model * Update snapshot * Restore snapshot * Update json
1 parent 2f1b98c commit 14ef874

6 files changed

Lines changed: 109 additions & 78 deletions

File tree

.github/skip_nf_test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"modules/nf-core/cellrangeratac/mkfastq",
3030
"modules/nf-core/cellrangeratac/mkref",
3131
"modules/nf-core/checkqc",
32+
"modules/nf-core/clair3",
3233
"modules/nf-core/coreograph",
3334
"modules/nf-core/ctatsplicing/prepgenomelib",
3435
"modules/nf-core/ctatsplicing/startocancerintrons",

modules/nf-core/clair3/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ channels:
44
- conda-forge
55
- bioconda
66
dependencies:
7-
- "bioconda::clair3=1.2.0"
7+
- "bioconda::clair3=2.0.0"

modules/nf-core/clair3/main.nf

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ process CLAIR3 {
33
label 'process_high'
44

55
conda "${moduleDir}/environment.yml"
6-
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7-
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e7/e70b0f4389028f4dc88efde1aac7139927c898cf7add680e14724d97fecd3d32/data'
8-
: 'community.wave.seqera.io/library/clair3:1.2.0--b1b03d4e9d1b6a2e'}"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'docker://hkubal/clair3:v2.0.0' :
8+
'docker.io/hkubal/clair3:v2.0.0' }"
99

1010
input:
1111
tuple val(meta), path(bam), path(bai), val(packaged_model), path(user_model), val(platform)
@@ -19,18 +19,20 @@ process CLAIR3 {
1919
tuple val(meta), path("${prefix}phased_merge_output.vcf.gz.tbi"), emit: phased_tbi, optional: true
2020
tuple val(meta), path("${prefix}merge_output.gvcf.gz"), emit: gvcf, optional: true
2121
tuple val(meta), path("${prefix}merge_output.gvcf.gz.tbi"), emit: gtbi, optional: true
22-
path "versions.yml", emit: versions
22+
tuple val("${task.process}"), val('clair3'), eval('run_clair3.sh --version | sed "s/^Clair3 v//"'), emit: versions_clair3, topic: versions
23+
2324

2425
when:
2526
task.ext.when == null || task.ext.when
2627

2728
script:
2829
def model = ""
2930
if (!user_model) {
30-
// In seqera containers `MAMBA_ROOT_PREFIX` is always available
31-
// whereas `CONDA_PREFIX` may not be
32-
// see https://github.com/seqeralabs/wave/issues/886
33-
model = "\${CONDA_PREFIX:-\$MAMBA_ROOT_PREFIX}/bin/models/${packaged_model}"
31+
if (workflow.containerEngine in ['singularity', 'docker', 'podman']) {
32+
model = "/opt/models/${packaged_model}"
33+
} else {
34+
error "Clair3 packaged models are only available in Docker/Singularity/Podman containers. Please use one of these profiles or provide a user_model instead."
35+
}
3436
}
3537
if (!packaged_model) {
3638
model = "${user_model}"
@@ -42,12 +44,12 @@ process CLAIR3 {
4244
prefix = task.ext.prefix ?: "${meta.id}"
4345
"""
4446
run_clair3.sh \\
45-
--bam_fn=${bam} \\
46-
--ref_fn=${reference} \\
47+
--bam_fn=\${PWD}/${bam} \\
48+
--ref_fn=\${PWD}/${reference} \\
4749
--threads=${task.cpus} \\
4850
--output=. \\
4951
--platform=${platform} \\
50-
--model=${model} \\
52+
--model_path=${model} \\
5153
${args}
5254
5355
# Rename to add prefix
@@ -61,11 +63,6 @@ process CLAIR3 {
6163
mv "\$file" "${prefix}\$file"
6264
fi
6365
done
64-
65-
cat <<-END_VERSIONS > versions.yml
66-
"${task.process}":
67-
clair3: \$(run_clair3.sh --version |& sed '1!d ; s/Clair3 v//')
68-
END_VERSIONS
6966
"""
7067

7168
stub:
@@ -77,10 +74,5 @@ process CLAIR3 {
7774
touch ${prefix}merge_output.vcf.gz.tbi
7875
echo "" | gzip > ${prefix}merge_output.gvcf.gz
7976
touch ${prefix}merge_output.gvcf.gz.tbi
80-
81-
cat <<-END_VERSIONS > versions.yml
82-
"${task.process}":
83-
clair3: \$(run_clair3.sh --version |& sed '1!d ; s/Clair3 v//')
84-
END_VERSIONS
8577
"""
8678
}

modules/nf-core/clair3/meta.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ tools:
1818
documentation: "https://github.com/HKU-BAL/Clair3"
1919
tool_dev_url: "https://github.com/HKU-BAL/Clair3"
2020
doi: "10.1038/s43588-022-00387-x"
21-
licence: ["BSD-3-clause"]
21+
licence:
22+
- "BSD-3-clause"
2223
identifier: biotools:clair3
23-
2424
input:
2525
- - meta:
2626
type: map
@@ -42,15 +42,16 @@ input:
4242
ontologies: []
4343
- packaged_model:
4444
type: string
45-
description: string containing the name of a prepackaged Clair3 model full list
46-
of models and their descriptions is provided at https://github.com/HKU-BAL/Clair3?tab=readme-ov-file#pre-trained-models
45+
description: string containing the name of a prepackaged Clair3 model full
46+
list of models and their descriptions is provided at
47+
https://github.com/HKU-BAL/Clair3?tab=readme-ov-file#pre-trained-models
4748
- user_model:
4849
type: directory
4950
description: directory containing Clair3 model files
5051
- platform:
5152
type: string
52-
description: val in ['hifi','ont', 'ilmn'] to indicate pacbio, ONT, or illumina
53-
respectively
53+
description: val in ['hifi','ont', 'ilmn'] to indicate pacbio, ONT, or
54+
illumina respectively
5455
- - meta2:
5556
type: map
5657
description: |
@@ -79,7 +80,7 @@ output:
7980
Groovy Map containing sample information
8081
e.g. `[ id:'sample1' ]`
8182
pattern: "*.{vcf,vcf.gz}"
82-
- "${prefix}merge_output.vcf.gz":
83+
- ${prefix}merge_output.vcf.gz:
8384
type: map
8485
description: |
8586
Groovy Map containing sample information
@@ -92,7 +93,7 @@ output:
9293
Groovy Map containing sample information
9394
e.g. `[ id:'sample1' ]`
9495
pattern: "*.{vcf,vcf.gz}"
95-
- "${prefix}merge_output.vcf.gz.tbi":
96+
- ${prefix}merge_output.vcf.gz.tbi:
9697
type: file
9798
description: index for vcf files
9899
pattern: "*.{vcf.tbi,vcf.tbi.gz}"
@@ -104,7 +105,7 @@ output:
104105
Groovy Map containing sample information
105106
e.g. `[ id:'sample1' ]`
106107
pattern: "*.{vcf,vcf.gz}"
107-
- "${prefix}phased_merge_output.vcf.gz":
108+
- ${prefix}phased_merge_output.vcf.gz:
108109
type: file
109110
description: phased vcf
110111
pattern: "*.{vcf,vcf.gz}"
@@ -116,7 +117,7 @@ output:
116117
Groovy Map containing sample information
117118
e.g. `[ id:'sample1' ]`
118119
pattern: "*.{vcf,vcf.gz}"
119-
- "${prefix}phased_merge_output.vcf.gz.tbi":
120+
- ${prefix}phased_merge_output.vcf.gz.tbi:
120121
type: file
121122
description: index for vcf files
122123
pattern: "*.{vcf.tbi,vcf.tbi.gz}"
@@ -128,7 +129,7 @@ output:
128129
Groovy Map containing sample information
129130
e.g. `[ id:'sample1' ]`
130131
pattern: "*.{vcf,vcf.gz}"
131-
- "${prefix}merge_output.gvcf.gz":
132+
- ${prefix}merge_output.gvcf.gz:
132133
type: file
133134
description: gvcf file
134135
pattern: "*.{gvcf,gvcf.gz}"
@@ -139,20 +140,33 @@ output:
139140
description: |
140141
Groovy Map containing sample information
141142
e.g. `[ id:'sample1' ]`
142-
pattern: "*.{gvcf.tbi,gvcf.gz.tbi}"
143-
- "${prefix}merge_output.gvcf.gz.tbi":
143+
pattern: "*.{vcf,vcf.gz}"
144+
- ${prefix}merge_output.gvcf.gz.tbi:
144145
type: file
145146
description: index for gvcf file
146147
pattern: "*.{vcf.tbi,vcf.tbi.gz}"
147148
ontologies: []
148-
149+
versions_clair3:
150+
- - ${task.process}:
151+
type: string
152+
description: The name of the process
153+
- clair3:
154+
type: string
155+
description: The name of the tool
156+
- run_clair3.sh --version | sed "s/^Clair3 v//":
157+
type: eval
158+
description: The expression to obtain the version of the tool
159+
topics:
149160
versions:
150-
- versions.yml:
151-
type: file
152-
description: File containing software versions
153-
pattern: "versions.yml"
154-
ontologies:
155-
- edam: http://edamontology.org/format_3750 # YAML
161+
- - ${task.process}:
162+
type: string
163+
description: The name of the process
164+
- clair3:
165+
type: string
166+
description: The name of the tool
167+
- run_clair3.sh --version | sed "s/^Clair3 v//":
168+
type: eval
169+
description: The expression to obtain the version of the tool
156170
authors:
157171
- "@robert-a-forsyth"
158172
maintainers:

modules/nf-core/clair3/tests/main.nf.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ nextflow_process {
1818
"""
1919
input[0] = [
2020
[ id:'test'],
21-
file(params.modules_testdata_base_path + 'generic/models/clair3.hifi.tar.gz', checkIfExists: true)
21+
file(params.modules_testdata_base_path + 'generic/models/clair3_v2.hifi.tar.gz', checkIfExists: true)
2222
]
2323
"""
2424
}
@@ -69,7 +69,7 @@ nextflow_process {
6969
[file(it[1]).name, path(it[1]).vcf.summary]
7070
},
7171
process.out.gtbi.collect { file(it[1]).name },
72-
process.out.versions)
72+
process.out.findAll { key, val -> key.startsWith('versions') })
7373
.match()}
7474
)
7575
}
@@ -120,7 +120,7 @@ nextflow_process {
120120
[file(it[1]).name, path(it[1]).vcf.summary]
121121
},
122122
process.out.gtbi.collect { file(it[1]).name },
123-
process.out.versions)
123+
process.out.findAll { key, val -> key.startsWith('versions') })
124124
.match()}
125125
)
126126
}
@@ -208,7 +208,7 @@ nextflow_process {
208208
[file(it[1]).name, path(it[1]).vcf.summary]
209209
},
210210
process.out.gtbi.collect { file(it[1]).name },
211-
process.out.versions)
211+
process.out.findAll { key, val -> key.startsWith('versions') })
212212
.match()}
213213
)
214214
}
@@ -253,7 +253,7 @@ nextflow_process {
253253
process.out.phased_tbi,
254254
process.out.gvcf,
255255
process.out.gtbi,
256-
process.out.versions)
256+
process.out.findAll { key, val -> key.startsWith('versions') })
257257
.match()}
258258
)
259259
}

modules/nf-core/clair3/tests/main.nf.test.snap

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,21 @@
4949
"testmerge_output.gvcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e"
5050
]
5151
],
52-
[
53-
"versions.yml:md5,bc9f9c29055f993dc8c5c8a3e8d32d1a"
54-
]
52+
{
53+
"versions_clair3": [
54+
[
55+
"CLAIR3",
56+
"clair3",
57+
"2.0.0"
58+
]
59+
]
60+
}
5561
],
62+
"timestamp": "2026-03-19T12:58:29.886268",
5663
"meta": {
57-
"nf-test": "0.9.2",
58-
"nextflow": "25.04.6"
59-
},
60-
"timestamp": "2025-09-10T12:49:24.796196"
64+
"nf-test": "0.9.4",
65+
"nextflow": "25.10.4"
66+
}
6167
},
6268
"sarscov2 - bam - packaged_model": {
6369
"content": [
@@ -82,22 +88,28 @@
8288
[
8389

8490
],
85-
[
86-
"versions.yml:md5,bc9f9c29055f993dc8c5c8a3e8d32d1a"
87-
]
91+
{
92+
"versions_clair3": [
93+
[
94+
"CLAIR3",
95+
"clair3",
96+
"2.0.0"
97+
]
98+
]
99+
}
88100
],
101+
"timestamp": "2026-03-20T04:12:38.663282558",
89102
"meta": {
90-
"nf-test": "0.9.2",
91-
"nextflow": "25.04.6"
92-
},
93-
"timestamp": "2025-09-02T10:27:38.84502"
103+
"nf-test": "0.9.5",
104+
"nextflow": "25.10.4"
105+
}
94106
},
95107
"sarscov2 - bam - user_model": {
96108
"content": [
97109
[
98110
[
99111
"testmerge_output.vcf.gz",
100-
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=19, phased=false, phasedAutodetect=false]"
112+
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=9, phased=false, phasedAutodetect=false]"
101113
]
102114
],
103115
[
@@ -115,22 +127,28 @@
115127
[
116128

117129
],
118-
[
119-
"versions.yml:md5,bc9f9c29055f993dc8c5c8a3e8d32d1a"
120-
]
130+
{
131+
"versions_clair3": [
132+
[
133+
"CLAIR3",
134+
"clair3",
135+
"2.0.0"
136+
]
137+
]
138+
}
121139
],
140+
"timestamp": "2026-03-19T13:38:03.609361",
122141
"meta": {
123-
"nf-test": "0.9.2",
124-
"nextflow": "25.04.6"
125-
},
126-
"timestamp": "2025-09-02T10:27:17.499057"
142+
"nf-test": "0.9.4",
143+
"nextflow": "25.10.4"
144+
}
127145
},
128146
"sarscov2 - bam - user_model - gvcf": {
129147
"content": [
130148
[
131149
[
132150
"testmerge_output.vcf.gz",
133-
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=19, phased=false, phasedAutodetect=false]"
151+
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=9, phased=false, phasedAutodetect=false]"
134152
]
135153
],
136154
[
@@ -145,20 +163,26 @@
145163
[
146164
[
147165
"testmerge_output.gvcf.gz",
148-
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=457, phased=false, phasedAutodetect=false]"
166+
"VcfFile [chromosomes=[MT192765.1], sampleCount=1, variantCount=456, phased=false, phasedAutodetect=false]"
149167
]
150168
],
151169
[
152170
"testmerge_output.gvcf.gz.tbi"
153171
],
154-
[
155-
"versions.yml:md5,bc9f9c29055f993dc8c5c8a3e8d32d1a"
156-
]
172+
{
173+
"versions_clair3": [
174+
[
175+
"CLAIR3",
176+
"clair3",
177+
"2.0.0"
178+
]
179+
]
180+
}
157181
],
182+
"timestamp": "2026-03-19T13:39:12.428496",
158183
"meta": {
159-
"nf-test": "0.9.2",
160-
"nextflow": "25.04.6"
161-
},
162-
"timestamp": "2025-09-02T10:28:13.64925"
184+
"nf-test": "0.9.4",
185+
"nextflow": "25.10.4"
186+
}
163187
}
164188
}

0 commit comments

Comments
 (0)