Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/delly/call/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::delly=1.3.3
- bioconda::delly=1.7.3
8 changes: 4 additions & 4 deletions modules/nf-core/delly/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ process DELLY_CALL {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/delly:1.3.3--h4d20210_0' :
'biocontainers/delly:1.3.3--h4d20210_0' }"
'https://depot.galaxyproject.org/singularity/delly:1.7.3--hd6466ae_0' :
'biocontainers/delly:1.7.3--hd6466ae_0' }"

input:
tuple val(meta), path(input), path(input_index), path(vcf), path(vcf_index), path(exclude_bed)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
val(suffix)

output:
tuple val(meta), path("*.{bcf,vcf.gz}") , emit: bcf
Expand All @@ -24,7 +25,6 @@ process DELLY_CALL {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: "bcf"

def exclude = exclude_bed ? "--exclude ${exclude_bed}" : ""

Expand All @@ -37,6 +37,7 @@ process DELLY_CALL {
delly \\
call \\
${args} \\
--threads ${task.cpus} \\
${bcf_output} \\
--genome ${fasta} \\
${genotype} \\
Expand All @@ -47,7 +48,6 @@ process DELLY_CALL {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: "bcf"

def bcf_output = suffix == "bcf" ? "touch ${prefix}.bcf && touch ${prefix}.bcf.csi" : ""
def vcf_output = suffix == "vcf" ? "echo '' | gzip > ${prefix}.vcf.gz && touch ${prefix}.vcf.gz.tbi" : ""
Expand Down
11 changes: 9 additions & 2 deletions modules/nf-core/delly/call/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ input:
description: Index of reference fasta file to identify split-reads
pattern: "*.fai"
ontologies: []
- suffix:
type: string
description: A flag to specify whether the output should be in BCF or VCF
format
enum:
- "bcf"
- "vcf"
output:
bcf:
- - meta:
Expand All @@ -78,8 +85,8 @@ output:
e.g. [ id:'test', single_end:false ]
- "*.{bcf,vcf.gz}":
type: file
description: Called variants in BCF/VCF format. Specify either "bcf" or
"vcf" in ext.suffix to define the output type
description: Called variants in BCF/VCF format. Set suffix to either
"bcf" or "vcf" to define the output type
pattern: "*.{bcf,vcf.gz}"
ontologies: []
csi:
Expand Down
119 changes: 112 additions & 7 deletions modules/nf-core/delly/call/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,42 @@ nextflow_process {
tag "delly"
tag "delly/call"

test("homo_sapiens - bam, bai, [], [], [], fasta, fai") {
test("homo_sapiens - bam, bai, [], [], [], fasta, fai, vcf") {

config "./vcf.config"
when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam", checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai", checkIfExists:true),
[],
[],
[]
]
input[1] = [
[ id:'fasta' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true)
]
input[2] = [
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'vcf'
"""
}
}

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

}

test("homo_sapiens - bam, bai, [], [], [], fasta, fai, bcf") {

when {
process {
Expand All @@ -32,6 +65,7 @@ nextflow_process {
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'bcf'
"""
}
}
Expand All @@ -42,10 +76,78 @@ nextflow_process {
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

test("homo_sapiens - bam, bai, [], [], [], fasta, fai, []") {

when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam", checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai", checkIfExists:true),
[],
[],
[]
]
input[1] = [
[ id:'fasta' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true)
]
input[2] = [
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = ''
"""
}
}

then {
assertAll(
{ assert !process.success },
)
}
}

test("homo_sapiens - bam, bai, [], [], [], fasta, fai, bcf - config") {

config "./nextflow.config"

when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam", checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai", checkIfExists:true),
[],
[],
[]
]
input[1] = [
[ id:'fasta' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true)
]
input[2] = [
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'bcf'
"""
}
}

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

test("homo_sapiens - cram, crai, [], [], [], fasta, fai") {
test("homo_sapiens - cram, crai, [], [], [], fasta, fai, bcf") {

when {
process {
Expand All @@ -66,6 +168,7 @@ nextflow_process {
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'bcf'
"""
}
}
Expand All @@ -79,7 +182,7 @@ nextflow_process {

}

test("homo_sapiens - cram, crai, [], [], bed, fasta, fai") {
test("homo_sapiens - cram, crai, [], [], bed, fasta, fai, bcf") {

when {
process {
Expand All @@ -100,6 +203,7 @@ nextflow_process {
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'bcf'
"""
}
}
Expand All @@ -113,7 +217,7 @@ nextflow_process {

}

test("homo_sapiens - cram, crai, vcf, tbi, [], fasta, fai") {
test("homo_sapiens - cram, crai, vcf, tbi, [], fasta, fai, bcf") {

when {
process {
Expand All @@ -134,6 +238,7 @@ nextflow_process {
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'bcf'
"""
}
}
Expand All @@ -147,9 +252,8 @@ nextflow_process {

}

test("homo_sapiens - bam, bai, [], [], [], fasta, fai - stub") {
test("homo_sapiens - bam, bai, [], [], [], fasta, fai, vcf - stub") {

config "./vcf.config"
options "-stub"

when {
Expand All @@ -171,6 +275,7 @@ nextflow_process {
[ id:'fai' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true)
]
input[3] = 'vcf'
"""
}
}
Expand Down
Loading
Loading