diff --git a/modules/nf-core/sentieon/tnhaplotyper2/main.nf b/modules/nf-core/sentieon/tnhaplotyper2/main.nf index 4a001cd1a6e7..69f3ccc99290 100644 --- a/modules/nf-core/sentieon/tnhaplotyper2/main.nf +++ b/modules/nf-core/sentieon/tnhaplotyper2/main.nf @@ -21,9 +21,9 @@ process SENTIEON_TNHAPLOTYPER2 { val(emit_contamination_data) output: - tuple val(meta), path("*.orientation_data.tsv") , optional:true , emit: orientation_data - tuple val(meta), path("*.contamination_data.tsv"), optional:true , emit: contamination_data - tuple val(meta), path("*.segments") , optional:true , emit: contamination_segments + tuple val(meta), path("*.orientation_data.tsv") , emit: orientation_data , optional:true + tuple val(meta), path("*.contamination_data.tsv"), emit: contamination_data , optional:true + tuple val(meta), path("*.segments") , emit: contamination_segments, optional:true tuple val(meta), path("*.stats") , emit: stats tuple val(meta), path("*.vcf.gz") , emit: vcf tuple val(meta), path("*.vcf.gz.tbi") , emit: index @@ -80,13 +80,16 @@ process SENTIEON_TNHAPLOTYPER2 { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" + def orientation = emit_orientation_data ? "touch ${prefix}.orientation_data.tsv" : "" + def contamination = emit_contamination_data ? "touch ${prefix}.{contamination_data.tsv,segments}" : "" + """ - touch ${prefix}.vcf.gz + echo | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi - touch ${prefix}.contamination_data.tsv - touch ${prefix}.orientation_data.tsv - touch ${prefix}.segments + touch ${prefix}.vcf.gz.stats + $orientation + $contamination cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/sentieon/tnhaplotyper2/meta.yml b/modules/nf-core/sentieon/tnhaplotyper2/meta.yml index 8e1f481d7b57..a8d0a58446d5 100644 --- a/modules/nf-core/sentieon/tnhaplotyper2/meta.yml +++ b/modules/nf-core/sentieon/tnhaplotyper2/meta.yml @@ -19,14 +19,14 @@ input: type: map description: | Groovy Map containing sample information. - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - input: type: file - description: BAM/CRAM file from alignment + description: BAM/CRAM file(s) from alignment pattern: "*.{bam,cram}" - input_index: type: file - description: BAI/CRAI file from alignment + description: BAI/CRAI file(s) from alignment pattern: "*.{bai,crai}" - intervals: type: file diff --git a/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test b/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test new file mode 100644 index 000000000000..d1f451e762f7 --- /dev/null +++ b/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test @@ -0,0 +1,293 @@ +nextflow_process { + + name "Test Process SENTIEON_TNHAPLOTYPER2" + config "./nextflow.config" + script "../main.nf" + process "SENTIEON_TNHAPLOTYPER2" + + tag "modules" + tag "modules_nfcore" + tag "picard" + tag "picard/addorreplacereadgroups" + tag "sentieon" + tag "sentieon/tnhaplotyper2" + config './nextflow.config' + + setup { + run("PICARD_ADDORREPLACEREADGROUPS", alias: "NORMAL_ADDORREPLACEREADGROUPS") { + script "../../../picard/addorreplacereadgroups/main.nf" + config './nextflow.config' + process { + """ + input[0] = [[id:'test'], + [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists:true)] + ] + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + + run("PICARD_ADDORREPLACEREADGROUPS", alias: "TUMOUR_ADDORREPLACEREADGROUPS") { + script "../../../picard/addorreplacereadgroups/main.nf" + config './nextflow.config' + + process { + """ + input[0] = [[id:'test'], + [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists:true)] + ] + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + } + + test("tumour normal") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + module_args3 = '' + module_args4 = '' + } + process { + """ + input[0] = NORMAL_ADDORREPLACEREADGROUPS.out.bam + .join( NORMAL_ADDORREPLACEREADGROUPS.out.bai) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bam) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,normal_bam,normal_bai,tumour_bam,tumour_bai-> + [[id:'test'],[normal_bam,tumour_bam],[normal_bai,tumour_bai],[]] + } + input[1] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists:true)] + input[2] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true)] + input[3] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true)] + input[4] = [[:],[]] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = false + input[9] = false + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.stats, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + test("tumour normal, with dbsnp and PoN") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + module_args3 = '' + module_args4 = '' + } + process { + """ + input[0] = NORMAL_ADDORREPLACEREADGROUPS.out.bam + .join(NORMAL_ADDORREPLACEREADGROUPS.out.bai) + .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bam) + .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,normal_bam,normal_bai,tumour_bam,tumour_bai-> + [[id:'test'],[normal_bam,tumour_bam],[normal_bai,tumour_bai],[]] + } + input[1] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists:true)] + input[2] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true)] + input[3] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true)] + input[4] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists:true)] + input[5] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists:true)] + input[6] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists:true)] + input[7] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists:true)] + input[8] = false + input[9] = false + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.stats, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + test("tumour normal, with dbsnp and PoN, emit additional files") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + module_args3 = '--tumor_sample tumour' + module_args4 = '--tumor_sample tumour --normal_sample normal' + } + process { + """ + input[0] = NORMAL_ADDORREPLACEREADGROUPS.out.bam + .join(NORMAL_ADDORREPLACEREADGROUPS.out.bai) + .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bam) + .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,normal_bam,normal_bai,tumour_bam,tumour_bai-> + [[id:'test'],[normal_bam,tumour_bam],[normal_bai,tumour_bai],[]] + } + input[1] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists:true)] + input[2] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true)] + input[3] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true)] + input[4] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists:true)] + input[5] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists:true)] + input[6] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists:true)] + input[7] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists:true)] + input[8] = true + input[9] = true + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.stats, + process.out.orientation_data, + process.out.contamination_data, + process.out.contamination_segments, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + test("tumour only") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour' + module_args3 = '--tumor_sample tumour' + module_args4 = '--tumor_sample tumour' + } + process { + """ + input[0] = TUMOUR_ADDORREPLACEREADGROUPS.out.bam + .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,tumour_bam,tumour_bai-> + [meta,tumour_bam,tumour_bai,[]] + } + input[1] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists:true)] + input[2] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true)] + input[3] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true)] + input[4] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists:true)] + input[5] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists:true)] + input[6] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists:true)] + input[7] = [[:],file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists:true)] + input[8] = true + input[9] = true + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.versions, + process.out.stats, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + + test("tumour normal - stub") { + options '-stub' + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + module_args3 = '' + module_args4 = '' + } + process { + """ + input[0] = [[id:'test'],[],[],[]] + input[1] = [[:],[]] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = false + input[9] = false + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + } + + test("tumour normal, emit additional files -stub") { + options '-stub' + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + module_args3 = '' + module_args4 = '' + } + process { + """ + input[0] = [[id:'test'],[],[],[]] + input[1] = [[:],[]] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = false + input[9] = false + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + } + +} \ No newline at end of file diff --git a/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test.snap b/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test.snap new file mode 100644 index 000000000000..e862e56ba288 --- /dev/null +++ b/modules/nf-core/sentieon/tnhaplotyper2/tests/main.nf.test.snap @@ -0,0 +1,300 @@ +{ + "tumour normal, with dbsnp and PoN": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=2, variantCount=40, phased=false, phasedAutodetect=false]", + "test.vcf.gz.tbi", + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,9b9284beaf38e95b2ca1aaeb363f77f8" + ] + ], + [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + { + "SENTIEON_TNHAPLOTYPER2": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T09:51:46.785714843" + }, + "tumour normal - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + "contamination_data": [ + + ], + "contamination_segments": [ + + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "orientation_data": [ + + ], + "stats": [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T10:11:48.344816494" + }, + "tumour normal": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=2, variantCount=40, phased=false, phasedAutodetect=false]", + "test.vcf.gz.tbi", + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,33493aaf38103a76df205f22d287b17d" + ] + ], + [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + { + "SENTIEON_TNHAPLOTYPER2": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T09:49:19.758661771" + }, + "tumour normal, emit additional files -stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + "contamination_data": [ + + ], + "contamination_segments": [ + + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "orientation_data": [ + + ], + "stats": [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T10:51:34.278182519" + }, + "tumour normal, with dbsnp and PoN, emit additional files": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=2, variantCount=40, phased=false, phasedAutodetect=false]", + "test.vcf.gz.tbi", + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,9b9284beaf38e95b2ca1aaeb363f77f8" + ] + ], + [ + [ + { + "id": "test" + }, + "test.orientation_data.tsv:md5,2f2ed6486c03bb1be674ccf905fcb6b3" + ] + ], + [ + [ + { + "id": "test" + }, + "test.contamination_data.tsv:md5,c8c5a8d53c3f1c48e26a7642b08dfcf2" + ] + ], + [ + [ + { + "id": "test" + }, + "test.segments:md5,134a818bd0413185f068885391da05df" + ] + ], + [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + { + "SENTIEON_TNHAPLOTYPER2": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T09:54:33.694961928" + }, + "tumour only": { + "content": [ + "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=1274, phased=false, phasedAutodetect=false]", + "test.vcf.gz.tbi", + [ + "versions.yml:md5,a2718daeef301a0740e6186bf6ba42e7" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,e4d150874fe502a198c75f7398d1a55e" + ] + ], + { + "SENTIEON_TNHAPLOTYPER2": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T09:56:51.127449678" + } +} \ No newline at end of file diff --git a/modules/nf-core/sentieon/tnhaplotyper2/tests/nextflow.config b/modules/nf-core/sentieon/tnhaplotyper2/tests/nextflow.config new file mode 100644 index 000000000000..c39a9b26ac62 --- /dev/null +++ b/modules/nf-core/sentieon/tnhaplotyper2/tests/nextflow.config @@ -0,0 +1,30 @@ +process { + + withName: "TUMOUR_ADDORREPLACEREADGROUPS" { + ext.args = "--CREATE_INDEX true -ID tumour -LB tumour -PL ILLUMINA -PU bc1 -SM tumour" + ext.prefix = "tumour" + } + + withName: "NORMAL_ADDORREPLACEREADGROUPS" { + ext.args = "--CREATE_INDEX true -ID normal -LB normal -PL ILLUMINA -PU bc1 -SM normal" + ext.prefix = "normal" + } + + withName: 'SENTIEON_TNHAPLOTYPER2' { + ext.args = params.module_args + ext.args2 = params.module_args2 + ext.args3 = params.module_args3 + ext.args4 = params.module_args4 + } + +} + +env { + // NOTE This is how nf-core/sarek users will use Sentieon in real world use + SENTIEON_LICENSE = "$SENTIEON_LICSRVR_IP" + // NOTE This should only happen in GitHub actions or nf-core MegaTests + SENTIEON_AUTH_MECH = "$SENTIEON_AUTH_MECH" + SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA + // NOTE This is how nf-core/sarek users will test out Sentieon in Sarek with a license file + // nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) +} diff --git a/modules/nf-core/sentieon/tnscope/main.nf b/modules/nf-core/sentieon/tnscope/main.nf index b588aeb419d0..9b0fed8ca570 100644 --- a/modules/nf-core/sentieon/tnscope/main.nf +++ b/modules/nf-core/sentieon/tnscope/main.nf @@ -9,13 +9,15 @@ process SENTIEON_TNSCOPE { 'community.wave.seqera.io/library/sentieon:202308.03--59589f002351c221' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index), path(intervals) tuple val(meta2), path(fasta) tuple val(meta3), path(fai) - tuple val(meta4), path(cosmic), path(cosmic_tbi) - tuple val(meta5), path(pon), path(pon_tbi) - tuple val(meta6), path(dbsnp), path(dbsnp_tbi) - tuple val(meta7), path(interval) + tuple val(meta4), path(dbsnp) + tuple val(meta5), path(dbsnp_tbi) + tuple val(meta6), path(pon) + tuple val(meta7), path(pon_tbi) + tuple val(meta8), path(cosmic) + tuple val(meta9), path(cosmic_tbi) output: tuple val(meta), path("*.vcf.gz") , emit: vcf @@ -26,13 +28,14 @@ process SENTIEON_TNSCOPE { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def args2 = task.ext.args2 ?: '' - def interval_str = interval ? "--interval ${interval}" : '' - def cosmic_str = cosmic ? "--cosmic ${cosmic}" : '' - def dbsnp_str = dbsnp ? "--dbsnp ${dbsnp}" : '' - def pon_str = pon ? "--pon ${pon}" : '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def interval_str = intervals ? "--interval ${intervals}" : '' + def cosmic_str = cosmic ? "--cosmic ${cosmic}" : '' + def dbsnp_str = dbsnp ? "--dbsnp ${dbsnp}" : '' + def pon_str = pon ? "--pon ${pon}" : '' + def prefix = task.ext.prefix ?: "${meta.id}" + def inputs = input.collect{ "-i $it"}.join(" ") def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : "" @@ -42,11 +45,10 @@ process SENTIEON_TNSCOPE { sentieon driver \\ -t $task.cpus \\ -r $fasta \\ - -i $bam \\ + $inputs \\ $interval_str \\ $args \\ --algo TNscope \\ - --tumor_sample ${meta.id} \\ $args2 \\ $cosmic_str \\ $dbsnp_str \\ @@ -62,7 +64,7 @@ process SENTIEON_TNSCOPE { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/sentieon/tnscope/meta.yml b/modules/nf-core/sentieon/tnscope/meta.yml index 36dcd8d8e688..e6a2d7e59c38 100644 --- a/modules/nf-core/sentieon/tnscope/meta.yml +++ b/modules/nf-core/sentieon/tnscope/meta.yml @@ -18,15 +18,21 @@ input: type: map description: | Groovy Map containing sample information. - e.g. [ id:'test', single_end:false ] - - bam: + e.g. [ id:'test' ] + - input: + type: file + description: One or more BAM or CRAM files. + pattern: "*.{bam,cram}" + - input_index: type: file - description: BAM file. - pattern: "*.bam" - - bai: + description: Indices for the input files + pattern: "*.{bai,crai}" + - intervals: type: file - description: BAI file - pattern: "*.bai" + description: bed or interval_list file containing interval in the reference + that will be used in the analysis. Only recommended for large WGS data, else + the overhead may not be worth the additional parallelisation. + pattern: "*.{bed,interval_list}" - - meta2: type: map description: | @@ -50,15 +56,20 @@ input: description: | Groovy Map containing reference information. e.g. [ id:'test' ] - - cosmic: + - dbsnp: type: file description: Single Nucleotide Polymorphism database (dbSNP) file pattern: "*.vcf.gz" - - cosmic_tbi: + - - meta5: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test' ] + - dbsnp_tbi: type: file description: Index of the Single Nucleotide Polymorphism database (dbSNP) file pattern: "*.vcf.gz.tbi" - - - meta5: + - - meta6: type: map description: | Groovy Map containing reference information. @@ -67,40 +78,40 @@ input: type: file description: Single Nucleotide Polymorphism database (dbSNP) file pattern: "*.vcf.gz" + - - meta7: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test' ] - pon_tbi: type: file description: Index of the Single Nucleotide Polymorphism database (dbSNP) file pattern: "*.vcf.gz.tbi" - - - meta6: + - - meta8: type: map description: | Groovy Map containing reference information. e.g. [ id:'test' ] - - dbsnp: + - cosmic: type: file - description: Single Nucleotide Polymorphism database (dbSNP) file + description: Catalogue of Somatic Mutations in Cancer (COSMIC) VCF file. pattern: "*.vcf.gz" - - dbsnp_tbi: - type: file - description: Index of the Single Nucleotide Polymorphism database (dbSNP) file - pattern: "*.vcf.gz.tbi" - - - meta7: + - - meta9: type: map description: | Groovy Map containing reference information. e.g. [ id:'test' ] - - interval: + - cosmic_tbi: type: file - description: bed or interval_list file containing interval in the reference - that will be used in the analysis - pattern: "*.{bed,interval_list}" + description: Index of the Catalogue of Somatic Mutations in Cancer (COSMIC) VCF file. + pattern: "*.vcf.gz.tbi" output: - vcf: - meta: type: map description: | Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "*.vcf.gz": type: file description: VCF file @@ -110,7 +121,7 @@ output: type: map description: | Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "*.vcf.gz.tbi": type: file description: Index of the VCF file diff --git a/modules/nf-core/sentieon/tnscope/tests/main.nf.test b/modules/nf-core/sentieon/tnscope/tests/main.nf.test new file mode 100644 index 000000000000..83d789299212 --- /dev/null +++ b/modules/nf-core/sentieon/tnscope/tests/main.nf.test @@ -0,0 +1,170 @@ +nextflow_process { + + name "Test Process SENTIEON_TNSCOPE" + config "./nextflow.config" + script "../main.nf" + process "SENTIEON_TNSCOPE" + + tag "modules" + tag "modules_nfcore" + tag "picard" + tag "picard/addorreplacereadgroups" + tag "sentieon" + tag "sentieon/tnscope" + config './nextflow.config' + + setup { + run("PICARD_ADDORREPLACEREADGROUPS", alias: "NORMAL_ADDORREPLACEREADGROUPS") { + script "../../../picard/addorreplacereadgroups/main.nf" + process { + """ + input[0] = [[id:'test'], + [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists:true)] + ] + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + + run("PICARD_ADDORREPLACEREADGROUPS", alias: "TUMOUR_ADDORREPLACEREADGROUPS") { + script "../../../picard/addorreplacereadgroups/main.nf" + process { + """ + input[0] = [[id:'test'], + [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists:true)] + ] + input[1] = [[],[]] + input[2] = [[],[]] + """ + } + } + } + + test("tumour normal - no dbsnp") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + } + process { + """ + input[0] = NORMAL_ADDORREPLACEREADGROUPS.out.bam + .join( NORMAL_ADDORREPLACEREADGROUPS.out.bai) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bam) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,normal_bam,normal_bai,tumour_bam,tumour_bai-> + [[id:'tumour'],[normal_bam,tumour_bam],[normal_bai,tumour_bai],[]] + } + input[1] = [ [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true) + ] + input[2] = [ [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = [[:],[]] + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + test("tumour normal - dbsnp") { + + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + } + process { + """ + input[0] = NORMAL_ADDORREPLACEREADGROUPS.out.bam + .join( NORMAL_ADDORREPLACEREADGROUPS.out.bai) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bam) + .join( TUMOUR_ADDORREPLACEREADGROUPS.out.bai) + .map{ + meta,normal_bam,normal_bai,tumour_bam,tumour_bai-> + [[id:'tumour'],[normal_bam,tumour_bam],[normal_bai,tumour_bai],[]] + } + input[1] = [ [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists:true) + ] + input[2] = [ [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:'dbsnp'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists:true) + ] + input[4] = [ + [id:'dbsnp'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists:true) + ] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = [[:],[]] + + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf[0][1]).vcf.summary, + file(process.out.index[0][1]).name, + process.out.versions, + path(process.out.versions[0]).yaml + ).match() } + ) + } + } + + test("tumour normal - stub") { + options '-stub' + when { + params { + module_args = '' + module_args2 = '--tumor_sample tumour --normal_sample normal' + } + process { + """ + input[0] = [[id:'test'],[],[],[]] + input[1] = [[:],[]] + input[2] = [[:],[]] + input[3] = [[:],[]] + input[4] = [[:],[]] + input[5] = [[:],[]] + input[6] = [[:],[]] + input[7] = [[:],[]] + input[8] = [[:],[]] + """ + } + } + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + } + +} \ No newline at end of file diff --git a/modules/nf-core/sentieon/tnscope/tests/main.nf.test.snap b/modules/nf-core/sentieon/tnscope/tests/main.nf.test.snap new file mode 100644 index 000000000000..9f26e662e786 --- /dev/null +++ b/modules/nf-core/sentieon/tnscope/tests/main.nf.test.snap @@ -0,0 +1,89 @@ +{ + "tumour normal - dbsnp": { + "content": [ + "VcfFile [chromosomes=[], sampleCount=2, variantCount=0, phased=true, phasedAutodetect=true]", + "tumour.vcf.gz.tbi", + [ + "versions.yml:md5,6acc4c591fbca06fd1c34f2b20456fb7" + ], + { + "SENTIEON_TNSCOPE": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-15T11:30:05.890186395" + }, + "tumour normal - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,6acc4c591fbca06fd1c34f2b20456fb7" + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,6acc4c591fbca06fd1c34f2b20456fb7" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-16T12:32:41.121152947" + }, + "tumour normal - no dbsnp": { + "content": [ + "VcfFile [chromosomes=[], sampleCount=2, variantCount=0, phased=true, phasedAutodetect=true]", + "tumour.vcf.gz.tbi", + [ + "versions.yml:md5,6acc4c591fbca06fd1c34f2b20456fb7" + ], + { + "SENTIEON_TNSCOPE": { + "sentieon": 202308.03 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-15T11:29:08.448862574" + } +} \ No newline at end of file diff --git a/modules/nf-core/sentieon/tnscope/tests/nextflow.config b/modules/nf-core/sentieon/tnscope/tests/nextflow.config new file mode 100644 index 000000000000..ecf20e4e9369 --- /dev/null +++ b/modules/nf-core/sentieon/tnscope/tests/nextflow.config @@ -0,0 +1,28 @@ +process { + + withName: "TUMOUR_ADDORREPLACEREADGROUPS" { + ext.args = "--CREATE_INDEX true -ID tumour -LB tumour -PL ILLUMINA -PU bc1 -SM tumour" + ext.prefix = "tumour" + } + + withName: "NORMAL_ADDORREPLACEREADGROUPS" { + ext.args = "--CREATE_INDEX true -ID normal -LB normal -PL ILLUMINA -PU bc1 -SM normal" + ext.prefix = "normal" + } + + withName: 'SENTIEON_TNSCOPE' { + ext.args = params.module_args + ext.args2 = params.module_args2 + } + +} + +env { + // NOTE This is how nf-core/sarek users will use Sentieon in real world use + SENTIEON_LICENSE = "$SENTIEON_LICSRVR_IP" + // NOTE This should only happen in GitHub actions or nf-core MegaTests + SENTIEON_AUTH_MECH = "$SENTIEON_AUTH_MECH" + SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA + // NOTE This is how nf-core/sarek users will test out Sentieon in Sarek with a license file + // nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) +} diff --git a/tests/modules/nf-core/sentieon/tnhaplotyper2/main.nf b/tests/modules/nf-core/sentieon/tnhaplotyper2/main.nf deleted file mode 100644 index a45f43e8564e..000000000000 --- a/tests/modules/nf-core/sentieon/tnhaplotyper2/main.nf +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PICARD_ADDORREPLACEREADGROUPS as NORMAL_ADDORREPLACEREADGROUPS } from '../../../../../modules/nf-core/picard/addorreplacereadgroups/main.nf' -include { PICARD_ADDORREPLACEREADGROUPS as TUMOUR_ADDORREPLACEREADGROUPS } from '../../../../../modules/nf-core/picard/addorreplacereadgroups/main.nf' -include { SAMTOOLS_INDEX } from '../../../../../modules/nf-core/samtools/index/main.nf' -include { SENTIEON_TNHAPLOTYPER2 as SENTIEON_TNHAPLOTYPER2_NO_PON } from '../../../../../modules/nf-core/sentieon/tnhaplotyper2/main.nf' -include { SENTIEON_TNHAPLOTYPER2 as SENTIEON_TNHAPLOTYPER2_PON } from '../../../../../modules/nf-core/sentieon/tnhaplotyper2/main.nf' -include { SENTIEON_TNHAPLOTYPER2 as SENTIEON_TNHAPLOTYPER2_CONTAM_ORIENT } from '../../../../../modules/nf-core/sentieon/tnhaplotyper2/main.nf' -include { SENTIEON_TNHAPLOTYPER2 as SENTIEON_TNHAPLOTYPER2_NO_NORMAL } from '../../../../../modules/nf-core/sentieon/tnhaplotyper2/main.nf' - -workflow test_tnhaplotyper2_no_pon { - - input_normal = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - input_tumour = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - NORMAL_ADDORREPLACEREADGROUPS(input_normal) - TUMOUR_ADDORREPLACEREADGROUPS(input_tumour) - - input = NORMAL_ADDORREPLACEREADGROUPS.out.bam - .join(NORMAL_ADDORREPLACEREADGROUPS.out.bai) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bam) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) - .map{ - meta, normal_bam, normal_bai, tumour_bam, tumour_bai -> - [ [id:'test'], [normal_bam, tumour_bam], [normal_bai, tumour_bai], [] ] - } - - dict = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) ] - fasta = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] - fai = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - germline_resource = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) ] - germline_resource_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) ] - - emit_contamination_data = false - emit_orientation_data = false - - SENTIEON_TNHAPLOTYPER2_NO_PON(input, dict, fasta, fai, germline_resource, germline_resource_tbi, [[:], []], [[:], []], emit_orientation_data, emit_contamination_data) - -} - -workflow test_tnhaplotyper2 { - - input_normal = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - input_tumour = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - NORMAL_ADDORREPLACEREADGROUPS(input_normal) - TUMOUR_ADDORREPLACEREADGROUPS(input_tumour) - - input = NORMAL_ADDORREPLACEREADGROUPS.out.bam - .join(NORMAL_ADDORREPLACEREADGROUPS.out.bai) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bam) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) - .map{ - meta, normal_bam, normal_bai, tumour_bam, tumour_bai -> - [ [id:'test'], [normal_bam, tumour_bam], [normal_bai, tumour_bai], [] ] - } - - dict = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) ] - fasta = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] - fai = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - germline_resource = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) ] - germline_resource_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) ] - panel_of_normals = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) ] - panel_of_normals_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) ] - - emit_contamination_data = false - emit_orientation_data = false - - SENTIEON_TNHAPLOTYPER2_PON(input, dict, fasta, fai, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi, emit_orientation_data, emit_contamination_data) - -} - -workflow test_tnhaplotyper2_emit_contamination_and_orientation_data { - - input_normal = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - input_tumour = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - NORMAL_ADDORREPLACEREADGROUPS(input_normal) - TUMOUR_ADDORREPLACEREADGROUPS(input_tumour) - - input = NORMAL_ADDORREPLACEREADGROUPS.out.bam - .join(NORMAL_ADDORREPLACEREADGROUPS.out.bai) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bam) - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) - .map{ - meta, normal_bam, normal_bai, tumour_bam, tumour_bai -> - [ [id:'test'], [normal_bam, tumour_bam], [normal_bai, tumour_bai], [] ] - } - - dict = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) ] - fasta = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] - fai = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - germline_resource = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) ] - germline_resource_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) ] - panel_of_normals = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) ] - panel_of_normals_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) ] - - emit_contamination_data = true - emit_orientation_data = true - - SENTIEON_TNHAPLOTYPER2_CONTAM_ORIENT(input, dict, fasta, fai, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi, emit_orientation_data, emit_contamination_data) - -} - -workflow test_tnhaplotyper2_no_normal { - - input_tumour = [ [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true) ] - ] - - TUMOUR_ADDORREPLACEREADGROUPS(input_tumour) - - input = TUMOUR_ADDORREPLACEREADGROUPS.out.bam - .join(TUMOUR_ADDORREPLACEREADGROUPS.out.bai) - .map{ - meta, tumour_bam, tumour_bai -> - [ meta, tumour_bam, tumour_bai, [] ] - } - - dict = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true) ] - fasta = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] - fai = [ [:], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - germline_resource = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz'], checkIfExists: true) ] - germline_resource_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_21_vcf_gz_tbi'], checkIfExists: true) ] - panel_of_normals = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) ] - panel_of_normals_tbi = [ [:], file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) ] - - emit_contamination_data = true - emit_orientation_data = true - - SENTIEON_TNHAPLOTYPER2_NO_NORMAL(input, dict, fasta, fai, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi, emit_orientation_data, emit_contamination_data) - -} diff --git a/tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config b/tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config deleted file mode 100644 index b09f68e1dc63..000000000000 --- a/tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config +++ /dev/null @@ -1,67 +0,0 @@ -env { - // NOTE This is how nf-core/sarek users will use Sentieon in real world use - SENTIEON_LICENSE = $SENTIEON_LICSRVR_IP - // NOTE This should only happen in GitHub actions or nf-core MegaTests - SENTIEON_AUTH_MECH = $SENTIEON_AUTH_MECH - SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA - // NOTE This is how nf-core/sarek users will test out Sentieon in Sarek with a license file - // nextflow secrets set SENTIEON_LICENSE_BASE64 $(cat | base64 -w 0) -} - -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - pattern: "*{.gz,.gz.tbi,.stats,.segments,.tsv}" - - withLabel: 'sentieon' { - ext.sentieon_auth_mech_base64 = secrets.SENTIEON_AUTH_MECH_BASE64 - ext.sentieon_auth_data_base64 = secrets.SENTIEON_AUTH_DATA_BASE64 - } - - withName: 'TUMOUR_ADDORREPLACEREADGROUPS' { - ext.prefix = { "tumour" } - ext.args = {[ - "--CREATE_INDEX true", - "-ID tumour", - "-LB tumour", - "-PL ILLUMINA", - "-PU bc1", - "-SM tumour" - ].join(' ').trim()} - publishDir = [ enabled: false ] - } - - withName: 'NORMAL_ADDORREPLACEREADGROUPS' { - ext.prefix = { "normal" } - ext.args = {[ - "--CREATE_INDEX true", - "-ID normal", - "-LB normal", - "-PL ILLUMINA", - "-PU bc1", - "-SM normal" - ].join(' ').trim()} - publishDir = [ enabled: false ] - } - - withName: 'SENTIEON_TNHAPLOTYPER2_NO_PON' { - ext.args2 = { "--tumor_sample tumour --normal_sample normal" } - } - - withName: 'SENTIEON_TNHAPLOTYPER2_PON' { - ext.args2 = { "--tumor_sample tumour --normal_sample normal" } - } - - withName: 'SENTIEON_TNHAPLOTYPER2_CONTAM_ORIENT' { - ext.args2 = { "--tumor_sample tumour --normal_sample normal" } - ext.args3 = { "--tumor_sample tumour" } - ext.args4 = { "--tumor_sample tumour --normal_sample normal" } - } - - withName: 'SENTIEON_TNHAPLOTYPER2_NO_NORMAL' { - ext.args2 = { "--tumor_sample tumour" } - ext.args3 = { "--tumor_sample tumour" } - ext.args4 = { "--tumor_sample tumour" } - } - -} diff --git a/tests/modules/nf-core/sentieon/tnhaplotyper2/test.yml b/tests/modules/nf-core/sentieon/tnhaplotyper2/test.yml deleted file mode 100644 index 3ba57005e4cc..000000000000 --- a/tests/modules/nf-core/sentieon/tnhaplotyper2/test.yml +++ /dev/null @@ -1,96 +0,0 @@ -- name: sentieon test_tnhaplotyper2_no_pon - command: nextflow run ./tests/modules/nf-core/sentieon/tnhaplotyper2 -entry test_tnhaplotyper2_no_pon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config - tags: - - sentieon - - sentieon/tnhaplotyper2 - files: - - path: ./output/sentieon/test.contamination_data.tsv - should_exist: false - - path: ./output/sentieon/test.orientation_data.tsv - should_exist: false - - path: ./output/sentieon/test.segments - should_exist: false - - path: ./output/sentieon/test.vcf.gz - contains: - [ - "##fileformat=VCFv4.2", - "chr21\t14517382\t.\tT\tG\t.\t.\tAS_SB_TABLE=0,13|0,2;DP=16;ECNT=1;MBQ=15,18;MFRL=475,379;MMQ=60,60;MPOS=43;NALOD=0.974;NLOD=2.4;POPAF=6;TLOD=5.13\tGT:AD:AF:DP:F1R2:F2R1:SB\t0/0:8,0:0.0966:8:0,0:0,0:0,8,0,0\t0/1:5,2:0.333:7:0,0:0,0:0,5,0,2", - ] - - path: ./output/sentieon/test.vcf.gz.stats - contains: ["statistic\tvalue", "callable\t1355166"] - - path: ./output/sentieon/test.vcf.gz.tbi - - path: ./output/sentieon/versions.yml -- name: sentieon test_tnhaplotyper2 - command: nextflow run ./tests/modules/nf-core/sentieon/tnhaplotyper2 -entry test_tnhaplotyper2 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config - tags: - - sentieon - - sentieon/tnhaplotyper2 - files: - - path: ./output/sentieon/test.contamination_data.tsv - should_exist: false - - path: ./output/sentieon/test.orientation_data.tsv - should_exist: false - - path: ./output/sentieon/test.segments - should_exist: false - - path: ./output/sentieon/test.vcf.gz - contains: - [ - "##fileformat=VCFv4.2", - "chr21\t14517382\t.\tT\tG\t.\t.\tAS_SB_TABLE=0,13|0,2;DP=16;ECNT=1;MBQ=15,18;MFRL=475,379;MMQ=60,60;MPOS=43;NALOD=0.974;NLOD=2.4;POPAF=6;TLOD=5.13\tGT:AD:AF:DP:F1R2:F2R1:SB\t0/0:8,0:0.0966:8:0,0:0,0:0,8,0,0\t0/1:5,2:0.333:7:0,0:0,0:0,5,0,2", - ] - - path: ./output/sentieon/test.vcf.gz.stats - contains: ["statistic\tvalue", "callable\t1355165"] - - path: ./output/sentieon/test.vcf.gz.tbi - - path: ./output/sentieon/versions.yml -- name: sentieon test_tnhaplotyper2_emit_contamination_and_orientation_data - command: nextflow run ./tests/modules/nf-core/sentieon/tnhaplotyper2 -entry test_tnhaplotyper2_emit_contamination_and_orientation_data -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config - tags: - - sentieon - - sentieon/tnhaplotyper2 - files: - - path: ./output/sentieon/test.contamination_data.tsv - contains: ["sample\tcontamination\terror", "tumour\t0\t0"] - - path: ./output/sentieon/test.orientation_data.tsv - contains: - [ - "context\trev_comp\tf1r2_a\tf1r2_c\tf1r2_g\tf1r2_t\tf2r1_a\tf2r1_c\tf2r1_g\tf2r1_t\thom_ref\tgermline_het\tsomatic_het\thom_var\tnum_examples\tnum_alt_examples", - "AAA\tTTT\t0\t1.76345e-06\t2.83275e-06\t1.80842e-06\t0\t1.76926e-06\t2.26334e-06\t1.86601e-06\t0.999085\t1.80047e-05\t0.000870119\t1.50035e-05\t56708\t130", - ] - - path: ./output/sentieon/test.segments - contains: ["contig\tstart\tend\tminor_allele_fraction", "chr21\t15825227\t44259057\t0.1157804769"] - - path: ./output/sentieon/test.vcf.gz - contains: - [ - "##fileformat=VCFv4.2", - "chr21\t14517382\t.\tT\tG\t.\t.\tAS_SB_TABLE=0,13|0,2;DP=16;ECNT=1;MBQ=15,18;MFRL=475,379;MMQ=60,60;MPOS=43;NALOD=0.974;NLOD=2.4;POPAF=6;TLOD=5.13\tGT:AD:AF:DP:F1R2:F2R1:SB\t0/0:8,0:0.0966:8:0,0:0,0:0,8,0,0\t0/1:5,2:0.333:7:0,0:0,0:0,5,0,2", - ] - - path: ./output/sentieon/test.vcf.gz.stats - contains: ["statistic\tvalue", "callable\t1355165"] - - path: ./output/sentieon/test.vcf.gz.tbi - - path: ./output/sentieon/versions.yml -- name: sentieon test_tnhaplotyper2_no_normal - command: nextflow run ./tests/modules/nf-core/sentieon/tnhaplotyper2 -entry test_tnhaplotyper2_no_normal -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/sentieon/tnhaplotyper2/nextflow.config - tags: - - sentieon - - sentieon/tnhaplotyper2 - files: - - path: ./output/sentieon/test.contamination_data.tsv - contains: ["sample\tcontamination\terror", "tumour\t0\t0"] - - path: ./output/sentieon/test.orientation_data.tsv - contains: - [ - "context\trev_comp\tf1r2_a\tf1r2_c\tf1r2_g\tf1r2_t\tf2r1_a\tf2r1_c\tf2r1_g\tf2r1_t\thom_ref\tgermline_het\tsomatic_het\thom_var\tnum_examples\tnum_alt_examples", - "AAA\tTTT\t0\t1.76345e-06\t2.83275e-06\t1.80842e-06\t0\t1.76926e-06\t2.26334e-06\t1.86601e-06\t0.999085\t1.80047e-05\t0.000870119\t1.50035e-05\t56708\t130", - ] - - path: ./output/sentieon/test.segments - contains: ["contig\tstart\tend\tminor_allele_fraction", "chr21\t15825227\t44259057\t0.1157804769"] - - path: ./output/sentieon/test.vcf.gz - contains: - [ - "##fileformat=VCFv4.2", - "chr21\t6121094\t.\tC\tA\t.\t.\tAS_SB_TABLE=0,4|0,1;DP=6;ECNT=1;MBQ=12,23;MFRL=428,456;MMQ=21,21;MPOS=37;POPAF=7.3;TLOD=3.06\tGT:AD:AF:DP:F1R2:F2R1:SB\t0/1:4,1:0.306:5:0,1:0,0:0,4,0,1", - ] - - path: ./output/sentieon/test.vcf.gz.stats - contains: ["statistic\tvalue", "callable\t1235713"] - - path: ./output/sentieon/test.vcf.gz.tbi - - path: ./output/sentieon/versions.yml diff --git a/tests/modules/nf-core/sentieon/tnscope/main.nf b/tests/modules/nf-core/sentieon/tnscope/main.nf deleted file mode 100644 index 0045abc4c973..000000000000 --- a/tests/modules/nf-core/sentieon/tnscope/main.nf +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PICARD_ADDORREPLACEREADGROUPS } from '../../../../../modules/nf-core/picard/addorreplacereadgroups/main.nf' -include { SAMTOOLS_INDEX } from '../../../../../modules/nf-core/samtools/index/main.nf' -include { SENTIEON_TNSCOPE } from '../../../../../modules/nf-core/sentieon/tnscope/main.nf' - -workflow test_tnscope { - - fasta = Channel.of([ [ id:'test' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)]).collect() - fai = Channel.of([ [ id:'test' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)]).collect() - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - ] - - PICARD_ADDORREPLACEREADGROUPS ( input ) - - SAMTOOLS_INDEX (PICARD_ADDORREPLACEREADGROUPS.out.bam) - - ch_tnscope_in = PICARD_ADDORREPLACEREADGROUPS.out.bam.join(SAMTOOLS_INDEX.out.bai) - - SENTIEON_TNSCOPE ( ch_tnscope_in, fasta, fai, [[:],[],[]], [[:],[],[]], [[:],[],[]], [[:],[]] ) -} diff --git a/tests/modules/nf-core/sentieon/tnscope/nextflow.config b/tests/modules/nf-core/sentieon/tnscope/nextflow.config deleted file mode 100644 index 74d2a487c301..000000000000 --- a/tests/modules/nf-core/sentieon/tnscope/nextflow.config +++ /dev/null @@ -1,29 +0,0 @@ -env { - // NOTE This is how nf-core/sarek users will use Sentieon in real world use - SENTIEON_LICENSE = $SENTIEON_LICSRVR_IP - // NOTE This should only happen in GitHub actions or nf-core MegaTests - SENTIEON_AUTH_MECH = $SENTIEON_AUTH_MECH - SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA - // NOTE This is how nf-core/sarek users will test out Sentieon in Sarek with a license file - // nextflow secrets set SENTIEON_LICENSE_BASE64 $(cat | base64 -w 0) -} - -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withLabel: 'sentieon' { - ext.sentieon_auth_mech_base64 = secrets.SENTIEON_AUTH_MECH_BASE64 - ext.sentieon_auth_data_base64 = secrets.SENTIEON_AUTH_DATA_BASE64 - } - - withName: 'PICARD_ADDORREPLACEREADGROUPS'{ - ext.args = {[ - "-LB ${meta.id}", - "-PL ILLUMINA", - "-PU bc1", - "-SM ${meta.id}" - ].join(' ').trim()} - } - -} diff --git a/tests/modules/nf-core/sentieon/tnscope/test.yml b/tests/modules/nf-core/sentieon/tnscope/test.yml deleted file mode 100644 index 1c14e35104a3..000000000000 --- a/tests/modules/nf-core/sentieon/tnscope/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: sentieon test_tnscope - command: nextflow run ./tests/modules/nf-core/sentieon/tnscope -entry test_tnscope -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/sentieon/tnscope/nextflow.config - tags: - - sentieon - - sentieon/tnscope - files: - - path: ./output/sentieon/test.vcf.gz - contains: ["##fileformat=VCFv4.2"] - - path: ./output/sentieon/test.vcf.gz.tbi - - path: ./output/sentieon/versions.yml