-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
704 lines (681 loc) · 18.5 KB
/
config.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# ======================================================================
# Download resources
# - ilastik classifiers
# - example data: if using data supplied by user, set `download` to
# false
# ======================================================================
resources:
ilastik:
u2os_nucleoli_bfp_v1: 'https://www.dropbox.com/s/ryoma1qvklinxn6/u2os_nucleoli_bfp_v1.ilp?dl=1'
u2os_nucleoli_bfp_v2: 'https://www.dropbox.com/scl/fi/vv4n4246dsxa472wvpbeg/u2os_nucleoli_bfp_v2.ilp?rlkey=8co2dui00tegjxtfef86gnl5j&dl=1'
example_data:
name: alu-repo-sample-data.zip
url: 'https://www.dropbox.com/scl/fo/mwzas1osvhsdv49jhf4gm/h?rlkey=383hoze85fb5pueq0dgdkv7we&dl=1'
download: true
# ======================================================================
# Experiment-specific configurations
# ======================================================================
# No need to quote the strings in yaml files, but do so when special
# characters are used. More importantly, even if they are quoted here,
# they still need to be quoted again when used in the "shell" derivative.
input:
samplesheet_path: resources/example_data/samplesheet.csv
image_path:
dir: resources/example_data
glob: '*002_Deno.nd2'
regex: 'Well(?P<WellID>[A-H]\d{2})_\w+_fov(?P<FovID>\d{3})_snap-nodelay-snap002_Deno.nd2'
datefmt: # leave blank if not used
# channels has to be in the order as how they present in the raw file
channels:
- oc: "640"
fluoro: miRFP670
colormap: magenta
background: 100
- oc: "488"
fluoro: sfGFP
colormap: green
background: 100
bitdepth: 16
parse_metadata:
nafilter: strict
verbose: True
patch: True
# 1. channels has to be in the order as how they have been specified
# in 'input' module above.
# 2. if you don't specify all the channels from the movies, those
# unspecified channels will be lost, creating unexpected behaviors
# downstream.
register_nucleus:
transformation: RIGID_BODY
mode: previous
registers:
- target: miRFP670
by: sfGFP
- target: sfGFP
by: miRFP670
segment_nuclei_in_time:
channel: sfGFP
diameter: 300
downsample: 10
segment_hc:
channel: miRFP670
hc:
blur_sigma: 1.0
zscore_threshold: 2.0
clean_disk_size: 2
clean_min_size: 50
time_threshold: 0.5
normalize:
structure:
- nucleus
method: zscore
# nested as dict. leave it empty if not needed
method_kwargs:
sn:
predict_nucleoli:
channel_index: 1
model_name: u2os_nucleoli_bfp_v2
measure:
structure:
- nucleus
# - nucleoplasm
piv:
pkg_path: "external/MatPIV-1.7"
channel:
- miRFP670
- sfGFP
movie_meta:
PIXELSIZE: 0.065
DT: 0.5
LAGS_EXPRESSION: "unique(ceil(logspace(0,log10(50),15)))"
protocol: matpiv_v2
protocol_configs:
matpiv_v2:
CONFIG:
PREPROCESS:
BACK: 100
PIV:
WINSIZE: 16
OVERLAP: 0.75
MODE: 'single'
FILTERS:
SNR: 1.1
PKH: 0.3
GLOBAL: 3
# ----------------------------------------------------------------
# MSND analysis
#
# For the "protocols" block, each item corresponds to a specific
# MSND analysis protocol, including input data names and filename
# patterns, preprocessing steps, and MSND type (0-, 1-, 2-d).
#
# Make sure to also update configs for msnd_post rule below for
# each of the protocol specified in this block.
# ----------------------------------------------------------------
msnd:
# Source movie's channel which PIV generated from
channel:
- miRFP670
- sfGFP
# Each protocol contains "data", "preprocess", and "process" blocks
# - For data, each item is a dict
# <name>: # becomes key in data (i.e., data[<name>])
# path: <path pattern> # including wildcards pattern
# # if left blank, will try to use default
# type: <type> # determines how to read data in
# - For preprocess, each item is a dict
# name: <name> # a descriptive name, not used in code
# input: <input_name> # refers to data[<input_name>]. possible
# # options depend on those defined in "data"
# output: <output_name> # can be referred to in a later preprocess
# # for image and piv, make sure to name the
# # last one *_final
# steps: # list of dict
# - func: <data_type>_<func_name> # see msnd_utils.py for options
# params: # dict of dict
# # for params to be passed as kwargs
# - For process,
# name: <name> # possible options now: 0d, 1d, 2d
# params: # dict of dict
# # for params to be passed as kwargs
protocols:
# regular over all nucleoplasmic pixels
normal_0d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
process:
name: 0d
params:
# 1D intensity-binned
eachlevel_1d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
process:
name: 1d
params:
bins_args:
- -3.5
- 3.5
- 0.25
# 2D intensity-binned
eachlevel_2d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: ['u', 'v']
max: 4
process:
name: 2d
params:
bins_args:
- -3.5
- 3.5
- 0.25
# nucleoli and heterochromatin excluded
euchromatin_0d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
mask_hc:
path: "results/segmentation/hc/{RoiUID}.ome.tif"
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: expand_hc
input: mask_hc
output: mask_hc_expanded
steps:
- func: mask_dilate_by_disk
params:
radius: 3
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_mask_remove
params:
_mask: mask_hc_expanded
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
process:
name: 0d
params:
euchromatin_1d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
mask_hc:
path: "results/segmentation/hc/{RoiUID}.ome.tif"
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: expand_hc
input: mask_hc
output: mask_hc_expanded
steps:
- func: mask_dilate_by_disk
params:
radius: 3
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_mask_remove
params:
_mask: mask_hc_expanded
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
process:
name: 1d
params:
bins_args:
- -3.5
- 3.5
- 0.25
euchromatin_2d:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
mask_hc:
path: "results/segmentation/hc/{RoiUID}.ome.tif"
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: expand_hc
input: mask_hc
output: mask_hc_expanded
steps:
- func: mask_dilate_by_disk
params:
radius: 3
- name: filter_piv
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_mask_remove
params:
_mask: mask_hc_expanded
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
process:
name: 2d
params:
bins_args:
- -3.5
- 3.5
- 0.25
# regular over all nucleoplasmic pixels, using fluctuation instead of
# raw displacement
normal_0d_fluctuation:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv_convert_to_fluctuation
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
- func: piv_to_fluctuation
params:
components: [ 'u', 'v' ]
process:
name: 0d
params:
# 1D intensity-binned, using fluctuation instead of raw displacement
eachlevel_1d_fluctuation:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv_convert_to_fluctuation
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: [ 'u', 'v' ]
max: 4
- func: piv_to_fluctuation
params:
components: [ 'u', 'v' ]
process:
name: 1d
params:
bins_args:
- -3.5
- 3.5
- 0.25
# 2D intensity-binned. using fluctuation instead of raw displacement
eachlevel_2d_fluctuation:
data: # relative to project dir
piv:
path:
type: piv
mask_nuc:
path:
type: mask
mask_np:
path:
type: mask
image:
path: "results/image_normalized/by_nucleus/multi_ch/{RoiUID}.ome.tif"
type: image
preprocess:
- name: blur_image
input: image
output: image_final
steps:
- func: image_blur
params:
sigma: 0.5
- name: shrink_nucleus
input: mask_nuc
output: mask_nuc_inner
steps:
- func: mask_erode_by_disk
params:
radius: 15
- name: filter_piv_convert_to_fluctuation
input: piv
output: piv_final
steps:
- func: piv_mask_filter
params:
_mask: mask_nuc_inner
- func: piv_mask_filter
params:
_mask: mask_np
- func: piv_global_filter
params:
components: ['u', 'v']
max: 4
- func: piv_to_fluctuation
params:
components: ['u', 'v']
process:
name: 2d
params:
bins_args:
- -3.5
- 3.5
- 0.25
# ----------------------------------------------------------------
# MSND post-analysis
#
# Make sure to also update configs for each of the protocol used
# in msnd block
# ----------------------------------------------------------------
msnd_post:
channel:
- miRFP670
- sfGFP
groupby:
normal_0d:
eachlevel_1d:
- channel
- level
eachlevel_2d:
normal_0d_fluctuation:
eachlevel_1d_fluctuation:
- channel
- level
eachlevel_2d_fluctuation:
euchromatin_0d:
euchromatin_1d:
- channel
- level
euchromatin_2d:
min_size:
normal_0d: 10
eachlevel_1d: 30
eachlevel_2d: 10
normal_0d_fluctuation: 10
eachlevel_1d_fluctuation: 30
eachlevel_2d_fluctuation: 10
euchromatin_0d: 10
euchromatin_1d: 30
euchromatin_2d: 10
min_npoints:
normal_0d: #leave blank
eachlevel_1d: 5
eachlevel_2d: 5
normal_0d_fluctuation: #leave blank
eachlevel_1d_fluctuation: 5
eachlevel_2d_fluctuation: 5
euchromatin_0d: #leave blank
euchromatin_1d: 5
euchromatin_2d: 5