Skip to content

Commit 22f0546

Browse files
authored
Merge pull request #5 from ToolsVanBox/develop
Develop
2 parents ccd2f92 + 7093de4 commit 22f0546

124 files changed

Lines changed: 1733 additions & 863 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.*
22
!.gitignore
33
demo*/
4+
._*

assets/schema_input.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"format": "file-path",
1919
"exists": true,
2020
"pattern": "^\\S+\\.f(ast)?q\\.gz$",
21-
"errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'",
21+
"errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'"
2222
},
2323
"fastq_2": {
2424
"type": "string",
2525
"format": "file-path",
2626
"exists": true,
2727
"pattern": "^\\S+\\.f(ast)?q\\.gz$",
28-
"errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'"
28+
"errorMessage": "FastQ file for reads 2 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'"
2929
},
3030
"bam": {
3131
"type": "string",
@@ -41,6 +41,20 @@
4141
"pattern": "^\\S+\\.bai$",
4242
"errorMessage": "Bam file cannot contain spaces and must have extension '.bai'"
4343
},
44+
"cram": {
45+
"type": "string",
46+
"format": "file-path",
47+
"exists": true,
48+
"pattern": "^\\S+\\.cram$",
49+
"errorMessage": "Bam file cannot contain spaces and must have extension '.cram'"
50+
},
51+
"crai": {
52+
"type": "string",
53+
"format": "file-path",
54+
"exists": true,
55+
"pattern": "^\\S+\\.crai$",
56+
"errorMessage": "Bam file cannot contain spaces and must have extension '.crai'"
57+
},
4458
"sample_type": {
4559
"type": "string",
4660
"errorMessage": "Sample type must be 'tumor' or 'normal",
@@ -57,6 +71,7 @@
5771
},
5872
"allOf": [
5973
{"uniqueEntries": ["fastq_1", "fastq_2"]},
60-
{"uniqueEntries": ["bam","bai"]}
74+
{"uniqueEntries": ["bam","bai"]},
75+
{"uniqueEntries": ["cram","crai"]}
6176
]
6277
}

configs/base.config

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
params {
2-
max_memory = '128.GB'
2+
max_memory = '800.GB'
33
max_cpus = 16
4-
max_time = '240.h'
4+
max_time = '360.h'
55
}
66

77
def check_max(obj, type) {
@@ -42,7 +42,7 @@ process {
4242
shell = ['/bin/bash', '-euo', 'pipefail']
4343

4444
// memory errors which should be retried. otherwise error out
45-
errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
45+
errorStrategy = { task.exitStatus in ((130..145) + 104 + 9) ? 'retry' : 'finish' }
4646
maxRetries = 3
4747
maxErrors = '-1'
4848

@@ -92,30 +92,44 @@ process {
9292
withName: 'SAMTOOLS_MPILEUP' {
9393
time = { check_max( 12.h * task.attempt, 'time' ) }
9494
}
95-
9695
withName: 'FREEC_GERMLINE' {
9796
time = { check_max( 2.h * task.attempt, 'time' ) }
9897
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
9998
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
10099
}
101-
102100
withName: 'GRIDSS' {
103101
time = { check_max( 2.h * task.attempt, 'time' ) }
104102
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
105103
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
106104
}
107-
108105
withName: 'GATK4_MUTECT2' {
109-
time = { check_max( 2.h * task.attempt, 'time' ) }
110-
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
111-
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
106+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
107+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
108+
time = { check_max( 8.h * task.attempt, 'time' ) }
112109
clusterOptions = "--gres=tmpspace:100G"
113110
}
114-
115111
withName: 'GATK4_LEARNREADORIENTATIONMODEL' {
116112
time = { check_max( 2.h * task.attempt, 'time' ) }
117-
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
118-
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
113+
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
114+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
115+
clusterOptions = "--gres=tmpspace:100G"
116+
}
117+
withName: 'BCFTOOLS_SMURF_SORT' {
118+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
119+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
120+
time = { check_max( 8.h * task.attempt, 'time' ) }
121+
clusterOptions = "--gres=tmpspace:100G"
122+
}
123+
withName: 'BCFTOOLS_SMURF_FILTERED_SORT' {
124+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
125+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
126+
time = { check_max( 8.h * task.attempt, 'time' ) }
127+
clusterOptions = "--gres=tmpspace:100G"
128+
}
129+
withName: 'REALIGNREADS' {
130+
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
131+
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
132+
time = { check_max( 4.h * task.attempt, 'time' ) }
119133
clusterOptions = "--gres=tmpspace:100G"
120134
}
121135

configs/base_demo.config

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
params {
2+
max_memory = '128.GB'
3+
max_cpus = 16
4+
max_time = '240.h'
5+
}
6+
7+
def check_max(obj, type) {
8+
if (type == 'memory') {
9+
try {
10+
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
11+
return params.max_memory as nextflow.util.MemoryUnit
12+
else
13+
return obj
14+
} catch (all) {
15+
println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj"
16+
return obj
17+
}
18+
} else if (type == 'time') {
19+
try {
20+
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
21+
return params.max_time as nextflow.util.Duration
22+
else
23+
return obj
24+
} catch (all) {
25+
println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj"
26+
return obj
27+
}
28+
} else if (type == 'cpus') {
29+
try {
30+
return Math.min( obj, params.max_cpus as int )
31+
} catch (all) {
32+
println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj"
33+
return obj
34+
}
35+
}
36+
}
37+
38+
process {
39+
cpus = { check_max( 1 * task.attempt, 'cpus' ) }
40+
memory = { check_max( 10.GB * task.attempt, 'memory' ) }
41+
time = { check_max( 1.h * task.attempt, 'time' ) }
42+
shell = ['/bin/bash', '-euo', 'pipefail']
43+
44+
// memory errors which should be retried. otherwise error out
45+
errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
46+
maxRetries = 3
47+
maxErrors = '-1'
48+
49+
// Process-specific resource requirements
50+
51+
withLabel:process_single {
52+
cpus = { check_max( 1 , 'cpus' ) }
53+
memory = { check_max( 6.GB * task.attempt, 'memory' ) }
54+
time = { check_max( 4.h * task.attempt, 'time' ) }
55+
}
56+
withLabel:process_low {
57+
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
58+
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
59+
time = { check_max( 4.h * task.attempt, 'time' ) }
60+
}
61+
withLabel:process_medium {
62+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
63+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
64+
time = { check_max( 8.h * task.attempt, 'time' ) }
65+
}
66+
withLabel:process_high {
67+
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
68+
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
69+
time = { check_max( 16.h * task.attempt, 'time' ) }
70+
}
71+
withLabel:process_long {
72+
time = { check_max( 20.h * task.attempt, 'time' ) }
73+
}
74+
withLabel:process_high_memory {
75+
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
76+
}
77+
withLabel:error_ignore {
78+
errorStrategy = 'ignore'
79+
}
80+
withLabel:error_retry {
81+
errorStrategy = 'retry'
82+
maxRetries = 2
83+
}
84+
85+
withName: 'GATK4_HAPLOTYPECALLER' {
86+
memory = { check_max( 50.GB * task.attempt, 'memory' ) }
87+
}
88+
withName: 'BWAMEM2_INDEX' {
89+
time = { check_max( 2.h * task.attempt, 'time' ) }
90+
memory = { check_max( 90.GB * task.attempt, 'memory' ) }
91+
}
92+
withName: 'SAMTOOLS_MPILEUP' {
93+
time = { check_max( 12.h * task.attempt, 'time' ) }
94+
}
95+
96+
withName: 'FREEC_GERMLINE' {
97+
time = { check_max( 2.h * task.attempt, 'time' ) }
98+
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
99+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
100+
}
101+
102+
withName: 'GRIDSS' {
103+
time = { check_max( 2.h * task.attempt, 'time' ) }
104+
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
105+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
106+
}
107+
108+
withName: 'GATK4_MUTECT2' {
109+
time = { check_max( 2.h * task.attempt, 'time' ) }
110+
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
111+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
112+
clusterOptions = "--gres=tmpspace:100G"
113+
}
114+
115+
withName: 'GATK4_LEARNREADORIENTATIONMODEL' {
116+
time = { check_max( 2.h * task.attempt, 'time' ) }
117+
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
118+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
119+
clusterOptions = "--gres=tmpspace:100G"
120+
}
121+
122+
}
123+

configs/base_oatv.config

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
params {
2+
max_memory = '800.GB'
3+
max_cpus = 16
4+
max_time = '360.h'
5+
}
6+
7+
def check_max(obj, type) {
8+
if (type == 'memory') {
9+
try {
10+
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
11+
return params.max_memory as nextflow.util.MemoryUnit
12+
else
13+
return obj
14+
} catch (all) {
15+
println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj"
16+
return obj
17+
}
18+
} else if (type == 'time') {
19+
try {
20+
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
21+
return params.max_time as nextflow.util.Duration
22+
else
23+
return obj
24+
} catch (all) {
25+
println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj"
26+
return obj
27+
}
28+
} else if (type == 'cpus') {
29+
try {
30+
return Math.min( obj, params.max_cpus as int )
31+
} catch (all) {
32+
println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj"
33+
return obj
34+
}
35+
}
36+
}
37+
38+
process {
39+
cpus = { check_max( 1 * task.attempt, 'cpus' ) }
40+
memory = { check_max( 10.GB * task.attempt, 'memory' ) }
41+
time = { check_max( 1.h * task.attempt, 'time' ) }
42+
shell = ['/bin/bash', '-euo', 'pipefail']
43+
44+
// memory errors which should be retried. otherwise error out
45+
errorStrategy = { task.exitStatus in ((130..145) + 104 + 9) ? 'retry' : 'finish' }
46+
maxRetries = 6
47+
maxErrors = '-1'
48+
49+
// Process-specific resource requirements
50+
51+
withLabel:process_single {
52+
cpus = { check_max( 1 , 'cpus' ) }
53+
memory = { check_max( 6.GB * task.attempt, 'memory' ) }
54+
time = { check_max( 4.h * task.attempt, 'time' ) }
55+
}
56+
withLabel:process_low {
57+
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
58+
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
59+
time = { check_max( 4.h * task.attempt, 'time' ) }
60+
}
61+
withLabel:process_medium {
62+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
63+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
64+
time = { check_max( 8.h * task.attempt, 'time' ) }
65+
}
66+
withLabel:process_high {
67+
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
68+
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
69+
time = { check_max( 16.h * task.attempt, 'time' ) }
70+
}
71+
withLabel:process_long {
72+
time = { check_max( 20.h * task.attempt, 'time' ) }
73+
}
74+
withLabel:process_high_memory {
75+
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
76+
}
77+
withLabel:error_ignore {
78+
errorStrategy = 'ignore'
79+
}
80+
withLabel:error_retry {
81+
errorStrategy = 'retry'
82+
maxRetries = 2
83+
}
84+
85+
withName: 'GATK4_HAPLOTYPECALLER' {
86+
memory = { check_max( 50.GB * task.attempt, 'memory' ) }
87+
}
88+
withName: 'BWAMEM2_INDEX' {
89+
time = { check_max( 2.h * task.attempt, 'time' ) }
90+
memory = { check_max( 90.GB * task.attempt, 'memory' ) }
91+
}
92+
withName: 'SAMTOOLS_MPILEUP' {
93+
time = { check_max( 100.h * task.attempt, 'time' ) }
94+
}
95+
withName: 'FREEC_GERMLINE' {
96+
time = { check_max( 2.h * task.attempt, 'time' ) }
97+
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
98+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
99+
}
100+
withName: 'GRIDSS' {
101+
time = { check_max( 16.h * task.attempt, 'time' ) }
102+
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
103+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
104+
}
105+
withName: 'GATK4_MUTECT2' {
106+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
107+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
108+
time = { check_max( 8.h * task.attempt, 'time' ) }
109+
clusterOptions = "--gres=tmpspace:100G"
110+
}
111+
withName: 'GATK4_LEARNREADORIENTATIONMODEL' {
112+
time = { check_max( 2.h * task.attempt, 'time' ) }
113+
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
114+
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
115+
clusterOptions = "--gres=tmpspace:100G"
116+
}
117+
withName: 'BCFTOOLS_SMURF_SORT' {
118+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
119+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
120+
time = { check_max( 8.h * task.attempt, 'time' ) }
121+
clusterOptions = "--gres=tmpspace:100G"
122+
}
123+
withName: 'BCFTOOLS_SMURF_FILTERED_SORT' {
124+
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
125+
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
126+
time = { check_max( 8.h * task.attempt, 'time' ) }
127+
clusterOptions = "--gres=tmpspace:100G"
128+
}
129+
withName: 'REALIGNREADS' {
130+
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
131+
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
132+
time = { check_max( 4.h * task.attempt, 'time' ) }
133+
clusterOptions = "--gres=tmpspace:100G"
134+
}
135+
136+
}
137+

0 commit comments

Comments
 (0)