forked from nf-core/sarek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkduplicates.config
136 lines (125 loc) · 5.77 KB
/
markduplicates.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
ext.when = When to run the module.
----------------------------------------------------------------------------------------
*/
// MARKDUPLICATES
process {
withName: 'CRAM_TO_BAM' {
ext.args = { '-b' }
}
withName: 'BAM_TO_CRAM' {
// BAM provided for step Markduplicates either run through MD or Convert -> then saved as sorted.cram (convert) or md.cram (md directly)
// BAM files provided for step prepare_recal are converted and run through BQSR -> then saved as md.cram
// BAM files provided for step recal are converted and run through BQSR II -> then saved as md.cram
ext.args = { '-C' }
ext.prefix = { "${meta.id}.converted" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/converted/${meta.id}" },
pattern: "*{cram,crai}",
saveAs: { !params.save_output_as_bam ? it : null }
]
}
withName: 'NFCORE_SAREK:SAREK:(BAM_MARKDUPLICATES|BAM_MARKDUPLICATES_SPARK):CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS' {
ext.prefix = { "${meta.id}.md.cram" }
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('samtools')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/samtools/${meta.id}" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'BAM_TO_CRAM_MAPPING' {
ext.prefix = { "${meta.id}.sorted" }
// Run only when mapping should be saved as CRAM or when no MD is done
ext.when = (params.save_mapped && !params.save_output_as_bam) ||
(
(params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) &&
!(params.tools && params.tools.split(',').contains('sentieon_dedup'))
)
publishDir = [
// Never publish if BAM only should be published
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/mapped/${meta.id}/" },
pattern: "*{cram,crai}",
saveAs: { !params.save_output_as_bam ? it : null }
]
}
withName: 'GATK4_ESTIMATELIBRARYCOMPLEXITY' {
ext.prefix = { "${meta.id}.md.cram" }
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates_report')) }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/markduplicates/${meta.id}" },
pattern: "*metrics"
]
}
withName: 'GATK4_MARKDUPLICATES' {
ext.args = '-REMOVE_DUPLICATES false -VALIDATION_STRINGENCY LENIENT'
ext.prefix = { "${meta.id}.md.cram" }
ext.when = { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates')) }
publishDir = [
[
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/markduplicates/${meta.id}/" },
pattern: "*{cram,crai}",
saveAs: { !params.save_output_as_bam ? it : null }
],
[
mode: params.publish_dir_mode,
path: { "${params.outdir}/reports/" },
pattern: "*metrics",
saveAs: { !(params.skip_tools && params.skip_tools.split(',').contains('markduplicates_report')) ? "markduplicates/${meta.id}/${it}" : null}
]
]
}
withName: 'GATK4SPARK_MARKDUPLICATES' {
if (params.use_gatk_spark && params.docker_enabled) {
containerOptions = ''
}
ext.args = { '--remove-sequencing-duplicates false -VS LENIENT' }
ext.prefix = { "${meta.id}.md.cram" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/markduplicates/${meta.id}/" },
pattern: "*{cram,crai}",
saveAs: { !params.save_output_as_bam ? it : null }
]
}
withName: 'INDEX_MARKDUPLICATES' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/markduplicates/${meta.id}/" },
pattern: "*{cram,crai}",
saveAs: { !params.save_output_as_bam ? it : null }
]
}
withName: 'NFCORE_SAREK:SAREK:CRAM_TO_BAM' {
ext.when = { params.save_output_as_bam }
if (params.tools && params.tools.split(',').contains('sentieon_dedup')) {
ext.prefix = { "${meta.id}.dedup" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/sentieon_dedup/${meta.id}/" },
pattern: "*{dedup.bam,dedup.bam.bai}",
saveAs: { params.save_output_as_bam ? it : null }
]
} else {
ext.prefix = { "${meta.id}.md" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/markduplicates/${meta.id}/" },
pattern: "*{md.bam,md.bam.bai}",
saveAs: { params.save_output_as_bam ? it : null }
]
}
}
}