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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- GT field is necessary for rtgtools vcfeval, strelka reports no GT field for somatic analysis. Fixing the GT field setup for strelka (bcftools plugingtset doesnt work as GT is not available) [#279](https://github.com/nf-core/variantbenchmarking/pull/279)
- Using nf-metro to create better metromap [#281](https://github.com/nf-core/variantbenchmarking/pull/281)
- Remove unneccesery reheadering of the vcf outputs of rtgtools and truvari [#286](https://github.com/nf-core/variantbenchmarking/pull/286)
- Fixing bugs: bnd vcfeval output files producing tags with [] and reformatting header before merging in ensemble analysis [#297](https://github.com/nf-core/variantbenchmarking/pull/297)

### `Dependencies`

Expand Down
8 changes: 8 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@ process {
]
}

withName: BCFTOOLS_UNIFY_HEADER {
ext.prefix = {"${meta.id}.unify"}
ext.args = {"-x FORMAT/AD,FORMAT/PL --output-type z --write-index=tbi"}
publishDir = [
enabled: false
]
}

withName: REFORMAT_TRUTH {
ext.prefix = { input[0].baseName + '.reformatted' }
ext.suffix = "vcf"
Expand Down
5 changes: 3 additions & 2 deletions subworkflows/local/concordance_analysis/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ workflow CONCORDANCE_ANALYSIS {
}

ch_bed_input = bed_ch
.map { file -> tuple(["id": "intervals"], file) }
.ifEmpty([[:], []])
.map { file -> [ [id: "intervals"], file ] }
.collect()
.ifEmpty( [ [id: "intervals"], [] ] )

// GATK4 concordance does not support structural variants now - GATK4 SVCONCORDANCE is in beta
GATK4_CONCORDANCE(
Expand Down
9 changes: 8 additions & 1 deletion subworkflows/local/ensemble_test_vcfs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include { GAWK as REFORMAT_TRUTH_SV } from '../../../modules/nf-core/g
include { GAWK as INJECT_MISSING_GT } from '../../../modules/nf-core/gawk'
include { BCFTOOLS_SORT as BCFTOOLS_SORT_SV } from '../../../modules/nf-core/bcftools/sort'
include { TABIX_BGZIP as TABIX_BGZIP_UNZIP } from '../../../modules/nf-core/tabix/bgzip'
include { BCFTOOLS_ANNOTATE as BCFTOOLS_UNIFY_HEADER } from '../../../modules/nf-core/bcftools/annotate'

workflow ENSEMLE_TEST_VCFS {
take:
Expand All @@ -22,8 +23,14 @@ workflow ENSEMLE_TEST_VCFS {

main:

// unify header for callers
BCFTOOLS_UNIFY_HEADER(
test_vcfs.map{meta, vcf, index -> [meta, vcf, index, [], []]},
[],[],[]
)

// if the benchmarking method is rtgtools, missing GT field is already filled in VCF preperation step, so no need to inject missing GT field
test_vcfs.branch { meta, vcf, index ->
BCFTOOLS_UNIFY_HEADER.out.vcf.join(BCFTOOLS_UNIFY_HEADER.out.tbi).branch { meta, vcf, index ->
def is_rtg = params.method?.contains("rtgtools")
def is_strelka_manta = ['strelka', 'manta'].contains(meta.caller.toLowerCase())
def is_somatic = params.analysis == "somatic"
Expand Down
22 changes: 7 additions & 15 deletions workflows/variantbenchmarking.nf
Original file line number Diff line number Diff line change
Expand Up @@ -288,21 +288,13 @@ workflow VARIANTBENCHMARKING {
ch_reports = ch_reports.mix(RTGTOOLS_BNDEVAL.out.summary
.map { _meta, file -> tuple([vartype: params.variant_type] + [benchmark_tool: "rtgtools"], file) }
.groupTuple())
evals_ch = evals_ch.mix(RTGTOOLS_BNDEVAL.out.fn_vcf,
RTGTOOLS_BNDEVAL.out.fp_vcf,
RTGTOOLS_BNDEVAL.out.baseline_vcf,
RTGTOOLS_BNDEVAL.out.tp_vcf)
.map { meta, file ->
def mapping = [
'fn': 'FN',
'fp': 'FP',
'tp-baseline': 'TP_base',
'tp': 'TP_comp'
]
def tag = file.getName().tokenize('.').find { token -> token in ['fn', 'fp', 'tp-baseline', 'tp'] }
def transformedTag = mapping[tag] ?: tag
tuple( [ meta + [vartype: params.variant_type, id: "rtgtools", tag: transformedTag]], file)
}

evals_ch = evals_ch.mix(
RTGTOOLS_BNDEVAL.out.fn_vcf.map { _meta, file -> tuple([vartype: params.variant_type] + [tag: "FN"] + [id: "rtgtools"], file) },
RTGTOOLS_BNDEVAL.out.fp_vcf.map { _meta, file -> tuple([vartype: params.variant_type] + [tag: "FP"] + [id: "rtgtools"], file) },
RTGTOOLS_BNDEVAL.out.baseline_vcf.map { _meta, file -> tuple([vartype: params.variant_type] + [tag: "TP_base"] + [id: "rtgtools"], file) },
RTGTOOLS_BNDEVAL.out.tp_vcf.map { _meta, file -> tuple([vartype: params.variant_type] + [tag: "TP_comp"] + [id: "rtgtools"], file) }
)
}
}

Expand Down
Loading