-
Notifications
You must be signed in to change notification settings - Fork 8
/
example_commented.yaml
107 lines (86 loc) · 5.97 KB
/
example_commented.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
### This file details all existing Sopa parameters
###
### Most of these parameters are optional: don't hesitate to delete those that doesn't interest you
###
### Before creating your own config, you should check if there is not already an existing
### config that works for you, see https://github.com/gustaveroussy/sopa/tree/master/workflow/config
read:
technology: merscope # name of the machine, e.g. xenium/merscope/cosmx/phenocycler/macsima/hyperion
patchify:
# [only if running cellpose]
patch_width_pixel: 1000 # advice: 100 * cellpose diameter
patch_overlap_pixel: 40 # advice: 2 * cellpose diameter
# [only if running baysor]
patch_width_microns: 4000
patch_overlap_microns: 30
segmentation:
# [only if running cellpose]
cellpose:
diameter: 55 # [important parameter] typical size of a cell, in pixels. This depends on the technology resolution (see our config files per technology: https://github.com/gustaveroussy/sopa/tree/master/workflow/config)
channels: ["DAPI"] # list of one or two channel(s) used for segmentation. If two channels, provide a nuclear staining, and then a cytoplasm staining
flow_threshold: 2 # see cellpose parameters
cellprob_threshold: -6 # see cellpose parameters
model_type: "cyto3" # [optional] name of the cellpose model to be used. If you have a custom model, use the "pretrained_model" argument instead, and give the path to your model
min_area: 1000 # [optional] minimum area (in pixels^2) for a cell to not be filtered
clip_limit: 0.2 # [optional] value used to increase the contrast of the image. 0 means no change, 1 means high contrast change (see skimage.exposure.equalize_adapthist).
gaussian_sigma: 1 # [optional] sigma used for gaussian smoothing. This can improve segmentation for highly-pixelated images
# [only if running baysor]
baysor:
min_area: 20 # [optional] minimum area (in microns^2) for a cell to not be filtered
cell_key: cell_id # [optional] if prior segmentation has been performed, this is the column in the transcript dataframe that indicated the cell that contains the transcript. This doesn't need to be provided if you run cellpose with Sopa.
unassigned_value: -1 # [optional] if prior segmentation has been performed and if 'cell_key' above is provided, this is the value given to transcript that is not contained inside any cell
config: # [this is the baysor config, as in https://github.com/kharchenkolab/Baysor]
data:
exclude_genes: "Blank*" # genes excluded from the Baysor segmentation
force_2d: true # if false, uses 3D mode
min_molecules_per_cell: 10
gene: "gene" # name of the column of the transcript dataframe indicating the genes names
min_molecules_per_gene: 0
min_molecules_per_segment: 8
confidence_nn_id: 16
# [important] do not update x/y/z below, since these names are standardized with SpatialData
x: "x"
y: "y"
z: "z"
segmentation:
scale: 6.25 # [important parameter] typical cell radius in microns
scale_std: "25%" # cell radius standard deviation
prior_segmentation_confidence: 0.5 # confidence of the cellpose confidence (float in [0, 1])
estimate_scale_from_centers: false
n_clusters: 4
iters: 500
n_cells_init: 0
nuclei_genes: ""
cyto_genes: ""
new_component_weight: 0.2
new_component_fraction: 0.3
aggregate:
average_intensities: true # [optional] whether to compute, for each cell, the mean intensity per staining/channel
min_intensity_ratio: 0.1 # [optional] cells whose mean channel intensity is less than `min_intensity_ratio * quantile_90` will be filtered
expand_radius_ratio: 0.1 # [optional] cells polygons will be expanded by `expand_radius_ratio * mean_radius` for channels averaging **only**. This help better aggregate boundary stainings
gene_column: "gene" # [optional, not-needed if not using baysor] name of the column of the transcript dataframe indicating the genes names. Used to count transcripts inside cells.
min_transcripts: 5 # [optional] cells whose transcript count is below that this threshold are filtered
# [optional] if annotation is desired, choose either 'tangram' or 'fluorescence'. If 'fluorescence' is used, make sure 'average_intensities' is true (see parameter above)
annotation:
# [only if you choose transcript-based annotation with Tangram]
method: tangram
args:
sc_reference_path: /path/to/reference_annotated.h5ad # path to the annotated scRNAseq reference used by Tangram
cell_type_key: ct # key of adata_ref.obs containing the cell-type annotation
reference_preprocessing: log1p # if your reference `adata.X` contains raw counts, then remove this parameter from the config. Else, choose "log1p" (if you have already run both `sc.pp.normalize_total` and `sc.pp.log1p` on your reference) or "normalized" (if you have already run `sc.pp.normalize_total` on your reference)
# [only if you choose the simple staining-based annotation (comment out the lines below)]
# method: fluorescence
# args:
# marker_cell_dict: # mapping between a channel name and a population name
# CK: Tumoral cell
# CD3: T cell
# CD31: Endothelial
# FAP: Fibroblast
# CD68: Macrophage
# CD20: B cell
explorer: # parameters related to the conversion to the Xenium Explorer (Sopa's visualizer)
gene_column: "gene" # [optional] name of the column of the transcript dataframe indicating the genes names. Provide this if you want to see transcripts on the explorer
ram_threshold_gb: 4 # [optional] images below this RAM threshold will be loaded in memory during conversion. It can accelerate image writing
pixel_size: 0.2125 # [optional] this is the number of microns in a pixel for the technology used (see the config of your technology of interest)
executables:
baysor: ~/.julia/bin/baysor # [optional] if you run baysor, write here the path to the 'baysor' executable