Skip to content

Commit db25694

Browse files
aw-watsonAndre Philippe Watson
and
Andre Philippe Watson
authored
Adding SLURM execution options (#54)
* separated slurm options into separate config * allowed retries with increasing resources * added default resource requests for SRA downloads and preprocessing * added resource defaults for assembly * added defaults for annotation, phageFinder, and validation alignment * added defaults for reads binning and reads-based taxonomy classification * added resource defaults for SMA, contig-based taxonomic classification * updated templates * fix job naming --------- Co-authored-by: Andre Philippe Watson <[email protected]>
1 parent 75946ea commit db25694

File tree

14 files changed

+72
-7
lines changed

14 files changed

+72
-7
lines changed
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//sets executor to slurm
2+
executor.name = "slurm"
3+
//controls job names
4+
executor.jobName = {"$task.process"}
5+
executor.queueSize=5
6+
process {
7+
scratch = true
8+
//options to provide for all processes submitted as cluster jobs (e.g. "--account xx")
9+
clusterOptions = ""
10+
//resource requirements for processes
11+
withLabel: "tiny" {
12+
cpus = {2 * task.attempt}
13+
memory = {4.GB * task.attempt}
14+
}
15+
withLabel: "small" {
16+
cpus = {4* task.attempt}
17+
memory = {8.GB * task.attempt}
18+
}
19+
withLabel: "medium" {
20+
cpus = {8 * task.attempt}
21+
memory = {16.GB * task.attempt}
22+
maxRetries = 2
23+
}
24+
withLabel: "large" {
25+
cpus = {8 * task.attempt}
26+
memory = {32.GB * task.attempt}
27+
maxRetries = 2
28+
}
29+
time = {2.hours * task.attempt}
30+
//if not labeled, uses the below settings
31+
cpus = {4 * task.attempt}
32+
memory = {8.GB * task.attempt}
33+
34+
errorStrategy='retry'
35+
maxRetries=3
36+
}

workflows/Nextflow/modules/contigsTaxonomyAssignment/contigsTaxonomyAssignment.nf

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//base process. Takes a FASTA file containing contigs and performs taxonomic analysis with MICCR (https://github.com/chienchi/miccr).
66
process contigTaxonomy {
77
label 'cta'
8+
label 'medium'
89
containerOptions "--compat --cleanenv \
910
--bind=${settings["miccrDB"]}:/venv/database/miccrDB"
1011
publishDir(
@@ -34,6 +35,7 @@ process contigTaxonomy {
3435
//adds multi-level taxonomic classification to results file. Takes in a .ctg.tsv file produced by MICCR.
3536
process addLineage {
3637
label 'cta'
38+
label 'tiny'
3739
containerOptions "--compat --cleanenv \
3840
--bind=${settings["miccrDB"]}:/venv/database/miccrDB"
3941
publishDir(
@@ -59,6 +61,7 @@ process addLineage {
5961
//and a coverage table (see https://github.com/chienchi/miccr/blob/master/utils/README.md), or from workflow runReadsToContig
6062
process plotAndTable {
6163
label 'cta'
64+
label 'tiny'
6265
publishDir(
6366
path: "${settings["contigsTaxonomyOutDir"]}",
6467
mode: 'copy'

workflows/Nextflow/modules/phageFinder/phageFinder.nf

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
process phageFinderPrep {
55
label 'phageFinder'
6+
label 'tiny'
67

78
input:
89
path gff
@@ -21,6 +22,7 @@ process phageFinderPrep {
2122

2223
process phageFinder {
2324
label 'phageFinder'
25+
label 'small'
2426
publishDir(
2527
path: "${settings["phageFinderOutDir"]}",
2628
mode: 'copy',
@@ -46,6 +48,7 @@ process phageFinder {
4648

4749
process summary {
4850
label 'phageFinder'
51+
label 'tiny'
4952
publishDir(
5053
path: "${settings["phageFinderOutDir"]}",
5154
mode: 'copy'

workflows/Nextflow/modules/processProvidedContigs/processProvidedContigs.nf

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
process processProvidedContigs {
44
label "processContigs"
5+
label "tiny"
56
publishDir(
67
path: "${settings["processProvidedContigsOutDir"]}",
78
mode: 'copy'

workflows/Nextflow/modules/readsBinning/readsBinning.nf

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
process runBinning {
22
label 'binning'
3+
label 'small'
34
publishDir(
45
path: "${settings["readBinningOutDir"]}",
56
mode: 'copy'

workflows/Nextflow/modules/readsTaxonomyAssignment/readsTaxonomyAssignment.nf

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//main RTA process
44
process readsTaxonomy {
55
label 'rta'
6+
label 'large'
67

78
containerOptions "--compat --cleanenv \
89
--bind=${settings["baseDB"]}:/venv/bin/../../../database \
@@ -45,6 +46,7 @@ process readsTaxonomy {
4546
//creates RTA config file based on input settings
4647
process readsTaxonomyConfig {
4748
label 'rta'
49+
label 'small'
4850

4951
containerOptions "--compat --cleanenv \
5052
--bind=${settings["baseDB"]}:/venv/bin/../../../database \

workflows/Nextflow/modules/runAnnotation/runAnnotation.nf

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//sets taxonomic kingdom for analysis if none provided
44
process autodetectKingdom {
55
label 'annotation'
6+
label 'tiny'
67
containerOptions '--compat --bind .:/venv/bin/ec_info'
78
input:
89
path contigs
@@ -23,6 +24,7 @@ process autodetectKingdom {
2324
//process to invocate prokka
2425
process prokkaAnnotate {
2526
label 'annotation'
27+
label 'small'
2628
containerOptions '--compat --bind .:/venv/bin/ec_info'
2729
publishDir(
2830
path: "${settings["annotationOutDir"]}",
@@ -86,6 +88,7 @@ process prokkaAnnotate {
8688
//process to invocate RATT
8789
process rattAnnotate {
8890
label 'annotation'
91+
label 'small'
8992
containerOptions '--compat --bind .:/venv/bin/ec_info'
9093
publishDir(
9194
path: "${settings["annotationOutDir"]}",
@@ -124,6 +127,7 @@ process rattAnnotate {
124127
//plots feature count, protein size distribution, etc.
125128
process annPlot {
126129
label 'annotation'
130+
label 'tiny'
127131
containerOptions '--compat --bind .:/venv/bin/ec_info'
128132
publishDir(
129133
path: "${settings["annotationOutDir"]}",
@@ -150,6 +154,7 @@ process annPlot {
150154
//generates KEGG pathway plots
151155
process keggPlots {
152156
label 'annotation'
157+
label 'tiny'
153158
containerOptions '--compat --bind .:/venv/bin/ec_info'
154159
publishDir(
155160
path: "${settings["annotationOutDir"]}",

workflows/Nextflow/modules/runAntiSmash/runAntiSmash.nf

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//runs ANTISMASH on provided .fa or .gbk input.
33
process antismash {
44
label 'sma'
5+
label 'medium'
56
containerOptions "--bind ${settings["database"]}:/venv/database/antiSMASH"
67
publishDir(
78
path: "${settings["smaOutDir"]}",

workflows/Nextflow/modules/runAssembly/runAssembly.nf

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//main process for assembly with IDBA
88
process idbaUD {
99
label "assembly"
10+
label "small"
1011
publishDir (
1112
path:"${settings["assemblyOutDir"]}",
1213
mode: 'copy',
@@ -81,6 +82,7 @@ process idbaUD {
8182
//prep for idba
8283
process idbaExtractLong {
8384
label "assembly"
85+
label "tiny"
8486

8587
input:
8688
path paired
@@ -105,6 +107,7 @@ process idbaExtractLong {
105107
//prep for idba
106108
process idbaPrepReads {
107109
label "assembly"
110+
label "tiny"
108111
input:
109112
path paired
110113
path unpaired
@@ -128,6 +131,7 @@ process idbaPrepReads {
128131
//assemble using spades
129132
process spades {
130133
label "assembly"
134+
label "small"
131135

132136
publishDir (
133137
path: "${settings["assemblyOutDir"]}",
@@ -212,8 +216,9 @@ process spades {
212216

213217
//assemble using megahit
214218
process megahit {
215-
216219
label "assembly"
220+
label "small"
221+
217222
publishDir(
218223
path: "${settings["assemblyOutDir"]}",
219224
mode: 'copy',
@@ -272,6 +277,7 @@ process megahit {
272277
//assembly using unicycler
273278
process unicycler {
274279
label "assembly"
280+
label "small"
275281
publishDir (
276282
path: "${settings["assemblyOutDir"]}",
277283
mode: 'copy',
@@ -328,6 +334,7 @@ process unicycler {
328334
//filter long reads for unicycler
329335
process unicyclerPrep {
330336
label "assembly"
337+
label "tiny"
331338

332339
input:
333340
val settings
@@ -351,6 +358,7 @@ process unicyclerPrep {
351358
//assembly using lrasm
352359
process lrasm {
353360
label "assembly"
361+
label "small"
354362

355363
publishDir (
356364
path: "${settings["assemblyOutDir"]}",
@@ -429,6 +437,8 @@ process lrasm {
429437

430438
process renameFilterFasta {
431439
label "assembly"
440+
label "small"
441+
432442
publishDir(
433443
path: "${settings["assemblyOutDir"]}",
434444
mode: 'copy'
@@ -461,6 +471,7 @@ process renameFilterFasta {
461471

462472
process bestIncompleteAssembly {
463473
label "assembly"
474+
label "tiny"
464475
input:
465476

466477
val x

workflows/Nextflow/modules/runReadsToContig/runReadsToContig.nf

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
process validationAlignment {
44
label 'r2c'
5+
label 'small'
56
publishDir(
67
path: "${settings["assemblyOutDir"]}/readsMappingToContig",
78
mode: 'copy'
@@ -85,6 +86,7 @@ process validationAlignment {
8586

8687
process makeJSONcoverageTable {
8788
label 'r2c'
89+
label 'tiny'
8890
publishDir(
8991
path: "${settings["assemblyOutDir"]}/readsMappingToContig",
9092
mode: 'copy',
@@ -118,6 +120,7 @@ process makeJSONcoverageTable {
118120

119121
process extractUnmapped {
120122
label 'r2c'
123+
label 'small'
121124
publishDir(
122125
path:"${settings["assemblyOutDir"]}/readsMappingToContig/",
123126
mode: 'copy',

workflows/Nextflow/modules/sra2fastq/sra2fastq.nf

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
process sraDownload {
88
label "sra2fastq"
9+
label "small"
910
tag "$accession"
1011
publishDir "${settings["outDir"]}/SRA_Download", mode: 'copy'
1112
containerOptions "--no-home"

workflows/Nextflow/nextflow.config

-4
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,3 @@ process {
241241
executor {
242242
submitRateLimit = '1/5sec'
243243
}
244-
245-
//cleanup
246-
cleanup = false
247-

workflows/Nextflow/templates/SRAdownload_config.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,5 @@ executor {
245245
submitRateLimit = '1/5sec'
246246
}
247247

248-
includeConfig "<%= report_config %>"
248+
includeConfig "<%= report_config %>"
249+
includeConfig "<%= slurm_config %>"

workflows/Nextflow/templates/runFaQCs_config.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,5 @@ executor {
242242
submitRateLimit = '1/5sec'
243243
}
244244

245-
includeConfig "<%= report_config %>"
245+
includeConfig "<%= report_config %>"
246+
includeConfig "<%= slurm_config %>"

0 commit comments

Comments
 (0)