-
Notifications
You must be signed in to change notification settings - Fork 1
/
nextflow.config
95 lines (81 loc) · 3.55 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
// config variable precedence: CLI args -> nextflow.config -> main.nf
// ~~~~~ EXTERNAL CONFIGS ~~~~~ //
params.externalConfigFile = "config.json"
import groovy.json.JsonSlurper
def jsonSlurper = new JsonSlurper()
String externalConfigContents = new File("${params.externalConfigFile}").text
def externalConfig = jsonSlurper.parseText(externalConfigContents)
params.externalConfig = externalConfig
params.syncServer = externalConfig.syncServer
params.MCITdir = externalConfig.MCITdir
params.BigPurpleDataNode = externalConfig.BigPurpleDataNode
params.productionDir = externalConfig.productionDir
params.productionDirNGS50 = externalConfig.productionDirNGS50
params.seqDir = externalConfig.seqDir
params.demuxDir = externalConfig.demuxDir
params.NGS580Dir = externalConfig.NGS580Dir
params.usergroup = externalConfig.usergroup
params.samplesheetDir = externalConfig.samplesheetDir
params.pipelinesDir = externalConfig.pipelinesDir
// ~~~~~ INTERNAL CONFIGS ~~~~~ //
import java.text.SimpleDateFormat
Date now = new Date()
SimpleDateFormat timestamp_fmt = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss")
def timestamp = timestamp_fmt.format(now)
def username = System.getProperty("user.name")
String hostname = java.net.InetAddress.getLocalHost().getHostName();
// default configs; overwritten by CLI args
params.logSubDir = "${timestamp}"
params.logDir = "logs/${params.logSubDir}"
params.logDir = new File("logs/${params.logSubDir}").getCanonicalPath()
params.username = username
params.hostname = hostname
params.emailHost = "nyumc.org"
params.emailFrom = "${username}@${params.emailHost}"
params.emailTo = "${username}@${params.emailHost}"
params.sendEmail = true
params.lockFile = ".lock"
params.workflowLabel = "lyz-nf"
manifest {
author = 'Stephen Kelly'
homePage = 'https://github.com/NYU-Molecular-Pathology/lyz-nf'
description = 'Lab Monitor Program'
mainScript = 'main.nf'
}
report {
file = "${params.logDir}/nextflow.html"
}
trace {
fields = "task_id,hash,native_id,process,tag,name,status,exit,module,container,cpus,time,disk,memory,attempt,submit,start,complete,duration,realtime,queue,%cpu,%mem,rss,vmem,peak_rss,peak_vmem,rchar,wchar,syscr,syscw,read_bytes,write_bytes"
raw = true
file = "${params.logDir}/trace.txt"
}
timeline {
file = "${params.logDir}/timeline.html"
}
notification {
to = "${params.emailTo}"
from = "${params.emailFrom}"
}
// configs for all profiles
process.beforeScript = 'TIMESTART=\$(date +%s); TIMESTART_STR="\$(date +"%Y-%m-%d %H:%M:%S")"; printf "USER:\${USER:-none} HOSTNAME:\${HOSTNAME:-none} PWD:\$PWD TIMESTART_STR:\$TIMESTART_STR\n";'
process.afterScript = 'printf "TIMEFINISH: %s" "\$(date +"%Y-%m-%d %H:%M:%S")" ; printf "elapsed time: %s\n" \$((\$(date +%s) - \${TIMESTART:-0}))'
process.errorStrategy = "retry" // re-submit failed processes; e.g. rsync failed due to modification of underlying files, etc
process.maxRetries = 2 // retry a failed process up to 2 times
profiles {
standard { // default
process.executor = 'local'
executor.queueSize = 1
}
phoenix { // for use with NYUMC phoenix HPC system
process.executor = 'sge'
}
bigpurple { // for use with NYUMC Big Purple HPC
process.executor = 'local'
// try to prevent error: module: command not found by sourcing module config, and pausing to allow environment to finish populating
process.beforeScript = ". /etc/profile.d/modules.sh; sleep 1; ${process.beforeScript}"
// process.errorStrategy = "finish"
executor.queueSize = 12
params.syncServer = params.BigPurpleDataNode
}
}