-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextflow.config
211 lines (186 loc) · 6.72 KB
/
nextflow.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tron-bioinformatics/tronflow-copy-number-calling Nextflow config file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default config options for all compute environments
----------------------------------------------------------------------------------------
*/
params {
// Workflow flags:
// Mandatory arguments
input_files = false
// References
reference = false
intervals = false
// Main options
tools = false
output = 'output'
// CNVkit-related options
// None ...
// Sequenza-related options
VROOM_CONNECTION_SIZE = "500000000"
// Other options
help = false
// Max resource options
// Defaults only, expecting to be overwritten
cpus = 1
memory = '3.GB'
}
// Load base.config by default for all pipelines
includeConfig 'conf/base.config'
profiles {
debug {
cleanup = false
dumpHashes = true
process.beforeScript = 'echo $HOSTNAME'
}
conda {
conda.enabled = true
singularity.enabled = false
params.enable_conda = true
conda.createTimeout = "120 min"
}
mamba {
conda.enabled = true
conda.useMamba = true
singularity.enabled = false
params.enable_conda = true
conda.createTimeout = "120 min"
}
singularity {
singularity.enabled = true
singularity.autoMounts = true
conda.enabled = false
params.enable_conda = false
}
test {
includeConfig 'conf/test.config'
}
}
// Export these variables to prevent local Python/R libraries from conflicting with those in the container
env {
PYTHONNOUSERSITE = 1
R_PROFILE_USER = "/.Rprofile"
R_ENVIRON_USER = "/.Renviron"
}
// Capture exit codes from upstream processes when piping
process.shell = ['/bin/bash', '-euo', 'pipefail']
// Set default registry for Singularity independent of -profile
// Will not be used unless Singularity is enabled
// Set to your registry if you have a mirror of containers
singularity.registry = 'quay.io'
def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
timeline {
enabled = true
file = "${params.output}/pipeline_info/execution_timeline_${trace_timestamp}.html"
}
report {
enabled = true
file = "${params.output}/pipeline_info/execution_report_${trace_timestamp}.html"
}
trace {
enabled = true
file = "${params.output}/pipeline_info/execution_trace_${trace_timestamp}.txt"
}
dag {
enabled = true
file = "${params.output}/pipeline_info/pipeline_dag_${trace_timestamp}.html"
}
VERSION = '0.2.2'
DOI = '10.5281/zenodo.7248131'
manifest {
name = 'tron-bioinformatics/tronflow-copy-number-calling'
author = 'Pablo Riesgo-Ferreiro, Jonas Ibn-Salem, Julian Thomas Mohr'
homePage = 'https://github.com/TRON-Bioinformatics/tronflow-copy-number-calling'
description = 'Nextflow pipeline for copy number calling using different tools'
mainScript = 'main.nf'
nextflowVersion = '>=19.10.0'
version = VERSION
doi = DOI
}
params.manifest = manifest
// Function to ensure that resource requirements don't go beyond
// a maximum limit
def check_max(obj, type) {
if (type == 'memory') {
try {
if (obj.compareTo(params.memory as nextflow.util.MemoryUnit) == 1)
return params.memory as nextflow.util.MemoryUnit
else
return obj
} catch (all) {
println " ### ERROR ### Max memory '${params.memory}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
if (obj.compareTo(params.time as nextflow.util.Duration) == 1)
return params.time as nextflow.util.Duration
else
return obj
} catch (all) {
println " ### ERROR ### Max time '${params.time}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'cpus') {
try {
return Math.min( obj, params.cpus as int )
} catch (all) {
println " ### ERROR ### Max cpus '${params.cpus}' is not valid! Using default value: $obj"
return obj
}
}
}
params.help_message = """
TronFlow Copy Number Calling v${params.manifest.version}
Author: ${params.manifest.author}
DOI: ${params.manifest.doi}
GitHub: ${params.manifest.homePage}
${params.manifest.description}
Usage:
nextflow run ${params.manifest.mainScript} -profile conda --input_files input_files.tsv --reference reference.fasta --intervals target_region.bed --tools cnvkit,sequenza
Input:
* input_files: the path to a tab-separated values file containing in each row the sample name, tumor bam and normal bam
The input file does not have header!
Example input file:
name1 tumor_bam1 normal_bam1
name2 tumor_bam2 normal_bam2
* reference: path to the FASTA genome reference
* intervals: path to the BED file with the targeted region
* tools: tools to perform CN calling with (single and multiple entries possible, use ',' as delimiter) [ cnvkit, sequenza ]
Optional input:
* output: the folder where to publish output (default: output)
* VROOM_CONNECTION_SIZE: value for the environment variable VROOM_CONNECTION_SIZE which sometimes causes trouble with sequenza (default: 500000000)
* cpus: the number of CPUs used by each job (default: 1)
* memory: the ammount of memory used by each job (default: 4g)
Output:
CNVkit:
* cnvkit/*.antitarget.bed : antitarget regions
* cnvkit/*.target.bed : target regions
* cnvkit/reference.cnn
* cnvkit/*.tumor.targetcoverage.cnn : binned tumor coverage in target region
* cnvkit/*.normal.targetcoverage.cnn : binned normal coverage in target region
* cnvkit/*.tumor.antitargetcoverage.cnn : binned tumor coverage in anti-target region
* cnvkit/*.normal.antitargetcoverage.cnn : binned normal coverage in ani-target region
* cnvkit/*.tumor.bintest.cns
* cnvkit/*.tumor.cnr : copy number ratios
* cnvkit/*.tumor.cns
* cnvkit/*.tumor.call.cns : copy number segments
Sequenza:
* sequenza/*.gz
* sequenza/*.binned.gz
* sequenza/*_alternative_solutions.txt
* sequenza/*_confints_CP.txt
* sequenza/*_segments.txt
* sequenza/*_sequenza_log.txt : sequenza log file
* sequenza/*_alternative_fit.pdf
* sequenza/*_chromosome_depths.pdf
* sequenza/*_chromosome_view.pdf
* sequenza/*_CN_bars.pdf
* sequenza/*_CP_contours.pdf
* sequenza/*_gc_plots.pdf
* sequenza/*_genome_view.pdf
* sequenza/*_model_fit.pdf
* sequenza/*_sequenza_cp_table.RData
* sequenza/*_sequenza_extract.RData
"""