Skip to content

Commit

Permalink
Add par_regions_bed input to DeepVariant (nf-core#6022)
Browse files Browse the repository at this point in the history
* Add par_regions_bed input to DeepVariant

* Add to meta.yml
  • Loading branch information
fellen31 authored Aug 13, 2024
1 parent e21abde commit a7e8b8a
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/nf-core/deepvariant/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ process DEEPVARIANT {
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
tuple val(meta4), path(gzi)
tuple val(meta5), path(par_bed)

output:
tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf
Expand All @@ -31,6 +32,7 @@ process DEEPVARIANT {
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def regions = intervals ? "--regions=${intervals}" : ""
def par_regions = par_bed ? "--par_regions_bed=${par_bed}" : ""
// WARN https://github.com/nf-core/modules/pull/5801#issuecomment-2194293755
// FIXME Revert this on next version bump
def VERSION = '1.6.1'
Expand All @@ -43,6 +45,7 @@ process DEEPVARIANT {
--output_gvcf=${prefix}.g.vcf.gz \\
${args} \\
${regions} \\
${par_regions} \\
--intermediate_results_dir=tmp \\
--num_shards=${task.cpus}
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/deepvariant/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ input:
type: file
description: GZI index of reference fasta file
pattern: "*.gzi"
- meta5:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- par_bed:
type: file
description: BED file containing PAR regions
pattern: "*.bed"
output:
- meta:
type: map
Expand Down
48 changes: 48 additions & 0 deletions modules/nf-core/deepvariant/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ nextflow_process {
input[3] = [
[],[]
]
input[4] = [
[],[]
]
"""
}
}
Expand Down Expand Up @@ -66,6 +69,48 @@ nextflow_process {
input[3] = [
[],[]
]
input[4] = [
[],[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("homo_sapiens - [cram, crai, genome_bed] - fasta - fai - par_bed") {
config "./nextflow-non-autosomal-calling.config"
tag "test"
when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]
input[1] = [
[ id:'genome'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
input[2] = [
[ id:'genome'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = [
[],[]
]
input[4] = [
[ id:'genome'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.blacklist_intervals.bed', checkIfExists: true)
]
"""
}
}
Expand Down Expand Up @@ -102,6 +147,9 @@ nextflow_process {
[ id:'genome'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz.gzi', checkIfExists: true)
]
input[4] = [
[],[]
]
"""
}
}
Expand Down
91 changes: 90 additions & 1 deletion modules/nf-core/deepvariant/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,94 @@
"nextflow": "24.04.2"
},
"timestamp": "2024-07-01T12:09:13.952808655"
},
"homo_sapiens - [cram, crai, genome_bed] - fasta - fai - par_bed": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_out.vcf.gz:md5,d2e26d65dbbcea9b087ed191b5c9841c"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test_out.vcf.gz.tbi:md5,0801296d0356415bbf1ef8deb4ec84c3"
]
],
"2": [
[
{
"id": "test",
"single_end": false
},
"test_out.g.vcf.gz:md5,4fcaa9a8b55730d191382160c2b5bb0a"
]
],
"3": [
[
{
"id": "test",
"single_end": false
},
"test_out.g.vcf.gz.tbi:md5,f468e846904733b3231ecf00ef7cd4a2"
]
],
"4": [
"versions.yml:md5,efbdcb1ad96e0209b31bcafedd0017a8"
],
"gvcf": [
[
{
"id": "test",
"single_end": false
},
"test_out.g.vcf.gz:md5,4fcaa9a8b55730d191382160c2b5bb0a"
]
],
"gvcf_tbi": [
[
{
"id": "test",
"single_end": false
},
"test_out.g.vcf.gz.tbi:md5,f468e846904733b3231ecf00ef7cd4a2"
]
],
"vcf": [
[
{
"id": "test",
"single_end": false
},
"test_out.vcf.gz:md5,d2e26d65dbbcea9b087ed191b5c9841c"
]
],
"vcf_tbi": [
[
{
"id": "test",
"single_end": false
},
"test_out.vcf.gz.tbi:md5,0801296d0356415bbf1ef8deb4ec84c3"
]
],
"versions": [
"versions.yml:md5,efbdcb1ad96e0209b31bcafedd0017a8"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-07-23T14:29:24.939680679"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
process {

withName: DEEPVARIANT {
ext.args = '--model_type=WGS --haploid_contigs chr22'
ext.prefix = { "${meta.id}_out" }
}

}

0 comments on commit a7e8b8a

Please sign in to comment.