From 6c3e41549eee8b8f0726ee19d532a470e8f515c6 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:42:23 +0200 Subject: [PATCH 1/5] fix bcftools errors --- conf/modules/merge_annotate_MT.config | 1 + conf/modules/raredisease.config | 3 +-- lib/WorkflowRaredisease.groovy | 19 +++++++++++++++++++ .../local/mitochondria/merge_annotate_MT.nf | 6 +++++- workflows/raredisease.nf | 15 ++++----------- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/conf/modules/merge_annotate_MT.config b/conf/modules/merge_annotate_MT.config index 027c6805..ae2601b6 100644 --- a/conf/modules/merge_annotate_MT.config +++ b/conf/modules/merge_annotate_MT.config @@ -36,6 +36,7 @@ process { } withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:BCFTOOLS_MERGE_MT' { + ext.args = '--output-type z' ext.prefix = { "${meta.id}_merge_mt" } } diff --git a/conf/modules/raredisease.config b/conf/modules/raredisease.config index cf5dea7b..c2d84968 100644 --- a/conf/modules/raredisease.config +++ b/conf/modules/raredisease.config @@ -71,9 +71,8 @@ process { // process { - withName: '.*RAREDISEASE:BCFTOOLS_CONCAT' { + withName: '.*RAREDISEASE:GATK4_MERGEVCFS' { ext.prefix = { "${meta.id}_mito_genome_merged" } - ext.args = " -a " } } diff --git a/lib/WorkflowRaredisease.groovy b/lib/WorkflowRaredisease.groovy index 99e5f500..9abe7dcb 100755 --- a/lib/WorkflowRaredisease.groovy +++ b/lib/WorkflowRaredisease.groovy @@ -16,6 +16,25 @@ class WorkflowRaredisease { } + // + // Replace spaces in vcf INFO fields with underscore + // + public static String replaceSpacesInInfoColumn(vcf_file, parent_dir, base_name) { + def outfile = new File(parent_dir + '/' + base_name + '_formatted.vcf') + def writer = outfile.newWriter() + vcf_file.eachLine { line -> + if (line.startsWith("#")) { + writer << line + "\n" + } else { + def split_str = line.tokenize("\t") + split_str[7] = split_str.getAt(7).replaceAll(" ","_") + writer << split_str.join("\t") + "\n" + } + } + writer.close() + return outfile + } + // // Get workflow summary for MultiQC // diff --git a/subworkflows/local/mitochondria/merge_annotate_MT.nf b/subworkflows/local/mitochondria/merge_annotate_MT.nf index 8a78ed27..43edd93b 100644 --- a/subworkflows/local/mitochondria/merge_annotate_MT.nf +++ b/subworkflows/local/mitochondria/merge_annotate_MT.nf @@ -143,7 +143,11 @@ workflow MERGE_ANNOTATE_MT { // HMTNOTE ANNOTATE HMTNOTE_ANNOTATE(VCFANNO_MT.out.vcf) - ZIP_TABIX_HMTNOTE(HMTNOTE_ANNOTATE.out.vcf) + HMTNOTE_ANNOTATE.out.vcf.map{meta, vcf -> + return [meta, WorkflowRaredisease.replaceSpacesInInfoColumn(vcf, vcf.parent.toString(), vcf.baseName)] + } + .set { ch_hmtnote_reformatted } + ZIP_TABIX_HMTNOTE(ch_hmtnote_reformatted) // Prepare output ch_vcf_out = ZIP_TABIX_HMTNOTE.out.gz_tbi.map{meta, vcf, tbi -> return [meta, vcf] } diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf index e5497222..5bff2aeb 100644 --- a/workflows/raredisease.nf +++ b/workflows/raredisease.nf @@ -97,7 +97,7 @@ include { FILTER_VEP as FILTER_VEP_SV } from '../modules/local/filter_ // MODULE: Installed directly from nf-core/modules // -include { BCFTOOLS_CONCAT } from '../modules/nf-core/bcftools/concat/main' +include { GATK4_MERGEVCFS } from '../modules/nf-core/gatk4/mergevcfs/main' include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' include { FASTQC } from '../modules/nf-core/fastqc/main' include { GATK4_SELECTVARIANTS } from '../modules/nf-core/gatk4/selectvariants/main' @@ -483,16 +483,9 @@ workflow RAREDISEASE { .groupTuple() .set { ch_merged_vcf } - ANNOTATE_SNVS.out.tbi - .concat(ANALYSE_MT.out.tbi) - .groupTuple() - .set { ch_merged_tbi } - - ch_merged_vcf.join(ch_merged_tbi, failOnMismatch:true, failOnDuplicate:true).set {ch_concat_in} - - BCFTOOLS_CONCAT (ch_concat_in) - ch_snv_annotate = BCFTOOLS_CONCAT.out.vcf - ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions) + GATK4_MERGEVCFS (ch_merged_vcf, [[],[]]) + ch_snv_annotate = GATK4_MERGEVCFS.out.vcf + ch_versions = ch_versions.mix(GATK4_MERGEVCFS.out.versions) } ANN_CSQ_PLI_SNV ( From 8d82f2e07cd5fbbe378fce4795c7401dd7ae5da5 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:46:37 +0200 Subject: [PATCH 2/5] bump version --- assets/multiqc_config.yml | 4 ++-- nextflow.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 8388320b..ebb33ec8 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -3,9 +3,9 @@ custom_logo_url: https://github.com/nf-core/raredisease/ custom_logo_title: "nf-core/raredisease" report_comment: > - This report has been generated by the nf-core/raredisease + This report has been generated by the nf-core/raredisease analysis pipeline. For information about how to interpret these results, please see the - documentation. + documentation. report_section_order: "nf-core-raredisease-methods-description": order: -1000 diff --git a/nextflow.config b/nextflow.config index 9faa8055..6ff7e6ce 100644 --- a/nextflow.config +++ b/nextflow.config @@ -271,7 +271,7 @@ manifest { description = """call and score variants from WGS/WES of rare disease patients""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '1.1.0' + version = '1.1.1' doi = '' } From 914cb742009d6727ce9e0fb217450f0d78254a6a Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:59:09 +0200 Subject: [PATCH 3/5] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c92d787..ad0966ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.1.1 - Abu (Patch) [xxxx-xx-xx] + +### `Fixed` + +- Avoids errors thrown by bcftools concat due to sample names in input vcf files not being in same order [#388](https://github.com/nf-core/raredisease/pull/388) + ## v1.1.0 - Abu [2023-07-21] ### `Added` From f2dcba3ab5631c2cf79b68094e90b6032f78e0dc Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:48:56 +0200 Subject: [PATCH 4/5] pass seq dict to mergevcfs --- workflows/raredisease.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf index 5bff2aeb..7d01dd2e 100644 --- a/workflows/raredisease.nf +++ b/workflows/raredisease.nf @@ -483,7 +483,7 @@ workflow RAREDISEASE { .groupTuple() .set { ch_merged_vcf } - GATK4_MERGEVCFS (ch_merged_vcf, [[],[]]) + GATK4_MERGEVCFS (ch_merged_vcf, ch_genome_dictionary) ch_snv_annotate = GATK4_MERGEVCFS.out.vcf ch_versions = ch_versions.mix(GATK4_MERGEVCFS.out.versions) } From 5c89cd18ba5a9d2e2d384dd47a567c32fd7b9211 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:37:36 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad0966ec..061bab78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v1.1.1 - Abu (Patch) [xxxx-xx-xx] +## v1.1.1 - Abu (Patch) [2023-07-26] ### `Fixed`