-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnextflow.config
44 lines (35 loc) · 1.52 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
conda.enabled = true
dag.overwrite = true
// Dynamically fetch available system resources
def availableCpus = { java.lang.Runtime.getRuntime().availableProcessors() }()
def availableMemoryGB = {
def osBean = java.lang.management.ManagementFactory.getOperatingSystemMXBean() as com.sun.management.OperatingSystemMXBean
def totalMemoryGB = (osBean.getTotalPhysicalMemorySize() / (1024 * 1024 * 1024)) as float
return Math.max(totalMemoryGB * 0.3, 1) // Reserve 4 GB for OS
}()
process {
errorStrategy = 'retry' // Retry failed tasks
// maxRetries = 3 // Retry up to 3 times before failing
// General options
executor = 'local' // Change to 'sge' for cluster usage
withLabel: high_cpu {
cpus = process.executor == 'sge' ? 16 : (availableCpus as Integer)
memory = process.executor == 'sge' ? '64 GB' : "${availableMemoryGB as Integer} GB"
}
withLabel: medium_cpu {
cpus = { Math.min(4, (availableCpus as Integer)) } // Use Integer for comparison
memory = { "${Math.min(15, (availableMemoryGB as Integer))} GB" } // Convert available memory to Integer for comparison
}
withLabel: low_cpu {
cpus = 1
memory = '4 GB' // Static configuration
}
// SGE-specific options
withName: 'alignReads' {
cpus = { Math.min(12, (availableCpus as Integer)) } // Limit CPUs to 12
clusterOptions = { "-V -S /bin/bash -R y -l ram=${task.memory.toGiga()}G" }
}
}
params {
path_to_ngs_agg = "/mnt/bioinfo/prg/ngs-aggregate_results/current/"
}