Skip to content

Commit b489c2a

Browse files
Merge branch 'nf-core:master' into sparsesignatures
2 parents 9e8c835 + bd049fd commit b489c2a

File tree

6 files changed

+406
-152
lines changed

6 files changed

+406
-152
lines changed

modules/nf-core/glnexus/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ channels:
44
- conda-forge
55
- bioconda
66
dependencies:
7+
- bioconda::bcftools=1.21
78
- bioconda::glnexus=1.4.1

modules/nf-core/glnexus/main.nf

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ process GLNEXUS {
44

55
conda "${moduleDir}/environment.yml"
66
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7-
'https://depot.galaxyproject.org/singularity/glnexus:1.4.1--h40d77a6_0' :
8-
'biocontainers/glnexus:1.4.1--h40d77a6_0' }"
7+
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/6c/6cf504ad8e4ebda286609fa3c1a5f9af68dbca9ec06bb4428e219e84754bd140/data' :
8+
'community.wave.seqera.io/library/bcftools_glnexus:cf380f1a6410f606' }"
99

1010
input:
11-
tuple val(meta), path(gvcfs)
11+
tuple val(meta), path(gvcfs), path(custom_config)
1212
tuple val(meta2), path(bed)
13+
val vcf_output
1314

1415
output:
15-
tuple val(meta), path("*.bcf"), emit: bcf
16-
path "versions.yml" , emit: versions
16+
tuple val(meta), path("*.bcf") , emit: bcf, optional:true
17+
tuple val(meta), path("*.vcf.gz"), emit: vcf, optional:true
18+
path "versions.yml" , emit: versions
1719

1820
when:
1921
task.ext.when == null || task.ext.when
@@ -23,6 +25,8 @@ process GLNEXUS {
2325
def prefix = task.ext.prefix ?: "${meta.id}"
2426
def regions = bed ? "--bed ${bed}" : ""
2527

28+
def outpipe = vcf_output ? " | bcftools convert --threads $task.cpus -Oz > ${prefix}.vcf.gz" : " > ${prefix}.bcf"
29+
2630
// Make list of GVCFs to merge
2731
def input = gvcfs.collect { it.toString() }
2832
def avail_mem = 3
@@ -38,7 +42,7 @@ process GLNEXUS {
3842
$regions \\
3943
$args \\
4044
${input.join(' ')} \\
41-
> ${prefix}.bcf
45+
$outpipe
4246
4347
cat <<-END_VERSIONS > versions.yml
4448
"${task.process}":
@@ -48,8 +52,9 @@ process GLNEXUS {
4852

4953
stub:
5054
def prefix = task.ext.prefix ?: "${meta.id}"
55+
def outpipe = vcf_output ? "echo \"\" | gzip > ${prefix}.vcf.gz" : "touch ${prefix}.bcf"
5156
"""
52-
touch ${prefix}.bcf
57+
$outpipe
5358
5459
cat <<-END_VERSIONS > versions.yml
5560
"${task.process}":

modules/nf-core/glnexus/meta.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ input:
2323
type: list
2424
description: Input genomic vcf files
2525
pattern: "*.{gvcf,gvcf.gz,g.vcf,g.vcf.gz}"
26+
- custom_config:
27+
type: file
28+
description: Custom YML config for additional profiles
29+
pattern: "*.{yml,yaml}"
2630
- - meta2:
2731
type: map
2832
description: |
@@ -32,15 +36,29 @@ input:
3236
type: list
3337
description: Input BED file
3438
pattern: "*.bed"
39+
- - vcf_output:
40+
type: boolean
41+
description: Specify to output to VCF format
3542
output:
3643
- bcf:
3744
- meta:
45+
type: map
46+
description: |
47+
Groovy Map containing sample information
48+
e.g. [ id:'test' ]
49+
- "*.bcf":
3850
type: file
3951
description: merged BCF file
4052
pattern: "*.bcf"
41-
- "*.bcf":
53+
- vcf:
54+
- meta:
55+
type: map
56+
description: |
57+
Groovy Map containing sample information
58+
e.g. [ id:'test' ]
59+
- "*.vcf.gz":
4260
type: file
43-
description: merged BCF file
61+
description: merged VCF file
4462
pattern: "*.bcf"
4563
- versions:
4664
- versions.yml:

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

Lines changed: 101 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nextflow_process {
88
tag "modules_nfcore"
99
tag "glnexus"
1010

11-
test("vcfs, []") {
11+
test("vcfs, [], false") {
1212

1313
when {
1414
process {
@@ -18,9 +18,11 @@ nextflow_process {
1818
[
1919
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
2020
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
21-
]
21+
],
22+
[]
2223
])
2324
input[1] = [[],[]]
25+
input[2] = false
2426
"""
2527
}
2628
}
@@ -34,7 +36,7 @@ nextflow_process {
3436

3537
}
3638

37-
test("vcfs, bed") {
39+
test("vcfs, [], false, custom_config") {
3840

3941
when {
4042
process {
@@ -44,12 +46,103 @@ nextflow_process {
4446
[
4547
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
4648
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
47-
]
49+
],
50+
file(params.modules_testdata_base_path + '/delete_me/glnexus/gatk.yml', checkIfExists: true)
51+
])
52+
input[1] = [[],[]]
53+
input[2] = false
54+
"""
55+
}
56+
}
57+
58+
then {
59+
assertAll(
60+
{ assert process.success },
61+
{ assert snapshot(process.out).match() }
62+
)
63+
}
64+
65+
}
66+
67+
test("vcfs, bed, false") {
68+
69+
when {
70+
process {
71+
"""
72+
input[0] = Channel.of([
73+
[ id:'test' ],
74+
[
75+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
76+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
77+
],
78+
[]
79+
])
80+
input[1] = [
81+
[ id:'region' ],
82+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
83+
]
84+
input[2] = false
85+
"""
86+
}
87+
}
88+
89+
then {
90+
assertAll(
91+
{ assert process.success },
92+
{ assert snapshot(process.out).match() }
93+
)
94+
}
95+
96+
}
97+
98+
test("vcfs, [], true") {
99+
100+
when {
101+
process {
102+
"""
103+
input[0] = Channel.of([
104+
[ id:'test' ],
105+
[
106+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
107+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
108+
],
109+
[]
110+
])
111+
input[1] = [[],[]]
112+
input[2] = true
113+
"""
114+
}
115+
}
116+
117+
then {
118+
assertAll(
119+
{ assert process.success },
120+
{ assert snapshot(process.out).match() }
121+
)
122+
}
123+
124+
}
125+
126+
test("vcfs, bed, false - stub") {
127+
128+
options "-stub"
129+
130+
when {
131+
process {
132+
"""
133+
input[0] = Channel.of([
134+
[ id:'test' ],
135+
[
136+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
137+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
138+
],
139+
[]
48140
])
49141
input[1] = [
50142
[ id:'region' ],
51143
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
52144
]
145+
input[2] = false
53146
"""
54147
}
55148
}
@@ -63,7 +156,7 @@ nextflow_process {
63156

64157
}
65158

66-
test("vcfs, bed - stub") {
159+
test("vcfs, bed, true - stub") {
67160

68161
options "-stub"
69162

@@ -75,12 +168,14 @@ nextflow_process {
75168
[
76169
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
77170
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
78-
]
171+
],
172+
[]
79173
])
80174
input[1] = [
81175
[ id:'region' ],
82176
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
83177
]
178+
input[2] = true
84179
"""
85180
}
86181
}

0 commit comments

Comments
 (0)