Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor mitochondrial analysis workflow #419

Merged
merged 29 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3abdb85
align
ramprasadn Aug 23, 2023
1bdbbf6
comment
ramprasadn Aug 23, 2023
698e067
update versions
ramprasadn Aug 23, 2023
97796fa
mt snv calling
ramprasadn Aug 23, 2023
a4320bb
SV config
ramprasadn Aug 24, 2023
58d70e0
postprocess
ramprasadn Aug 24, 2023
6bafacf
postprocess
ramprasadn Aug 24, 2023
7c5909d
move annotate
ramprasadn Aug 24, 2023
d711b05
update configs
ramprasadn Aug 26, 2023
c288bcf
Merge branch 'dev' of github.com:nf-core/raredisease into mtrefactor
ramprasadn Aug 26, 2023
0c8c870
update raredisease config
ramprasadn Aug 26, 2023
37be3a7
remove skip_mt_analysis
ramprasadn Aug 26, 2023
637692e
update output
ramprasadn Aug 26, 2023
d71250c
warn
ramprasadn Aug 26, 2023
12bb6ae
update output
ramprasadn Aug 26, 2023
d241237
update usage
ramprasadn Aug 27, 2023
8286a47
Merge branch 'dev' into mtrefactor
jemten Sep 5, 2023
c1640fc
update headers
ramprasadn Sep 5, 2023
4545b57
Merge branch 'dev' of github.com:nf-core/raredisease into mtrefactor
ramprasadn Sep 5, 2023
e3d4d87
Merge branch 'mtrefactor' of github.com:genomic-medicine-sweden/rared…
ramprasadn Sep 5, 2023
fd9c26f
update changelog
ramprasadn Sep 5, 2023
8ca4f8d
Lucia's comment
ramprasadn Sep 13, 2023
ee105a8
Update subworkflows/local/call_snv.nf [skip ci]
ramprasadn Sep 13, 2023
4eeab25
Update subworkflows/local/variant_calling/postprocess_MT_calls.nf [sk…
ramprasadn Sep 13, 2023
e4fe05b
Merge branch 'dev' of github.com:nf-core/raredisease into mtrefactor
ramprasadn Sep 13, 2023
9c1f1c0
comments
ramprasadn Sep 13, 2023
f1566cd
Merge branch 'dev' of github.com:nf-core/raredisease into mtrefactor
ramprasadn Sep 15, 2023
29c9c85
update test config
ramprasadn Sep 15, 2023
dbb8c38
Merge branch 'mtrefactor' of github.com:genomic-medicine-sweden/rared…
ramprasadn Sep 15, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,115 +12,87 @@
*/

//
// ANALYSE_MT:ALIGN_AND_CALL_MT
// Mitochondria alignment options
//

process {

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:BWAMEM2_MEM_MT' {
ext.when = { !params.skip_mt_analysis && !(params.analysis_type == "wes") && params.aligner == "bwamem2" }
withName: '.*ALIGN_MT:BWAMEM2_MEM_MT' {
ext.when = { !(params.analysis_type == "wes") && params.aligner == "bwamem2" }
ext.args = { "-M -K 100000000 -R ${meta.read_group}" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:SENTIEON_BWAMEM_MT' {
withName: '.*ALIGN_MT:SENTIEON_BWAMEM_MT' {
ext.args = { "-M -K 10000000 -R ${meta.read_group}" }
ext.when = { !params.skip_mt_analysis && !(params.analysis_type == "wes") && params.aligner == "sentieon" }
ext.when = { !(params.analysis_type == "wes") && params.aligner == "sentieon" }
ext.prefix = { "${meta.id}.sorted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:GATK4_MERGEBAMALIGNMENT_MT' {
withName: '.*ALIGN_MT:GATK4_MERGEBAMALIGNMENT_MT' {
ext.args = '--CREATE_INDEX true --MAX_GAPS -1 --SORT_ORDER queryname --INCLUDE_SECONDARY_ALIGNMENTS false --PAIRED_RUN false --VALIDATION_STRINGENCY LENIENT'
ext.prefix = { "${meta.id}_merged" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:PICARD_ADDORREPLACEREADGROUPS_MT' {
withName: '.*ALIGN_MT:PICARD_ADDORREPLACEREADGROUPS_MT' {
ext.args = { [
"--VALIDATION_STRINGENCY LENIENT",
"--RGLB lib",
"--RGPL ILLUMINA",
"--RGPU barcode",
"--RGSM ${meta.id}"
].join(' ' ).trim() }
].join(' ').trim() }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:PICARD_MARKDUPLICATES_MT' {
withName: '.*ALIGN_MT:PICARD_MARKDUPLICATES_MT' {
ext.args = '--VALIDATION_STRINGENCY LENIENT --CREATE_INDEX true'
ext.prefix = { "${meta.id}_markduplicates" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:SAMTOOLS_SORT_MT' {
withName: '.*ALIGN_MT:SAMTOOLS_SORT_MT' {
ext.prefix = { "${meta.id}_sorted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:MT_DELETION' {
ext.args = '-s --insert-size 16000'
publishDir = [
path: { "${params.outdir}/mt_sv" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:GATK4_MUTECT2_MT' {
ext.args = '--mitochondria-mode TRUE'
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT:GATK4_FILTERMUTECTCALLS_MT' {
ext.prefix = { "${meta.id}_filtered" }
}
}

//
// ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT
// Shifted mitochondria alignment options
//

process {

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:BWAMEM2_MEM_MT' {
ext.when = { !params.skip_mt_analysis && !(params.analysis_type == "wes") && params.aligner == "bwamem2" }
withName: '.*ALIGN_MT_SHIFT:BWAMEM2_MEM_MT' {
ext.when = { !(params.analysis_type == "wes") && params.aligner == "bwamem2" }
ext.args = { "-M -K 100000000 -R ${meta.read_group}" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:SENTIEON_BWAMEM_MT' {
withName: '.*ALIGN_MT_SHIFT:SENTIEON_BWAMEM_MT' {
ext.args = { "-M -K 10000000 -R ${meta.read_group}" }
ext.when = { !params.skip_mt_analysis && !(params.analysis_type == "wes") && params.aligner == "sentieon" }
ext.when = { !(params.analysis_type == "wes") && params.aligner == "sentieon" }
ext.prefix = { "${meta.id}.sorted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:GATK4_MERGEBAMALIGNMENT_MT' {
withName: '.*ALIGN_MT_SHIFT:GATK4_MERGEBAMALIGNMENT_MT' {
ext.args = '--CREATE_INDEX true --MAX_GAPS -1 --SORT_ORDER queryname --INCLUDE_SECONDARY_ALIGNMENTS false --PAIRED_RUN false --VALIDATION_STRINGENCY LENIENT'
ext.prefix = { "${meta.id}_merged_shifted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:PICARD_ADDORREPLACEREADGROUPS_MT' {
withName: '.*ALIGN_MT_SHIFT:PICARD_ADDORREPLACEREADGROUPS_MT' {
ext.args = { [
"--VALIDATION_STRINGENCY LENIENT",
"--RGLB lib",
"--RGPL ${params.platform}",
"--RGPU barcode",
"--RGSM ${meta.id}"
].join(' ' ).trim() }
].join(' ').trim() }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:PICARD_MARKDUPLICATES_MT' {
withName: '.*ALIGN_MT_SHIFT:PICARD_MARKDUPLICATES_MT' {
ext.args = '--VALIDATION_STRINGENCY LENIENT --CREATE_INDEX true'
ext.prefix = { "${meta.id}_markduplicates_shifted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:SAMTOOLS_SORT_MT' {
withName: '.*ALIGN_MT_SHIFT:SAMTOOLS_SORT_MT' {
ext.prefix = { "${meta.id}_sorted_shifted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:GATK4_MUTECT2_MT' {
ext.args = '--mitochondria-mode TRUE'
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:HAPLOCHECK_MT' {
ext.prefix = { "${meta.id}_shifted" }
}

withName: '.*ANALYSE_MT:ALIGN_AND_CALL_MT_SHIFT:GATK4_FILTERMUTECTCALLS_MT' {
ext.prefix = { "${meta.id}_filtered_shifted" }
}

}
34 changes: 30 additions & 4 deletions conf/modules/annotate_consequence_pli.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ process {
}

withName: '.*ANN_CSQ_PLI_SV:ADD_MOST_SEVERE_CSQ' {
ext.prefix = { "${meta.id}_vep_csq" }
ext.prefix = { "${meta.id}_genome_vep_csq" }
}

withName: '.*ANN_CSQ_PLI_SV:ADD_MOST_SEVERE_PLI' {
ext.prefix = { "${meta.id}_vep_csq_pli" }
ext.prefix = { "${meta.id}_genome_vep_csq_pli" }
}

withName: '.*ANN_CSQ_PLI_SV:TABIX_BGZIPTABIX' {
ext.prefix = { "${meta.id}_vep_csq_pli" }
ext.prefix = { "${meta.id}_genome_vep_csq_pli" }
publishDir = [
path: { "${params.outdir}/annotate_sv" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -58,7 +58,33 @@ process {
withName: '.*ANN_CSQ_PLI_SNV:TABIX_BGZIPTABIX' {
ext.prefix = { "${meta.id}_vep_csq_pli" }
publishDir = [
path: { "${params.outdir}/annotate_snv" },
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}

process {
withName: '.*ANN_CSQ_PLI_MT:.*' {
ext.when = !params.skip_mt_annotation
publishDir = [
enabled: false
]
}

withName: '.*ANN_CSQ_PLI_MT:ADD_MOST_SEVERE_CSQ' {
ext.prefix = { "${meta.id}_mt_vep_csq" }
}

withName: '.*ANN_CSQ_PLI_MT:ADD_MOST_SEVERE_PLI' {
ext.prefix = { "${meta.id}_mt_vep_csq_pli" }
}

withName: '.*ANN_CSQ_PLI_MT:TABIX_BGZIPTABIX' {
ext.prefix = { "${meta.id}_mt_vep_csq_pli" }
publishDir = [
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,75 +16,75 @@
//

process {
withName: '.*ANNOTATE_SNVS:.*' {
withName: '.*ANNOTATE_GENOME_SNVS:.*' {
ext.when = !params.skip_snv_annotation
}

withName: '.*ANNOTATE_SNVS:VCFANNO' {
withName: '.*ANNOTATE_GENOME_SNVS:VCFANNO' {
ext.prefix = { "${meta.id}_vcfanno" }
publishDir = [
enabled: false
]
}

withName: '.*ANNOTATE_SNVS:BCFTOOLS_ROH' {
withName: '.*ANNOTATE_GENOME_SNVS:BCFTOOLS_ROH' {
ext.args = { "--samples ${meta.probands.join(",")} --skip-indels " }
ext.prefix = { "${meta.id}_roh" }
}

withName: '.*ANNOTATE_SNVS:RHOCALL_ANNOTATE' {
withName: '.*ANNOTATE_GENOME_SNVS:RHOCALL_ANNOTATE' {
ext.args = { "--v14 " }
ext.prefix = { "${meta.id}_rohann" }
}

withName: '.*ANNOTATE_SNVS:VCFANNO' {
withName: '.*ANNOTATE_GENOME_SNVS:VCFANNO' {
ext.prefix = { "${meta.id}_rohann_vcfanno" }
}

withName: '.*ANNOTATE_SNVS:UPD_SITES' {
withName: '.*ANNOTATE_GENOME_SNVS:UPD_SITES' {
ext.prefix = { "${meta.id}_rohann_vcfanno_upd_sites" }
ext.args = {"--af-tag GNOMADAF --proband ${meta.upd_child} --mother ${meta.mother} --father ${meta.father} sites"}
}

withName: '.*ANNOTATE_SNVS:UPD_REGIONS' {
withName: '.*ANNOTATE_GENOME_SNVS:UPD_REGIONS' {
ext.prefix = { "${meta.id}_rohann_vcfanno_upd_regions" }
ext.args = {"--af-tag GNOMADAF --proband ${meta.upd_child} --mother ${meta.mother} --father ${meta.father} regions --min-size 5 --min-sites 1"}
ext.when = { !(workflow.profile.tokenize(',').intersect(['test', 'test_one_sample']).size() >= 1) || workflow.stubRun }
}

withName: '.*ANNOTATE_SNVS:CHROMOGRAPH_SITES' {
withName: '.*ANNOTATE_GENOME_SNVS:CHROMOGRAPH_SITES' {
ext.prefix = { "${meta7.id}_rohann_vcfanno_upd_sites_chromograph" }
ext.args = { "--euploid" }
tag = {"${meta7.id}"}
publishDir = [
path: { "${params.outdir}/annotate_snv" },
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANNOTATE_SNVS:CHROMOGRAPH_REGIONS' {
withName: '.*ANNOTATE_GENOME_SNVS:CHROMOGRAPH_REGIONS' {
ext.prefix = { "${meta6.id}_rohann_vcfanno_upd_regions_chromograph" }
ext.args = { '--euploid' }
ext.when = { !(workflow.profile.tokenize(',').intersect(['test', 'test_one_sample']).size() >= 1) || workflow.stubRun }
tag = {"${meta6.id}"}
publishDir = [
path: { "${params.outdir}/annotate_snv" },
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANNOTATE_SNVS:BCFTOOLS_VIEW' {
withName: '.*ANNOTATE_GENOME_SNVS:BCFTOOLS_VIEW' {
ext.prefix = { "${meta.id}_rohann_vcfanno_filter" }
ext.args = { '--output-type z --exclude "INFO/GNOMADAF > 0.70 | INFO/GNOMADAF_popmax > 0.70" ' }
}

withName: '.*ANNOTATE_SNVS:GATK4_SELECTVARIANTS' {
withName: '.*ANNOTATE_GENOME_SNVS:GATK4_SELECTVARIANTS' {
ext.prefix = { "${meta.id}_${intervals.simpleName}" }
}

withName: '.*ANNOTATE_SNVS:ENSEMBLVEP_SNV' {
withName: '.*ANNOTATE_GENOME_SNVS:ENSEMBLVEP_SNV' {
ext.prefix = { "${vcf.simpleName}_rohann_vcfanno_filter_vep" }
ext.args = [
'--dir_plugins vep_cache/Plugins',
Expand All @@ -103,18 +103,18 @@ process {
].join(' ')
}

withName: '.*ANNOTATE_SNVS:BCFTOOLS_CONCAT' {
withName: '.*ANNOTATE_GENOME_SNVS:BCFTOOLS_CONCAT' {
ext.prefix = { "${meta.id}_rohann_vcfanno_filter_vep" }
publishDir = [
path: { "${params.outdir}/annotate_snv" },
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANNOTATE_SNVS:TABIX_BCFTOOLS_CONCAT' {
withName: '.*ANNOTATE_GENOME_SNVS:TABIX_BCFTOOLS_CONCAT' {
publishDir = [
path: { "${params.outdir}/annotate_snv" },
path: { "${params.outdir}/annotate_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,8 @@

process {

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:GATK4_MERGEVCFS_LIFT_UNLIFT_MT' {
ext.prefix = { "${meta.id}_merged" }
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:GATK4_VARIANTFILTRATION_MT' {
ext.prefix = { "${meta.id}_filt" }
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:SPLIT_MULTIALLELICS_MT' {
ext.args = '--output-type z --multiallelics -both'
ext.prefix = { "${meta.id}_split" }
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:REMOVE_DUPLICATES_MT' {
ext.args = '--output-type z --rm-dup none'
ext.prefix = { "${meta.id}_split_rmdup" }
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:BCFTOOLS_MERGE_MT' {
ext.args = '--output-type z'
ext.prefix = { "${meta.id}_merge_mt" }
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:ENSEMBLVEP_MT' {
withName: '.*ANNOTATE_MT_SNVS:ENSEMBLVEP_MT' {
ext.args = [
'--dir_plugins vep_cache/Plugins',
'--plugin LoFtool,vep_cache/LoFtool_scores.txt',
Expand All @@ -58,28 +36,28 @@ process {
].join(' ')
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:ZIP_TABIX_HMTNOTE' {
withName: '.*ANNOTATE_MT_SNVS:ZIP_TABIX_HMTNOTE' {
ext.prefix = { "${meta.id}_vep_vcfanno_hmtnote_mt" }
publishDir = [
path: { "${params.outdir}/annotate_mt" },
path: { "${params.outdir}/annotate_snv/mitochondria" },
mode: params.publish_dir_mode,
pattern: "*{vcf.gz,vcf.gz.tbi}",
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:HMTNOTE_ANNOTATE' {
withName: '.*ANNOTATE_MT_SNVS:HMTNOTE_ANNOTATE' {
ext.prefix = { "${meta.id}_vep_vcfanno_hmtnote_mt" }
ext.args = '--offline'
publishDir = [
enabled: false
]
}

withName: '.*ANALYSE_MT:MERGE_ANNOTATE_MT:HAPLOGREP2_CLASSIFY_MT' {
withName: '.*ANNOTATE_MT_SNVS:HAPLOGREP2_CLASSIFY_MT' {
ext.prefix = { "${meta.id}_haplogrep" }
publishDir = [
path: { "${params.outdir}/annotate_mt" },
path: { "${params.outdir}/annotate_snv/mitochondria" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand Down
10 changes: 10 additions & 0 deletions conf/modules/call_snv.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ process {
]
}

withName: '.*CALL_SNV:GATK4_SELECTVARIANTS' {
ext.args = "--exclude-intervals ${params.mito_name}"
ext.prefix = { "${meta.id}_nomito" }
ext.when = { !params.skip_snv_annotation }
publishDir = [
path: { "${params.outdir}/call_snv/genome" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}
Loading