Repository navigation
Expand file tree
/
Copy pathnextflow.config
More file actions
130 lines (118 loc) · 6.7 KB
/
Copy pathnextflow.config
File metadata and controls
130 lines (118 loc) · 6.7 KB
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
includeConfig "config/utils.config"
// Defaults
// singularity_path is set in config/utils.config to ensure it exists before profiles are loaded
params.max_cpus = (params.max_cpus ?: 24) as Integer
params.max_memory = (params.max_memory ?: '64 GB')
params.max_time = (params.max_time ?: '48 h')
// Scalar-only clamps (avoid Map returns)
def clampCpu = { v -> Math.min((v as Integer), (params.max_cpus as Integer)) }
def clampMem = { v ->
def want = nextflow.util.MemoryUnit.of(v.toString())
def cap = nextflow.util.MemoryUnit.of(params.max_memory.toString())
want < cap ? want : cap
}
def clampTime = { v ->
def want = nextflow.util.Duration.of(v.toString())
def cap = nextflow.util.Duration.of(params.max_time.toString())
want < cap ? want : cap
}
params {
input_dir = "" // Base path to input images
output_dir = "" // Base path to output location
file_type = "moldev" // "moldev" or "zeiss" microscope?
use_2d = false // 2d image processing, instead of 3d
simulate = false // Simulate the microscopy data (note: use_2d will be set to true)
num_simulations = 2 // Number of samples to simulate
test_image_count = 0 // The number of random images to use for spot check. If 0, then all images used
test_image_names = null // Select >=1 image to assess via spot check (comma-delimited list of file base names, e.g., "2024_04_17_Baseline-01(1)")
llm = "gpt-4o-mini" // OpenAI LLM for log summarization ("gpt-4o-mini" or "gpt-4o")
decay_time = 0.5 // The average decay time of a transient
gSig = 6 // The expected half size of neurons (height, width)
rf = 40 // The size of patches for the correlation image
min_SNR = 3 // Adaptive threshold for transient size
r_values_min = 0.85 // Threshold for spatial consistency
tsub = 2 // Downsampling factor in time
ssub = 2 // Downsampling factor in space
p_th = 0.75 // Threshold percentile for image processing
min_corr = 0.8 // Min peak value from correlation image
min_pnr = 5 // Min peak to noise ration from PNR image
ring_size_factor = 1.4 // Radius of ring is gSig*ring_size_factor
f_baseline_perc = 8 // Percentile value for the filter when converting fluorescence data to delta F/F
win_sz = 500 // Window size for the percentile filter (calc_dff_f0 step)
min_clusters = 2 // Minimum number of clusters for the clustering step
max_clusters = 10 // Maximum number of clusters for the clustering step
size_threshold = 20000 // Size threshold for filtering out noise events.
percentage_threshold = 0.2 // Percentage threshold for FWHM calculation.
zscore_threshold = 3 // Z-score threshold for filtering out noise events.
min_object_size = 500 // Minimum size of objects in pixels for successful segmentation
max_segment_retries = 3 // Maximum number of retries for segmentation if objects are below the threshold
start_diameter = 300 // Starting diameter for mask segmentation step
diameter_step = 200 // Step to increase the diameter after each failed attempt
//-- Scheduler / cloud overrides (used by profiles in config/profiles.config) --//
// Generic SLURM (-profile slurm_generic): partition/queue name. Empty => cluster default.
slurm_queue = (System.getenv('LZW_SLURM_QUEUE') ?: null)
// GCP Batch (-profile gcp). Defaults are Arc's so internal runs keep working;
// external users override with --gcp_project / --gcp_region / --gcp_workdir
// or the matching env vars.
gcp_project = (System.getenv('GCP_PROJECT') ?: "arc-genomics")
gcp_region = (System.getenv('GCP_REGION') ?: "us-west1")
gcp_workdir = (System.getenv('GCP_WORKDIR') ?: "gs://arc-genomics-nextflow/work")
// AWS Batch (-profile awsbatch). No real Arc defaults; these are placeholders
// every external user must override with --aws_* or the matching env vars.
aws_region = (System.getenv('AWS_REGION') ?: "us-east-1")
aws_workdir = (System.getenv('LZW_AWS_WORKDIR') ?: "s3://CHANGE-ME-bucket/lizard-wizard-work")
aws_queue = (System.getenv('LZW_AWS_QUEUE') ?: "CHANGE-ME-batch-queue")
aws_cli_path = (System.getenv('LZW_AWS_CLI_PATH') ?: "/home/ec2-user/miniconda/bin/aws")
}
//-- Extra configs --//
includeConfig "config/process.config"
includeConfig "config/profiles.config"
// Add singularity configuration.
// NOTE: `enabled` here is a base default; the conda/docker profiles flip it off.
// cacheDir is where Singularity stores images it pulls. We detect Arc's Chimera
// shared cache *by existence* so internal behavior is unchanged (Chimera always
// has this directory), while external users — who do not have it — get a local
// default (./.singularity-cache). Override anywhere with LZW_SINGULARITY_CACHE.
// (Existence, not writability: matches the original unconditional Arc default
// and avoids silently relocating the cache if per-user perms differ on Chimera.)
singularity {
enabled = true
autoMounts = true
cacheDir = (System.getenv('LZW_SINGULARITY_CACHE')
?: (new File('/large_storage/multiomics/public/singularity/cache').isDirectory()
? '/large_storage/multiomics/public/singularity/cache'
: "$projectDir/.singularity-cache"))
}
//-- Functions --//
// Remove trailing forward slashes in a string
def fmtPath(path_str) {
return path_str.replaceAll(/\/+$/, '')
}
// Limit to the max resources of the available machine
def check_max(obj, type){
if(type == 'memory'){
if(obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1){
return params.max_memory as nextflow.util.MemoryUnit
}
} else if(type == 'time'){
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1){
return params.max_time as nextflow.util.Duration
}
} else if(type == 'cpus'){
if (obj > params.max_cpus as int){
return params.max_cpus as int
}
}
return obj
}
def getWorkDir() {
def userGroup = "id -gn".execute().text.trim()
def userName = "whoami".execute().text.trim()
def workDir = "/scratch/$userGroup/$userName/nextflow-work/lizard-wizard"
return workDir
}
def getCondaCacheDir() {
def userName = "whoami".execute().text.trim()
cacheDir = "/home/$userName/nextflow/conda-cache/lizard-wizard"
return cacheDir
}