diff --git a/conf/modules.config b/conf/modules.config index ec90f74..c6f6fe6 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -192,7 +192,7 @@ process { ext.when = { params.method.split(',').contains('svanalyzer') } publishDir = [ path: {"${params.outdir}/${meta.id}/svanalyzer_bench"}, - pattern: "*{.vcf,distances,log,report}", + pattern: "*{.vcf.gz,tbi,distances,log,report}", mode: params.publish_dir_mode ] } @@ -242,7 +242,7 @@ process { withName: MERGE_REPORTS { ext.prefix = {"${meta.benchmark_tool}.${meta.vartype}"} publishDir = [ - path: {"${params.outdir}/summary"}, + path: {"${params.outdir}/summary/tables"}, pattern: "*{txt}", mode: params.publish_dir_mode ] @@ -255,6 +255,28 @@ process { mode: params.publish_dir_mode ] } + + withName: TABIX_BGZIP_BENCH{ + ext.prefix = {input.toString() - ".vcf.gz"} + } + + withName: SURVIVOR_MERGE { + ext.prefix = {"${meta.id}.${meta.vartype}.${meta.tag}"} + publishDir = [ + path: {"${params.outdir}/summary/merged_vcf"}, + pattern: "*{vcf}", + mode: params.publish_dir_mode + ] + } + withName: BCFTOOLS_QUERY { + ext.prefix = {"${meta.id}.${meta.vartype}.${meta.tag}"} + ext.args = {"-f '%CHROM\t%POS\t%INFO/SVTYPE\t%INFO/SVLEN\t%INFO/SUPP_VEC\t%INFO/SUPP\t%ID[\t%SAMPLE]'" } + publishDir = [ + path: {"${params.outdir}/summary/merged_vcf"}, + pattern: "*{.txt}", + mode: params.publish_dir_mode + ] + } } // // Don't publish results for these processes diff --git a/conf/test_full.config b/conf/test_full.config index ef22bb0..ed7ebf3 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -27,7 +27,7 @@ params { // Processes analysis = 'germline' - method = 'rtgtools,happy,truvari,svanalyzer' // + method = 'happy,truvari,svanalyzer' // similarity = 0 preprocess = "normalization,deduplication,prepy" //variant_filtering = "include" // null, include, exclude diff --git a/modules.json b/modules.json index ee59ee6..c7484f6 100644 --- a/modules.json +++ b/modules.json @@ -15,6 +15,11 @@ "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", "installed_by": ["modules"] }, + "bcftools/query": { + "branch": "master", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", + "installed_by": ["modules"] + }, "bcftools/reheader": { "branch": "master", "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", @@ -75,6 +80,11 @@ "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", "installed_by": ["modules"] }, + "survivor/merge": { + "branch": "master", + "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "installed_by": ["modules"] + }, "survivor/stats": { "branch": "master", "git_sha": "398375d72766cac92c4ffcf6927cac2d65310cfd", diff --git a/modules/local/visualize_tagged/environment.yml b/modules/local/visualize_tagged/environment.yml new file mode 100644 index 0000000..6d60d87 --- /dev/null +++ b/modules/local/visualize_tagged/environment.yml @@ -0,0 +1,7 @@ +name: plots +channels: + - conda-forge +dependencies: + - r-base=4.1.* + - r-ggplot2=3.3.* + - r-reshape2=1.4.* diff --git a/modules/local/visualize_tagged/main.nf b/modules/local/visualize_tagged/main.nf new file mode 100644 index 0000000..2f4ee02 --- /dev/null +++ b/modules/local/visualize_tagged/main.nf @@ -0,0 +1,43 @@ +process VISUALIZE_TAGGED { + tag "$meta.benchmark_tool" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.4--r43hdfd78af_0': + 'biocontainers/r-shinyngs:1.8.4--r43hdfd78af_0' }" + + input: + tuple val(meta), path(vcf) + + output: + tuple val(meta),path("*.txt"), emit: plots + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.benchmark_tool}" + + """ + grep -o 'SUPP_VEC=[^,;]*' $vcf | awk -F'=' '{print \$2}' | sed -e 's/\\(.\\)/\\1 /g' > ${vcf}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') + END_VERSIONS + """ + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.benchmark_tool}" + """ + touch ${vcf}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/bcftools/query/environment.yml b/modules/nf-core/bcftools/query/environment.yml new file mode 100644 index 0000000..d8c4f4e --- /dev/null +++ b/modules/nf-core/bcftools/query/environment.yml @@ -0,0 +1,7 @@ +name: bcftools_query +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/query/main.nf b/modules/nf-core/bcftools/query/main.nf new file mode 100644 index 0000000..58019f4 --- /dev/null +++ b/modules/nf-core/bcftools/query/main.nf @@ -0,0 +1,56 @@ +process BCFTOOLS_QUERY { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" + + input: + tuple val(meta), path(vcf), path(tbi) + path regions + path targets + path samples + + output: + tuple val(meta), path("*.${suffix}"), emit: output + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + suffix = task.ext.suffix ?: "txt" + def regions_file = regions ? "--regions-file ${regions}" : "" + def targets_file = targets ? "--targets-file ${targets}" : "" + def samples_file = samples ? "--samples-file ${samples}" : "" + """ + bcftools query \\ + $regions_file \\ + $targets_file \\ + $samples_file \\ + $args \\ + $vcf \\ + > ${prefix}.${suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + suffix = task.ext.suffix ?: "txt" + """ + touch ${prefix}.${suffix} \\ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/bcftools/query/meta.yml b/modules/nf-core/bcftools/query/meta.yml new file mode 100644 index 0000000..303ef61 --- /dev/null +++ b/modules/nf-core/bcftools/query/meta.yml @@ -0,0 +1,63 @@ +name: bcftools_query +description: Extracts fields from VCF or BCF files and outputs them in user-defined format. +keywords: + - query + - variant calling + - bcftools + - VCF +tools: + - query: + description: | + Extracts fields from VCF or BCF files and outputs them in user-defined format. + homepage: http://samtools.github.io/bcftools/bcftools.html + documentation: http://www.htslib.org/doc/bcftools.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be qeuried. + pattern: "*.{vcf.gz, vcf}" + - tbi: + type: file + description: | + The tab index for the VCF file to be inspected. + pattern: "*.tbi" + - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. + - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon index files) + - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - output: + type: file + description: BCFTools query output file + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@abhi18av" + - "@drpatelh" +maintainers: + - "@abhi18av" + - "@drpatelh" diff --git a/modules/nf-core/bcftools/query/tests/main.nf.test b/modules/nf-core/bcftools/query/tests/main.nf.test new file mode 100644 index 0000000..e9ea5a9 --- /dev/null +++ b/modules/nf-core/bcftools/query/tests/main.nf.test @@ -0,0 +1,101 @@ +nextflow_process { + + name "Test Process BCFTOOLS_QUERY" + script "../main.nf" + process "BCFTOOLS_QUERY" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/query" + + config "./nextflow.config" + + test("sarscov2 - [vcf, tbi], [], [], []") { + + when { + process { + """ + input[0] = [ + [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.output, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], vcf, tsv, []") { + + when { + process { + """ + input[0] = [ + [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + ] + input[1] = file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) + input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_targets_tsv_gz'], checkIfExists: true) + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.output, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi], [], [], [] - stub") { + + when { + process { + """ + input[0] = [ + [ id:'out' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.output[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bcftools/query/tests/main.nf.test.snap b/modules/nf-core/bcftools/query/tests/main.nf.test.snap new file mode 100644 index 0000000..3ead1f2 --- /dev/null +++ b/modules/nf-core/bcftools/query/tests/main.nf.test.snap @@ -0,0 +1,55 @@ +{ + "sarscov2 - [vcf, tbi], vcf, tsv, []": { + "content": [ + [ + [ + { + "id": "out" + }, + "out.txt:md5,75a6bd0084e2e1838cf7baba11b99d19" + ] + ], + [ + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:44.916249758" + }, + "sarscov2 - [vcf, tbi], [], [], [] - stub": { + "content": [ + "out.txt", + [ + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:49.932359271" + }, + "sarscov2 - [vcf, tbi], [], [], []": { + "content": [ + [ + [ + { + "id": "out" + }, + "out.txt:md5,87a2ab194e1ee3219b44e58429ec3307" + ] + ], + [ + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:39.930697926" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/query/tests/nextflow.config b/modules/nf-core/bcftools/query/tests/nextflow.config new file mode 100644 index 0000000..da81c2a --- /dev/null +++ b/modules/nf-core/bcftools/query/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = "-f '%CHROM %POS %REF %ALT[%SAMPLE=%GT]'" +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/query/tests/tags.yml b/modules/nf-core/bcftools/query/tests/tags.yml new file mode 100644 index 0000000..fb9455c --- /dev/null +++ b/modules/nf-core/bcftools/query/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/query: + - "modules/nf-core/bcftools/query/**" diff --git a/modules/nf-core/survivor/merge/environment.yml b/modules/nf-core/survivor/merge/environment.yml new file mode 100644 index 0000000..9f46e0d --- /dev/null +++ b/modules/nf-core/survivor/merge/environment.yml @@ -0,0 +1,7 @@ +name: survivor_merge +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::survivor=1.0.7 diff --git a/modules/nf-core/survivor/merge/main.nf b/modules/nf-core/survivor/merge/main.nf new file mode 100644 index 0000000..abff33a --- /dev/null +++ b/modules/nf-core/survivor/merge/main.nf @@ -0,0 +1,71 @@ +process SURVIVOR_MERGE { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/survivor:1.0.7--h9a82719_1': + 'biocontainers/survivor:1.0.7--h9a82719_1' }" + + input: + tuple val(meta), path(vcfs) + val(max_distance_breakpoints) + val(min_supporting_callers) + val(account_for_type) + val(account_for_sv_strands) + val(estimate_distanced_by_sv_size) + val(min_sv_size) + + output: + tuple val(meta), path("*.vcf") , emit: vcf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + + vcfs.each{ + if (it.getExtension() == "gz"){ + error "Gzipped files are not supported by Survivor, please gunzip your VCF files first." + // https://github.com/fritzsedlazeck/SURVIVOR/issues/158 + } + } + + """ + SURVIVOR merge \\ + <(ls *.vcf) \\ + ${max_distance_breakpoints} \\ + ${min_supporting_callers} \\ + ${account_for_type} \\ + ${account_for_sv_strands} \\ + ${estimate_distanced_by_sv_size} \\ + ${min_sv_size} \\ + ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + + vcfs.each{ + if (it.getExtension() == "gz"){ + error "Gzipped files are not supported by Survivor, please gunzip your VCF files first." + // https://github.com/fritzsedlazeck/SURVIVOR/issues/158 + } + } + + """ + touch ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) + END_VERSIONS + """ +} diff --git a/modules/nf-core/survivor/merge/meta.yml b/modules/nf-core/survivor/merge/meta.yml new file mode 100644 index 0000000..a7c2e2b --- /dev/null +++ b/modules/nf-core/survivor/merge/meta.yml @@ -0,0 +1,63 @@ +name: "survivor_merge" +description: Compare or merge VCF files to generate a consensus or multi sample VCF files. +keywords: + - survivor + - merge + - vcf + - structural variants +tools: + - "survivor": + description: "Toolset for SV simulation, comparison and filtering" + homepage: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + documentation: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" + tool_dev_url: "https://github.com/fritzsedlazeck/SURVIVOR" + doi: "10.1038/NCOMMS14061" + licence: "['MIT']" +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcfs: + type: files + description: | + The VCF files to be merged + Gzipped VCF files are not supported: https://github.com/fritzsedlazeck/SURVIVOR/issues/158 + pattern: "*.vcf" + - max_distance_breakpoints: + type: integer + description: Max distance between breakpoints (0-1 percent of length, 1- number of bp) + - min_supporting_callers: + type: integer + description: Minimum number of supporting caller + - account_for_type: + type: integer + description: Take the type into account (1==yes, else no) + - account_for_sv_strands: + type: integer + description: Take the strands of SVs into account (1==yes, else no) + - estimate_distanced_by_sv_size: + type: integer + description: Estimate distance based on the size of SV (1==yes, else no) + - min_sv_size: + type: integer + description: Minimum size of SVs to be taken into account +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: The merged VCF file + pattern: "*.vcf" +authors: + - "@nvnieuwk" +maintainers: + - "@nvnieuwk" diff --git a/subworkflows/local/compare_benchmark_results.nf b/subworkflows/local/compare_benchmark_results.nf new file mode 100644 index 0000000..66cf939 --- /dev/null +++ b/subworkflows/local/compare_benchmark_results.nf @@ -0,0 +1,68 @@ + +// +// COMPARE_BENCHMARK_RESULTS: SUBWORKFLOW to merge tp/fp/fn results from different tools. +// + +params.options = [:] + +include { BCFTOOLS_QUERY } from '../../modules/nf-core/bcftools/query' addParams( options: params.options ) +include { SURVIVOR_MERGE } from '../../modules/nf-core/survivor/merge' addParams( options: params.options ) +include { TABIX_BGZIPTABIX } from '../../modules/nf-core/tabix/bgziptabix' addParams( options: params.options ) +include { TABIX_BGZIP as TABIX_BGZIP_BENCH } from '../../modules/nf-core/tabix/bgzip' addParams( options: params.options ) + +workflow COMPARE_BENCHMARK_RESULTS { + take: + input_ch // channel: [val(meta), vcf.gz] + fai + + main: + versions = Channel.empty() + + // + // MODULE: TABIX_BGZIP + // + // unzip vcfs + + TABIX_BGZIP_BENCH( + input_ch + ) + versions = versions.mix(TABIX_BGZIP_BENCH.out.versions) + + TABIX_BGZIP_BENCH.out.output + .groupTuple() + .set{vcf_ch} + + // + // MODULE: SURVIVOR_MERGE + // + // Merge Benchmark SVs from different tools + SURVIVOR_MERGE( + vcf_ch, + 1000, + 1, + 1, + 0, + 0, + 30 + ) + versions = versions.mix(SURVIVOR_MERGE.out.versions) + + TABIX_BGZIPTABIX( + SURVIVOR_MERGE.out.vcf + ) + versions = versions.mix(TABIX_BGZIPTABIX.out.versions) + + // add a plot to see better supported variants + // https://github.com/fritzsedlazeck/SURVIVOR/wiki + + BCFTOOLS_QUERY( + TABIX_BGZIPTABIX.out.gz_tbi, + [], + [], + [] + ) + versions = versions.mix(BCFTOOLS_QUERY.out.versions) + + emit: + versions +} diff --git a/subworkflows/local/sv_germline_benchmark.nf b/subworkflows/local/sv_germline_benchmark.nf index 480f290..945ec18 100644 --- a/subworkflows/local/sv_germline_benchmark.nf +++ b/subworkflows/local/sv_germline_benchmark.nf @@ -20,6 +20,7 @@ workflow SV_GERMLINE_BENCHMARK { versions=Channel.empty() summary_reports=Channel.empty() + tagged_variants=Channel.empty() // SV benchmarking @@ -51,6 +52,28 @@ workflow SV_GERMLINE_BENCHMARK { .set { report } summary_reports = summary_reports.mix(report) + + TRUVARI_BENCH.out.fn_vcf + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "FN"] + [id: "truvari"], file) } + .set { vcf_fn } + + TRUVARI_BENCH.out.fp_vcf + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "FP"] + [id: "truvari"], file) } + .set { vcf_fp } + + TRUVARI_BENCH.out.tp_base_vcf + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "TP_base"] + [id: "truvari"], file) } + .set { vcf_tp_base } + + TRUVARI_BENCH.out.tp_comp_vcf + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "TP_comp"] + [id: "truvari"], file) } + .set { vcf_tp_comp } + + tagged_variants = tagged_variants.mix(vcf_fn) + tagged_variants = tagged_variants.mix(vcf_fp) + tagged_variants = tagged_variants.mix(vcf_tp_base) + tagged_variants = tagged_variants.mix(vcf_tp_comp) + } if (params.method.contains('svanalyzer')){ @@ -72,6 +95,16 @@ workflow SV_GERMLINE_BENCHMARK { summary_reports = summary_reports.mix(report) + SVANALYZER_SVBENCHMARK.out.fns + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "FN"] + [id: "svbenchmark"], file) } + .set { vcf_fn } + + SVANALYZER_SVBENCHMARK.out.fps + .map { meta, file -> tuple([vartype: meta.vartype] + [tag: "FP"] + [id: "svbenchmark"], file) } + .set { vcf_fp } + tagged_variants = tagged_variants.mix(vcf_fn) + tagged_variants = tagged_variants.mix(vcf_fp) + } if (params.method.contains('wittyer')){ @@ -100,6 +133,7 @@ workflow SV_GERMLINE_BENCHMARK { } emit: + tagged_variants summary_reports versions } diff --git a/workflows/variantbenchmarking.nf b/workflows/variantbenchmarking.nf index 8046031..6428021 100644 --- a/workflows/variantbenchmarking.nf +++ b/workflows/variantbenchmarking.nf @@ -35,6 +35,7 @@ include { SV_GERMLINE_BENCHMARK } from '../subworkflows/local/sv_germline_ include { SMALL_GERMLINE_BENCHMARK } from '../subworkflows/local/small_germline_benchmark' include { SMALL_SOMATIC_BENCHMARK } from '../subworkflows/local/small_somatic_benchmark' include { REPORT_BENCHMARK_STATISTICS } from '../subworkflows/local/report_benchmark_statistics' +include { COMPARE_BENCHMARK_RESULTS } from '../subworkflows/local/compare_benchmark_results' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -55,6 +56,7 @@ workflow VARIANTBENCHMARKING { truth_ch = Channel.empty() high_conf_ch = Channel.empty() bench_ch = Channel.empty() + tagged_vars_ch = Channel.empty() // check mandatory parameters println(params.fasta) @@ -313,9 +315,11 @@ workflow VARIANTBENCHMARKING { fai ) ch_versions = ch_versions.mix(SV_GERMLINE_BENCHMARK.out.versions) ch_reports = ch_reports.mix(SV_GERMLINE_BENCHMARK.out.summary_reports) + tagged_vars_ch = tagged_vars_ch.mix(SV_GERMLINE_BENCHMARK.out.tagged_variants) } - bench_ch.view() + tagged_vars_ch.view() + // TODO: SOMATIC BENCHMARKING if (params.analysis.contains("somatic")){ @@ -330,6 +334,14 @@ workflow VARIANTBENCHMARKING { ch_reports = ch_reports.mix(SMALL_SOMATIC_BENCHMARK.out.summary_reports) } + // + // SUBWORKFLOW: COMPARE_BENCHMARK_RESULTS + // + COMPARE_BENCHMARK_RESULTS( + tagged_vars_ch, + fai + ) + ch_versions = ch_versions.mix(COMPARE_BENCHMARK_RESULTS.out.versions) // // SUBWORKFLOW: REPORT_BENCHMARK_STATISTICS