From 3af2b5288fa64913a85c42cda0423b63ffc03a03 Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Fri, 13 Sep 2024 13:58:54 +0200
Subject: [PATCH 1/8] add mito
---
conf/modules/prepare_references.config | 10 ++---
nextflow_schema.json | 4 +-
subworkflows/local/align.nf | 2 +-
subworkflows/local/call_snv.nf | 4 +-
.../local/call_structural_variants.nf | 45 +++++++++++--------
5 files changed, 36 insertions(+), 29 deletions(-)
diff --git a/conf/modules/prepare_references.config b/conf/modules/prepare_references.config
index 401513ab..2793ec93 100644
--- a/conf/modules/prepare_references.config
+++ b/conf/modules/prepare_references.config
@@ -43,15 +43,15 @@ process {
}
withName: '.*PREPARE_REFERENCES:BWAMEM2_INDEX_MT_SHIFT' {
- ext.when = { (params.analysis_type.equals("wgs") || params.run_mt_for_wes) && params.mt_aligner == "bwamem2"}
+ ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "bwamem2"}
}
withName: '.*PREPARE_REFERENCES:SENTIEON_BWAINDEX_MT_SHIFT' {
- ext.when = { (params.analysis_type.equals("wgs") || params.run_mt_for_wes) && params.mt_aligner == "sentieon"}
+ ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "sentieon"}
}
withName: '.*PREPARE_REFERENCES:BWA_INDEX_MT_SHIFT' {
- ext.when = { (params.analysis_type.equals("wgs") || params.run_mt_for_wes) && params.mt_aligner == "bwa"}
+ ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "bwa"}
}
withName: '.*PREPARE_REFERENCES:SAMTOOLS_FAIDX_GENOME' {
@@ -68,7 +68,7 @@ process {
}
withName: '.*PREPARE_REFERENCES:SAMTOOLS_FAIDX_MT_SHIFT' {
- ext.when = { (params.analysis_type.equals("wgs") || params.run_mt_for_wes) }
+ ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) }
}
withName: '.*PREPARE_REFERENCES:GATK_SD' {
@@ -80,7 +80,7 @@ process {
}
withName: '.*PREPARE_REFERENCES:GATK_SD_MT_SHIFT' {
- ext.when = { (params.analysis_type.equals("wgs") || params.run_mt_for_wes)}
+ ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes)}
}
withName: '.*PREPARE_REFERENCES:TABIX_DBSNP' {
diff --git a/nextflow_schema.json b/nextflow_schema.json
index bf20ae91..d8be0ddb 100644
--- a/nextflow_schema.json
+++ b/nextflow_schema.json
@@ -485,9 +485,9 @@
"analysis_type": {
"type": "string",
"default": "wgs",
- "description": "Specifies which analysis type for the pipeline- either 'wgs' or 'wes'. This changes resources consumed and tools used.",
+ "description": "Specifies which analysis type for the pipeline- either 'wgs', 'wes' or 'mito'. This changes resources consumed and tools used.",
"fa_icon": "fas fa-align-center",
- "enum": ["wgs", "wes"]
+ "enum": ["wgs", "wes", "mito"]
},
"bwa_as_fallback": {
"type": "boolean",
diff --git a/subworkflows/local/align.nf b/subworkflows/local/align.nf
index 29c7f5da..d08b1cb5 100644
--- a/subworkflows/local/align.nf
+++ b/subworkflows/local/align.nf
@@ -83,7 +83,7 @@ workflow ALIGN {
// PREPARING READS FOR MT ALIGNMENT
- if (params.analysis_type.equals("wgs") || params.run_mt_for_wes) {
+ if (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) {
CONVERT_MT_BAM_TO_FASTQ (
ch_genome_bam_bai,
ch_genome_fasta,
diff --git a/subworkflows/local/call_snv.nf b/subworkflows/local/call_snv.nf
index 5d0b2ce9..23508848 100644
--- a/subworkflows/local/call_snv.nf
+++ b/subworkflows/local/call_snv.nf
@@ -46,7 +46,7 @@ workflow CALL_SNV {
ch_sentieon_gvcf = Channel.empty()
ch_sentieon_gtbi = Channel.empty()
- if (params.variant_caller.equals("deepvariant")) {
+ if (params.variant_caller.equals("deepvariant") && !params.analysis_type.equals("mito")) {
CALL_SNV_DEEPVARIANT ( // triggered only when params.variant_caller is set as deepvariant
ch_genome_bam_bai,
ch_genome_fasta,
@@ -97,7 +97,7 @@ workflow CALL_SNV {
ch_genome_tabix = GATK4_SELECTVARIANTS.out.tbi
ch_genome_vcf_tabix = ch_genome_vcf.join(ch_genome_tabix, failOnMismatch:true, failOnDuplicate:true)
- if (params.analysis_type.equals("wgs") || params.run_mt_for_wes) {
+ if (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) {
CALL_SNV_MT(
ch_mt_bam_bai,
ch_genome_fasta,
diff --git a/subworkflows/local/call_structural_variants.nf b/subworkflows/local/call_structural_variants.nf
index 65f2f9ff..aca78e79 100644
--- a/subworkflows/local/call_structural_variants.nf
+++ b/subworkflows/local/call_structural_variants.nf
@@ -32,11 +32,16 @@ workflow CALL_STRUCTURAL_VARIANTS {
main:
ch_versions = Channel.empty()
+ ch_merged_svs = Channel.empty()
+ ch_merged_tbi = Channel.empty()
- CALL_SV_MANTA (ch_genome_bam, ch_genome_bai, ch_genome_fasta, ch_genome_fai, ch_case_info, ch_target_bed)
- .diploid_sv_vcf
- .collect{it[1]}
- .set{ manta_vcf }
+ if (!params.analysis_type.equals("mito")) {
+ CALL_SV_MANTA (ch_genome_bam, ch_genome_bai, ch_genome_fasta, ch_genome_fai, ch_case_info, ch_target_bed)
+ .diploid_sv_vcf
+ .collect{it[1]}
+ .set{ manta_vcf }
+ ch_versions = ch_versions.mix(CALL_SV_MANTA.out.versions)
+ }
if (params.analysis_type.equals("wgs")) {
CALL_SV_TIDDIT (ch_genome_bam_bai, ch_genome_fasta, ch_bwa_index, ch_case_info)
@@ -61,7 +66,7 @@ workflow CALL_STRUCTURAL_VARIANTS {
ch_versions = ch_versions.mix(CALL_SV_GERMLINECNVCALLER.out.versions)
}
- if (params.analysis_type.equals("wgs") || params.run_mt_for_wes) {
+ if (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) {
CALL_SV_MT (ch_mt_bam_bai, ch_genome_fasta)
ch_versions = ch_versions.mix(CALL_SV_MT.out.versions)
}
@@ -74,39 +79,41 @@ workflow CALL_STRUCTURAL_VARIANTS {
.combine(cnvnator_vcf)
.toList()
.set { vcf_list }
- } else {
+ } else if (!params.analysis_type.equals("mito")) {
manta_vcf
.toList()
.set { vcf_list }
}
- } else if (params.analysis_type.equals("wgs")){
+ } else if (params.analysis_type.equals("wgs")) {
tiddit_vcf
.combine(manta_vcf)
.combine(gcnvcaller_vcf)
.combine(cnvnator_vcf)
.toList()
.set { vcf_list }
- } else {
+ } else if (!params.analysis_type.equals("mito")) {
manta_vcf
.combine(gcnvcaller_vcf)
.toList()
.set { vcf_list }
}
- ch_case_info
- .combine(vcf_list)
- .set { merge_input_vcfs }
+ if (!params.analysis_type.equals("mito")) {
+ ch_case_info
+ .combine(vcf_list)
+ .set { merge_input_vcfs }
- SVDB_MERGE (merge_input_vcfs, ch_svcaller_priority)
+ SVDB_MERGE (merge_input_vcfs, ch_svcaller_priority)
- TABIX_TABIX (SVDB_MERGE.out.vcf)
-
- ch_versions = ch_versions.mix(CALL_SV_MANTA.out.versions)
- ch_versions = ch_versions.mix(TABIX_TABIX.out.versions)
- ch_versions = ch_versions.mix(SVDB_MERGE.out.versions)
+ TABIX_TABIX (SVDB_MERGE.out.vcf)
+ ch_merged_svs = SVDB_MERGE.out.vcf
+ ch_merged_tbi = TABIX_TABIX.out.tbi
+ ch_versions = ch_versions.mix(TABIX_TABIX.out.versions)
+ ch_versions = ch_versions.mix(SVDB_MERGE.out.versions)
+ }
emit:
- vcf = SVDB_MERGE.out.vcf // channel: [ val(meta), path(vcf)]
- tbi = TABIX_TABIX.out.tbi // channel: [ val(meta), path(tbi)]
+ vcf = ch_merged_svs // channel: [ val(meta), path(vcf)]
+ tbi = ch_merged_tbi // channel: [ val(meta), path(tbi)]
versions = ch_versions // channel: [ path(versions.yml) ]
}
From a87672e117c90fa98fe1c7e199439d5e45533afa Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Fri, 13 Sep 2024 16:38:32 +0200
Subject: [PATCH 2/8] annotate
---
workflows/raredisease.nf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf
index 80e51572..ab4223ad 100644
--- a/workflows/raredisease.nf
+++ b/workflows/raredisease.nf
@@ -568,7 +568,7 @@ workflow RAREDISEASE {
//
// ANNOTATE MT SNVs
//
- if (!params.skip_mt_annotation && (params.run_mt_for_wes || params.analysis_type.equals("wgs"))) {
+ if (!params.skip_mt_annotation && (params.run_mt_for_wes || params.analysis_type.matches("wgs|mito"))) {
ANNOTATE_MT_SNVS (
CALL_SNV.out.mt_vcf,
From 505c2b816842c6de891cce0824c918cfc4df2474 Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Fri, 20 Sep 2024 10:25:01 +0200
Subject: [PATCH 3/8] align mt reads to mt and not genome
---
conf/modules/prepare_references.config | 10 +++----
subworkflows/local/align.nf | 17 +++++++-----
subworkflows/local/call_snv.nf | 19 +++++++------
subworkflows/local/prepare_references.nf | 34 +++++++++++++++++-------
workflows/raredisease.nf | 19 ++++++++++---
5 files changed, 68 insertions(+), 31 deletions(-)
diff --git a/conf/modules/prepare_references.config b/conf/modules/prepare_references.config
index 2793ec93..fd0e40f1 100644
--- a/conf/modules/prepare_references.config
+++ b/conf/modules/prepare_references.config
@@ -42,15 +42,15 @@ process {
ext.when = {!params.bwa && (params.aligner == "sentieon" || params.mt_aligner == "sentieon")}
}
- withName: '.*PREPARE_REFERENCES:BWAMEM2_INDEX_MT_SHIFT' {
+ withName: '.*PREPARE_REFERENCES:BWAMEM2_INDEX_MT.*' {
ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "bwamem2"}
}
- withName: '.*PREPARE_REFERENCES:SENTIEON_BWAINDEX_MT_SHIFT' {
+ withName: '.*PREPARE_REFERENCES:SENTIEON_BWAINDEX_MT.*' {
ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "sentieon"}
}
- withName: '.*PREPARE_REFERENCES:BWA_INDEX_MT_SHIFT' {
+ withName: '.*PREPARE_REFERENCES:BWA_INDEX_MT.*' {
ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) && params.mt_aligner == "bwa"}
}
@@ -67,7 +67,7 @@ process {
ext.when = {!params.mt_fasta}
}
- withName: '.*PREPARE_REFERENCES:SAMTOOLS_FAIDX_MT_SHIFT' {
+ withName: '.*PREPARE_REFERENCES:SAMTOOLS_FAIDX_MT' {
ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) }
}
@@ -79,7 +79,7 @@ process {
ext.args = { "--interval-file-name ${meta.id}_mt" }
}
- withName: '.*PREPARE_REFERENCES:GATK_SD_MT_SHIFT' {
+ withName: '.*PREPARE_REFERENCES:GATK_SD_MT' {
ext.when = { (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes)}
}
diff --git a/subworkflows/local/align.nf b/subworkflows/local/align.nf
index d08b1cb5..82f77f31 100644
--- a/subworkflows/local/align.nf
+++ b/subworkflows/local/align.nf
@@ -19,11 +19,16 @@ workflow ALIGN {
ch_genome_bwamem2index // channel: [mandatory] [ val(meta), path(index) ]
ch_genome_bwamemeindex // channel: [mandatory] [ val(meta), path(index) ]
ch_genome_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
+ ch_mt_bwaindex // channel: [mandatory] [ val(meta), path(index) ]
+ ch_mt_bwamem2index // channel: [mandatory] [ val(meta), path(index) ]
+ ch_mt_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
+ ch_mt_fai // channel: [mandatory] [ val(meta), path(fai) ]
+ ch_mt_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_mtshift_bwaindex // channel: [mandatory] [ val(meta), path(index) ]
ch_mtshift_bwamem2index // channel: [mandatory] [ val(meta), path(index) ]
- ch_mtshift_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_mtshift_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
ch_mtshift_fai // channel: [mandatory] [ val(meta), path(fai) ]
+ ch_mtshift_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
val_mbuffer_mem // integer: [mandatory] memory in megabytes
val_platform // string: [mandatory] illumina or a different technology
val_sort_threads // integer: [mandatory] memory in megabytes
@@ -94,11 +99,11 @@ workflow ALIGN {
ALIGN_MT (
CONVERT_MT_BAM_TO_FASTQ.out.fastq,
CONVERT_MT_BAM_TO_FASTQ.out.bam,
- ch_genome_bwaindex,
- ch_genome_bwamem2index,
- ch_genome_fasta,
- ch_genome_dictionary,
- ch_genome_fai
+ ch_mt_bwaindex,
+ ch_mt_bwamem2index,
+ ch_mt_fasta,
+ ch_mt_dictionary,
+ ch_mt_fai
)
ALIGN_MT_SHIFT (
diff --git a/subworkflows/local/call_snv.nf b/subworkflows/local/call_snv.nf
index 23508848..8060e0cc 100644
--- a/subworkflows/local/call_snv.nf
+++ b/subworkflows/local/call_snv.nf
@@ -19,9 +19,12 @@ workflow CALL_SNV {
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_genome_dictionary // channel: [mandatory] [ val(meta), path(dict) ]
ch_mt_intervals // channel: [optional] [ path(interval_list) ]
- ch_mtshift_fasta // channel: [optional] [ val(meta), path(fasta) ]
- ch_mtshift_fai // channel: [optional] [ val(meta), path(fai) ]
+ ch_mt_dictionary // channel: [optional] [ val(meta), path(dict) ]
+ ch_mt_fai // channel: [optional] [ val(meta), path(fai) ]
+ ch_mt_fasta // channel: [optional] [ val(meta), path(fasta) ]
ch_mtshift_dictionary // channel: [optional] [ val(meta), path(dict) ]
+ ch_mtshift_fai // channel: [optional] [ val(meta), path(fai) ]
+ ch_mtshift_fasta // channel: [optional] [ val(meta), path(fasta) ]
ch_mtshift_intervals // channel: [optional] [ path(interval_list) ]
ch_mtshift_backchain // channel: [mandatory] [ val(meta), path(back_chain) ]
ch_dbsnp // channel: [optional] [ val(meta), path(vcf) ]
@@ -100,9 +103,9 @@ workflow CALL_SNV {
if (params.analysis_type.matches("wgs|mito") || params.run_mt_for_wes) {
CALL_SNV_MT(
ch_mt_bam_bai,
- ch_genome_fasta,
- ch_genome_fai,
- ch_genome_dictionary,
+ ch_mt_fasta,
+ ch_mt_fai,
+ ch_mt_dictionary,
ch_mt_intervals
)
@@ -117,9 +120,9 @@ workflow CALL_SNV {
POSTPROCESS_MT_CALLS(
CALL_SNV_MT.out.vcf,
CALL_SNV_MT_SHIFT.out.vcf,
- ch_genome_fasta,
- ch_genome_dictionary,
- ch_genome_fai,
+ ch_mt_fasta,
+ ch_mt_dictionary,
+ ch_mt_fai,
ch_mtshift_backchain,
ch_case_info,
ch_foundin_header,
diff --git a/subworkflows/local/prepare_references.nf b/subworkflows/local/prepare_references.nf
index 8c39c614..4af09860 100644
--- a/subworkflows/local/prepare_references.nf
+++ b/subworkflows/local/prepare_references.nf
@@ -3,22 +3,25 @@
//
include { BWA_INDEX as BWA_INDEX_GENOME } from '../../modules/nf-core/bwa/index/main'
+include { BWA_INDEX as BWA_INDEX_MT } from '../../modules/nf-core/bwa/index/main'
include { BWA_INDEX as BWA_INDEX_MT_SHIFT } from '../../modules/nf-core/bwa/index/main'
include { BWAMEM2_INDEX as BWAMEM2_INDEX_GENOME } from '../../modules/nf-core/bwamem2/index/main'
+include { BWAMEM2_INDEX as BWAMEM2_INDEX_MT } from '../../modules/nf-core/bwamem2/index/main'
include { BWAMEM2_INDEX as BWAMEM2_INDEX_MT_SHIFT } from '../../modules/nf-core/bwamem2/index/main'
include { BWAMEME_INDEX as BWAMEME_INDEX_GENOME } from '../../modules/nf-core/bwameme/index/main'
include { CAT_CAT as CAT_CAT_BAIT } from '../../modules/nf-core/cat/cat/main'
include { GATK4_BEDTOINTERVALLIST as GATK_BILT } from '../../modules/nf-core/gatk4/bedtointervallist/main'
include { GATK4_CREATESEQUENCEDICTIONARY as GATK_SD } from '../../modules/nf-core/gatk4/createsequencedictionary/main'
-include { GATK4_CREATESEQUENCEDICTIONARY as GATK_SD_MT_SHIFT } from '../../modules/nf-core/gatk4/createsequencedictionary/main'
+include { GATK4_CREATESEQUENCEDICTIONARY as GATK_SD_MT } from '../../modules/nf-core/gatk4/createsequencedictionary/main'
include { GATK4_INTERVALLISTTOOLS as GATK_ILT } from '../../modules/nf-core/gatk4/intervallisttools/main'
include { GATK4_SHIFTFASTA as GATK_SHIFTFASTA } from '../../modules/nf-core/gatk4/shiftfasta/main'
include { GET_CHROM_SIZES } from '../../modules/local/get_chrom_sizes'
include { RTGTOOLS_FORMAT } from '../../modules/nf-core/rtgtools/format/main'
include { SAMTOOLS_FAIDX as SAMTOOLS_EXTRACT_MT } from '../../modules/nf-core/samtools/faidx/main'
include { SAMTOOLS_FAIDX as SAMTOOLS_FAIDX_GENOME } from '../../modules/nf-core/samtools/faidx/main'
-include { SAMTOOLS_FAIDX as SAMTOOLS_FAIDX_MT_SHIFT } from '../../modules/nf-core/samtools/faidx/main'
+include { SAMTOOLS_FAIDX as SAMTOOLS_FAIDX_MT } from '../../modules/nf-core/samtools/faidx/main'
include { SENTIEON_BWAINDEX as SENTIEON_BWAINDEX_GENOME } from '../../modules/nf-core/sentieon/bwaindex/main'
+include { SENTIEON_BWAINDEX as SENTIEON_BWAINDEX_MT } from '../../modules/nf-core/sentieon/bwaindex/main'
include { SENTIEON_BWAINDEX as SENTIEON_BWAINDEX_MT_SHIFT } from '../../modules/nf-core/sentieon/bwaindex/main'
include { TABIX_BGZIPTABIX as TABIX_PBT } from '../../modules/nf-core/tabix/bgziptabix/main'
include { TABIX_BGZIPTABIX as TABIX_BGZIPINDEX_VCFANNOEXTRA } from '../../modules/nf-core/tabix/bgziptabix/main'
@@ -66,11 +69,16 @@ workflow PREPARE_REFERENCES {
// MT genome indices
SAMTOOLS_EXTRACT_MT(ch_genome_fasta, ch_fai)
ch_mt_fasta_in = Channel.empty().mix(ch_mt_fasta, SAMTOOLS_EXTRACT_MT.out.fa).collect()
- SAMTOOLS_FAIDX_MT_SHIFT(ch_mt_fasta_in, [[],[]])
- GATK_SD_MT_SHIFT(ch_mt_fasta_in)
- GATK_SHIFTFASTA(ch_mt_fasta_in, SAMTOOLS_FAIDX_MT_SHIFT.out.fai, GATK_SD_MT_SHIFT.out.dict)
+ SAMTOOLS_FAIDX_MT(ch_mt_fasta_in, [[],[]])
+ GATK_SD_MT(ch_mt_fasta_in)
+ GATK_SHIFTFASTA(ch_mt_fasta_in, SAMTOOLS_FAIDX_MT.out.fai, GATK_SD_MT.out.dict)
// MT alignment indices
+ BWAMEM2_INDEX_MT(ch_mt_fasta_in)
+ BWA_INDEX_MT(ch_mt_fasta_in)
+ SENTIEON_BWAINDEX_MT(ch_mt_fasta_in)
+ ch_bwa_mt = Channel.empty().mix(SENTIEON_BWAINDEX_MT.out.index, BWA_INDEX_MT.out.index).collect()
+
BWAMEM2_INDEX_MT_SHIFT(GATK_SHIFTFASTA.out.shift_fa)
BWA_INDEX_MT_SHIFT(GATK_SHIFTFASTA.out.shift_fa)
SENTIEON_BWAINDEX_MT_SHIFT(GATK_SHIFTFASTA.out.shift_fa)
@@ -140,9 +148,12 @@ workflow PREPARE_REFERENCES {
ch_versions = ch_versions.mix(GATK_SD.out.versions)
ch_versions = ch_versions.mix(GET_CHROM_SIZES.out.versions)
ch_versions = ch_versions.mix(SAMTOOLS_EXTRACT_MT.out.versions)
- ch_versions = ch_versions.mix(SAMTOOLS_FAIDX_MT_SHIFT.out.versions)
- ch_versions = ch_versions.mix(GATK_SD_MT_SHIFT.out.versions)
+ ch_versions = ch_versions.mix(SAMTOOLS_FAIDX_MT.out.versions)
+ ch_versions = ch_versions.mix(GATK_SD_MT.out.versions)
ch_versions = ch_versions.mix(GATK_SHIFTFASTA.out.versions)
+ ch_versions = ch_versions.mix(BWAMEM2_INDEX_MT.out.versions)
+ ch_versions = ch_versions.mix(BWA_INDEX_MT.out.versions)
+ ch_versions = ch_versions.mix(SENTIEON_BWAINDEX_MT.out.versions)
ch_versions = ch_versions.mix(BWAMEM2_INDEX_MT_SHIFT.out.versions)
ch_versions = ch_versions.mix(BWA_INDEX_MT_SHIFT.out.versions)
ch_versions = ch_versions.mix(SENTIEON_BWAINDEX_MT_SHIFT.out.versions)
@@ -167,11 +178,16 @@ workflow PREPARE_REFERENCES {
genome_dict = ch_dict // channel: [ val(meta), path(dict) ]
sdf = RTGTOOLS_FORMAT.out.sdf // channel: [ val (meta), path(intervals) ]
mt_intervals = ch_shiftfasta_mtintervals.intervals.collect() // channel: [ path(intervals) ]
+ mt_bwa_index = ch_bwa_mt // channel: [ val(meta), path(index) ]
+ mt_bwamem2_index = BWAMEM2_INDEX_MT.out.index.collect() // channel: [ val(meta), path(index) ]
+ mt_dict = GATK_SD_MT.out.dict.collect() // channel: [ val(meta), path(dict) ]
+ mt_fasta = ch_mt_fasta_in.collect() // channel: [ val(meta), path(fasta) ]
+ mt_fai = SAMTOOLS_FAIDX_MT.out.fai.collect() // channel: [ val(meta), path(fai) ]
mtshift_intervals = ch_shiftfasta_mtintervals.shift_intervals.collect() // channel: [ path(intervals) ]
mtshift_backchain = GATK_SHIFTFASTA.out.shift_back_chain.collect() // channel: [ val(meta), path(backchain) ]
+ mtshift_dict = GATK_SHIFTFASTA.out.dict // channel: [ val(meta), path(dict) ]
mtshift_fai = GATK_SHIFTFASTA.out.shift_fai.collect() // channel: [ val(meta), path(fai) ]
- mtshift_fasta = GATK_SHIFTFASTA.out.shift_fa.collect() // channel: [ val(meta), path(fai) ]
- mtshift_dict = GATK_SHIFTFASTA.out.dict.collect() // channel: [ path(dict) ]
+ mtshift_fasta = GATK_SHIFTFASTA.out.shift_fa.collect() // channel: [ val(meta), path(fasta) ]
mtshift_bwa_index = ch_bwa_mtshift // channel: [ val(meta), path(index) ]
mtshift_bwamem2_index = BWAMEM2_INDEX_MT_SHIFT.out.index.collect() // channel: [ val(meta), path(index) ]
diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf
index ab4223ad..c4fda9d1 100644
--- a/workflows/raredisease.nf
+++ b/workflows/raredisease.nf
@@ -271,6 +271,11 @@ workflow RAREDISEASE {
ch_ml_model = params.variant_caller.equals("sentieon") ? Channel.fromPath(params.ml_model).map {it -> [[id:it[0].simpleName], it]}.collect()
: Channel.value([[:],[]])
ch_mt_intervals = ch_references.mt_intervals
+ ch_mt_bwaindex = ch_references.mt_bwa_index
+ ch_mt_bwamem2index = ch_references.mt_bwamem2_index
+ ch_mt_dictionary = ch_references.mt_dict
+ ch_mt_fai = ch_references.mt_fai
+ ch_mt_fasta = ch_references.mt_fasta
ch_mtshift_backchain = ch_references.mtshift_backchain
ch_mtshift_bwaindex = ch_references.mtshift_bwa_index
ch_mtshift_bwamem2index = ch_references.mtshift_bwamem2_index
@@ -412,11 +417,16 @@ workflow RAREDISEASE {
ch_genome_bwamem2index,
ch_genome_bwamemeindex,
ch_genome_dictionary,
+ ch_mt_bwaindex,
+ ch_mt_bwamem2index,
+ ch_mt_dictionary,
+ ch_mt_fai,
+ ch_mt_fasta,
ch_mtshift_bwaindex,
ch_mtshift_bwamem2index,
- ch_mtshift_fasta,
ch_mtshift_dictionary,
ch_mtshift_fai,
+ ch_mtshift_fasta,
params.mbuffer_mem,
params.platform,
params.samtools_sort_threads
@@ -493,9 +503,12 @@ workflow RAREDISEASE {
ch_genome_fai,
ch_genome_dictionary,
ch_mt_intervals,
- ch_mtshift_fasta,
- ch_mtshift_fai,
+ ch_mt_dictionary,
+ ch_mt_fai,
+ ch_mt_fasta,
ch_mtshift_dictionary,
+ ch_mtshift_fai,
+ ch_mtshift_fasta,
ch_mtshift_intervals,
ch_mtshift_backchain,
ch_dbsnp,
From 9575a7f6f8efc21e870beecbb6774f0f290eb37e Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Fri, 20 Sep 2024 10:31:55 +0200
Subject: [PATCH 4/8] update changelog
---
CHANGELOG.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a1451e1c..b9fb7e17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`
+- A new analysis option `mito` to call and annotate only mitochondrial variants [#608](https://github.com/nf-core/raredisease/pull/608)
+
### `Changed`
### `Fixed`
From 537de87ca4859e5a2e33d6954c379367193bc16d Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Tue, 24 Sep 2024 11:05:23 +0200
Subject: [PATCH 5/8] update usage docs
---
docs/usage.md | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/docs/usage.md b/docs/usage.md
index 0304c46a..70dbe8d4 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -10,24 +10,24 @@ Table of contents:
- [Run nf-core/raredisease with test data](#run-nf-coreraredisease-with-test-data)
- [Updating the pipeline](#updating-the-pipeline)
- [Run nf-core/raredisease with your data](#run-nf-coreraredisease-with-your-data)
- - [Samplesheet](#samplesheet)
- - [Reference files and parameters](#reference-files-and-parameters)
- - [1. Alignment](#1-alignment)
- - [2. QC stats from the alignment files](#2-qc-stats-from-the-alignment-files)
- - [3. Repeat expansions](#3-repeat-expansions)
- - [4. Variant calling - SNV](#4-variant-calling---snv)
- - [5. Variant calling - Structural variants](#5-variant-calling---structural-variants)
- - [6. Copy number variant calling](#6-copy-number-variant-calling)
- - [7. SNV annotation \& Ranking](#7-snv-annotation--ranking)
- - [8. SV annotation \& Ranking](#8-sv-annotation--ranking)
- - [9. Mitochondrial annotation](#9-mitochondrial-annotation)
- - [10. Mobile element calling](#10-mobile-element-calling)
- - [11. Mobile element annotation](#11-mobile-element-annotation)
- - [12. Variant evaluation](#12-variant-evaluation)
- - [13. Prepare data for CNV visualisation in Gens](#13-prepare-data-for-cnv-visualisation-in-gens)
- - [Run the pipeline](#run-the-pipeline)
- - [Direct input in CLI](#direct-input-in-cli)
- - [Import from a config file (recommended)](#import-from-a-config-file-recommended)
+ - [Samplesheet](#samplesheet)
+ - [Reference files and parameters](#reference-files-and-parameters)
+ - [1. Alignment](#1-alignment)
+ - [2. QC stats from the alignment files](#2-qc-stats-from-the-alignment-files)
+ - [3. Repeat expansions](#3-repeat-expansions)
+ - [4. Variant calling - SNV](#4-variant-calling---snv)
+ - [5. Variant calling - Structural variants](#5-variant-calling---structural-variants)
+ - [6. Copy number variant calling](#6-copy-number-variant-calling)
+ - [7. SNV annotation \& Ranking](#7-snv-annotation--ranking)
+ - [8. SV annotation \& Ranking](#8-sv-annotation--ranking)
+ - [9. Mitochondrial annotation](#9-mitochondrial-annotation)
+ - [10. Mobile element calling](#10-mobile-element-calling)
+ - [11. Mobile element annotation](#11-mobile-element-annotation)
+ - [12. Variant evaluation](#12-variant-evaluation)
+ - [13. Prepare data for CNV visualisation in Gens](#13-prepare-data-for-cnv-visualisation-in-gens)
+ - [Run the pipeline](#run-the-pipeline)
+ - [Direct input in CLI](#direct-input-in-cli)
+ - [Import from a config file (recommended)](#import-from-a-config-file-recommended)
- [Best practices](#best-practices)
- [Core Nextflow arguments](#core-nextflow-arguments)
- [`-profile`](#-profile)
@@ -205,7 +205,7 @@ The mandatory and optional parameters for each category are tabulated below.
1Default variant caller is DeepVariant, but you have the option to use Sentieon as well.
2These parameters are only used by Sentieon.
-3Default is WGS, but you have the option to choose WES as well.
+3Default is `WGS`, but you have the option to choose `WES` and `mito` as well.
4This parameter is only used by Deepvariant.
##### 5. Variant calling - Structural variants
From 099a566443660e9b0fd33927ff640c77336d6af5 Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Tue, 24 Sep 2024 11:20:07 +0200
Subject: [PATCH 6/8] prettier
---
docs/usage.md | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/docs/usage.md b/docs/usage.md
index 70dbe8d4..c67e488b 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -10,24 +10,24 @@ Table of contents:
- [Run nf-core/raredisease with test data](#run-nf-coreraredisease-with-test-data)
- [Updating the pipeline](#updating-the-pipeline)
- [Run nf-core/raredisease with your data](#run-nf-coreraredisease-with-your-data)
- - [Samplesheet](#samplesheet)
- - [Reference files and parameters](#reference-files-and-parameters)
- - [1. Alignment](#1-alignment)
- - [2. QC stats from the alignment files](#2-qc-stats-from-the-alignment-files)
- - [3. Repeat expansions](#3-repeat-expansions)
- - [4. Variant calling - SNV](#4-variant-calling---snv)
- - [5. Variant calling - Structural variants](#5-variant-calling---structural-variants)
- - [6. Copy number variant calling](#6-copy-number-variant-calling)
- - [7. SNV annotation \& Ranking](#7-snv-annotation--ranking)
- - [8. SV annotation \& Ranking](#8-sv-annotation--ranking)
- - [9. Mitochondrial annotation](#9-mitochondrial-annotation)
- - [10. Mobile element calling](#10-mobile-element-calling)
- - [11. Mobile element annotation](#11-mobile-element-annotation)
- - [12. Variant evaluation](#12-variant-evaluation)
- - [13. Prepare data for CNV visualisation in Gens](#13-prepare-data-for-cnv-visualisation-in-gens)
- - [Run the pipeline](#run-the-pipeline)
- - [Direct input in CLI](#direct-input-in-cli)
- - [Import from a config file (recommended)](#import-from-a-config-file-recommended)
+ - [Samplesheet](#samplesheet)
+ - [Reference files and parameters](#reference-files-and-parameters)
+ - [1. Alignment](#1-alignment)
+ - [2. QC stats from the alignment files](#2-qc-stats-from-the-alignment-files)
+ - [3. Repeat expansions](#3-repeat-expansions)
+ - [4. Variant calling - SNV](#4-variant-calling---snv)
+ - [5. Variant calling - Structural variants](#5-variant-calling---structural-variants)
+ - [6. Copy number variant calling](#6-copy-number-variant-calling)
+ - [7. SNV annotation \& Ranking](#7-snv-annotation--ranking)
+ - [8. SV annotation \& Ranking](#8-sv-annotation--ranking)
+ - [9. Mitochondrial annotation](#9-mitochondrial-annotation)
+ - [10. Mobile element calling](#10-mobile-element-calling)
+ - [11. Mobile element annotation](#11-mobile-element-annotation)
+ - [12. Variant evaluation](#12-variant-evaluation)
+ - [13. Prepare data for CNV visualisation in Gens](#13-prepare-data-for-cnv-visualisation-in-gens)
+ - [Run the pipeline](#run-the-pipeline)
+ - [Direct input in CLI](#direct-input-in-cli)
+ - [Import from a config file (recommended)](#import-from-a-config-file-recommended)
- [Best practices](#best-practices)
- [Core Nextflow arguments](#core-nextflow-arguments)
- [`-profile`](#-profile)
From a57f931e76815c74b9e7ab9536dda2a39f113b18 Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Tue, 24 Sep 2024 14:42:07 +0200
Subject: [PATCH 7/8] update docs
---
docs/output.md | 4 ++--
subworkflows/local/call_structural_variants.nf | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/output.md b/docs/output.md
index d7f608b7..53f9a274 100644
--- a/docs/output.md
+++ b/docs/output.md
@@ -68,7 +68,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [Hmtnote](#hmtnote)
- [VEP](#vep-2)
- [Filtering and ranking](#filtering-and-ranking)
- - [Filter_vep](#filter_vep)
+ - [Filter\_vep](#filter_vep)
- [GENMOD](#genmod)
- [Mobile element analysis](#mobile-element-analysis)
- [Calling mobile elements](#calling-mobile-elements)
@@ -316,7 +316,7 @@ The pipeline performs variant calling using [Sentieon DNAscope](https://support.
Output files
- `call_sv/genome`
- - `_sv_merge.vcf.gz`: file containing the merged variant calls.
+ - `_sv_merge.vcf.gz`: file containing the merged variant calls. As of version 2.3.0, this file also contains mitochondrial structural variants.
- `_sv_merge.vcf.gz.tbi`: index of the file containing the merged variant calls.
diff --git a/subworkflows/local/call_structural_variants.nf b/subworkflows/local/call_structural_variants.nf
index aca78e79..c7d251b9 100644
--- a/subworkflows/local/call_structural_variants.nf
+++ b/subworkflows/local/call_structural_variants.nf
@@ -113,7 +113,7 @@ workflow CALL_STRUCTURAL_VARIANTS {
}
emit:
- vcf = ch_merged_svs // channel: [ val(meta), path(vcf)]
+ vcf = ch_merged_svs // channel: [ val(meta), path(vcf)]
tbi = ch_merged_tbi // channel: [ val(meta), path(tbi)]
- versions = ch_versions // channel: [ path(versions.yml) ]
+ versions = ch_versions // channel: [ path(versions.yml) ]
}
From 877cb317ed9f2380652deeaafef3d30393015b73 Mon Sep 17 00:00:00 2001
From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com>
Date: Tue, 24 Sep 2024 14:56:49 +0200
Subject: [PATCH 8/8] lint
---
docs/output.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/output.md b/docs/output.md
index 53f9a274..1be5e4d5 100644
--- a/docs/output.md
+++ b/docs/output.md
@@ -68,7 +68,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [Hmtnote](#hmtnote)
- [VEP](#vep-2)
- [Filtering and ranking](#filtering-and-ranking)
- - [Filter\_vep](#filter_vep)
+ - [Filter_vep](#filter_vep)
- [GENMOD](#genmod)
- [Mobile element analysis](#mobile-element-analysis)
- [Calling mobile elements](#calling-mobile-elements)