Skip to content
Open
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
9 changes: 8 additions & 1 deletion modules/nf-core/sentieon/gvcftyper/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ process SENTIEON_GVCFTYPER {
def prefix = task.ext.prefix ?: "${meta.id}_genotyped"
def gvcfs_input = '-v ' + gvcfs.join(' -v ')
def dbsnp_cmd = dbsnp ? "--dbsnp ${dbsnp}" : ""
def interval_command = intervals ? "--interval ${intervals}" : ""
def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64
? "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; "
: ""
"""
${sentieonLicense}

sentieon driver -r ${fasta} --algo GVCFtyper ${gvcfs_input} ${dbsnp_cmd} ${prefix}.vcf.gz
sentieon driver \\
-r ${fasta} \\
${interval_command} \\
--algo GVCFtyper \\
${gvcfs_input} \\
${dbsnp_cmd} \\
${prefix}.vcf.gz

"""

Expand Down
39 changes: 39 additions & 0 deletions modules/nf-core/sentieon/gvcftyper/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,45 @@ nextflow_process {
}
}

test("sentieon gvcftyper intervals constrain output - regression") {
// Regression test for the bug where `path(intervals)` was staged but
// never passed to `sentieon driver --interval`, causing GVCFtyper to
// run unconstrained. Before the fix, the variantsMD5 of an intervals
// run was identical to the no-intervals run
// ("d13216836f1452e200b215b796606671"). After the fix, the bed must
// actually restrict GVCFtyper, so the md5 MUST differ.

when {
process {
"""
input[0] = [ [ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics//homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]

input[1] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)]
input[2] = [[id: 'test'],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)]
input[3] = [[:], []]
input[4] = [[:], []]
"""
}
}

then {
assert process.success
assertAll(
{ assert path(process.out.vcf_gz[0][1]).vcf.variantsMD5 != "d13216836f1452e200b215b796606671" },
{ assert snapshot(
process.out.findAll { key, val -> key.startsWith("versions") },
file(process.out.vcf_gz_tbi.get(0).get(1)).name,
path(process.out.vcf_gz[0][1]).vcf.variantsMD5
).match()
}
)
}
}

test("sentieon gvcftyper - stub") {

options "-stub"
Expand Down
Loading