-
Notifications
You must be signed in to change notification settings - Fork 7
/
loadParameters.m.template
242 lines (193 loc) · 9.46 KB
/
loadParameters.m.template
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
params.FILE_BASENAME = 'simseqtest1';
% Data loading a storage parameteres
params.deconvolutionImagesDir = '../simseq/simseqtest1/1_deconvolution';
params.colorCorrectionImagesDir = '../simseq/simseqtest1/2_color-correction';
params.normalizedImagesDir = '../simseq/simseqtest1/3_normalization';
params.registeredImagesDir = '../simseq/simseqtest1/4_registration';
params.punctaSubvolumeDir = '../simseq/simseqtest1/5_puncta-extraction';
params.basecallingResultsDir = '../simseq/simseqtest1/6_base-calling';
params.reportingDir = '../simseq/simseqtest1/logs/imgs';
params.logDir = '../simseq/simseqtest1/logs';
% Microscope parameters
params.XRES = .17;
params.YRES = .17;
params.ZRES = .4;
% Which round will be the reference for the warping?
params.REFERENCE_ROUND_WARP = 2;
%How many rounds of images need to be processed?
params.NUM_ROUNDS = 4;
%When aligning against a library, which rounds in the ground truth are we
%matching to?
params.ALIGNMENT_ROUNDS = 1:params.NUM_ROUNDS;
% Does your experiment contain a round that contains a morphological signal
% that you would like to be included for later analysis? If so, uncomment
% this line. If your experiment does *not* have a morphological component,
% leave this uncommented
% params.MORPHOLOGY_ROUND = 1;
% params.MORPHOLOGY_CHAN_STR = 'ch04';
% base calling parameters
% we include groundtruth_visualcortex_tutorial.mat in the tutorial
% directory as an example
params.GROUND_TRUTH_DICT = 'groundtruth_visualcortex_tutorial.mat';
params.ISILLUMINA = true; %we used two sequencing chemistries, illumina is now the standard
% Used for color correction
% Assuming beads are at the top of the stack, when do they start?
params.BEAD_ZSTART = 1; %goes to :end
% What is the buffer from the edge of the image we use when calculating the color shift?
params.COLOR_OFFSETS3D = [20,20,20];
% To avoid errors, or if we don't expect much color drift, we can manually set a max magnitude
params.COLOR_CORRECT_CLAMP = [4,4,4];
% What is the minimum size of a puncta (in voxels) to be considered?
params.PUNCTA_SIZE_THRESHOLD = 30;
% What is the maximum size?
params.PUNCTA_SIZE_MAX = 2000;
params.PUNCTARADIUS_BGESTIMATE = 5;
% Defines the cubic region around each puncta
params.PUNCTA_SIZE = 10; %Not a critical parameter, could be deprecated soon
params.CHAN_STRS = {'ch00','ch01','ch02','ch03'};
params.NUM_CHANNELS = length(params.CHAN_STRS);
params.SHIFT_CHAN_STRS = {'ch00','ch01SHIFT','ch02SHIFT','ch03SHIFT'};
%What is the color channel we will load from the registration outputs?
%TODO: Need to explain this more. I believe this is normally summedNorm
params.PUNCTA_CHANNEL_SEG = 'summedNorm';
%Base calling parameters
params.COLOR_VEC = [1,2,3,4]; %Which channels are we comparing? (in case of empty chan)
params.DISTANCE_FROM_CENTER = 2.5; %how far from the center of the puncta subvol?
params.THRESHOLD_EXPRESSION = 15; %If a transcript shows up fewer than this it's probably noise
params.BASECALLING_MAXHAMMING = 2; %What is the max allowable mismatch?
params.BASECALLING_PERFORMWHITENING = false; %Do we attempt to remove correlation in channels?
%Do we need to downsample the first few steps of the pipeline?
params.DO_DOWNSAMPLE = true;
params.DOWNSAMPLE_RATE = 4.;
%If the channel data come from very different distributions, applying a quantile Norm
%can be useful when combining channel information for the registration. However,
%it is highly memory and time intensive, using any other paramter but 'quantile' will
%simply sum the channels in the normalization step, and this can reduce comptuation time
%by 20-50%!
params.NORMALIZE_METHOD = 'linear';% 'linear' or 'quantile';
%If you re-run the same script, should it overwrite results?
%Currently this is only implemented for the puncta-extraction and base-calling steps
params.OVERWRITE_PREV_RESULTS = true;
% For puncta extraction:
% How many rounds do we allow there to be no data in? "missing" in this case
% means pixel values = 0, which only happens in the case of registered image warps
% leaving empty areas on the edges (depending on the magnitude of the translation etc.)
params.MAXNUM_MISSINGROUND=2;
% For basecalling, do we do an additional filtering step?
% This can be helpful to define a function that removes artifacts in the data.
% If you define uncomment the line before the stage_base-calling will call whatever script
% you define after the @ sign
%params.BASECALLING_FILTERINGFUNCTION = @filter_HTAPP917;
%Do we expect artifacts in the data? If so, uncomment and set the values here
%params.BASECALLING_ARTIFACT_THRESH = [3000,4000,9000,1500];
params.BASECALLING_SIG_THRESH = 90; %which percentile do we take from the puncta to call the base
%use GPU CUDA or CPU
params.USE_GPU_CUDA = false;
%intermediate image format, 'tif' of 'h5' are supported
params.IMAGE_EXT = 'h5';
%input image format, 'tif' of 'h5' are supported
params.INPUT_IMAGE_EXT = 'h5';
%Use intermediate tmp files in color-correction and normalization
params.tempDir = '/mp/nvmeof0/tmp';
%If the background is high for the particular sample, this will perform a background substraction step to discover the puncta and extract pixel values
params.PUNCTAEXTRACT_DOBGSUBTRACT = false;
%----- define registration params ----%
% These are specific just to the regisration step
% Define parameters for registration, titled regparams for clarity
% by old convention, 'registered' refers to the thin plate spline registration
% 'affine' refers to the simpler linear transform
regparams.REGISTRATION_TYPE = 'affine';%'registered' or 'affine'
%When calculating RANSAC, do we consider all possible affine warps (true)
%Or just translation+scale (false)
regparams.AFFINE_FULL = true;
%Do we want to combine features from multiple channels?
%keypoints and descriptors
%NOTE: b
regparams.REGISTERCHANNELS_SIFT = {'summedNorm'}; %keypoints and descriptors
%keypoints only
%Note: ShapeContext is an additional description method that can be used for
% tricky registrations. However, it is currently deprecated, just keep this {}
% -Dan G. 2020-09-09
regparams.REGISTERCHANNELS_SC = {};
%In the Murray et al 2015 this was {'Lectin', 'DAPI', 'Data}
%Which channels do we warp?
regparams.CHANNELS = {'ch00','ch01SHIFT','ch02SHIFT','ch03SHIFT','summedNorm'};
%Ideally this is at least 20, but the bare minimum to solve the affine tform is 6
regparams.NCORRESPONDENCES_MIN = 20;
%Set a threshold for maximum displacement distance?
%(not appropriate for all datasets. Distance in pixels, -1 for ignore this)
regparams.DISTANCEQUANTILECUTOFF = .95;
% SCALE_PYRAMID: Create a set of blurs to create a "scale pyramid", or in
% non-computervision speak:
% Blurring by a progressive set of gaussians to adjust for puncta flucutations
% Using the documentation in fspecial3.m, the standard deviations of
% the gaussian is defined as SIZE/2/2.354 so that FWHM equals half filter
% size (http://en.wikipedia.org/wiki/FWHM).The blur_size values are chosen
% with assumptions of the width of the Lectin vessels
% (5-20 pixels at 2um/pix res) observed and assumption of minor scale
% disparities (ie <20%)
params.SCALE_PYRAMID = [4];
% parameters for 3DSIFT
sift_params.TwoPeak_Flag = true; % Allow 3DSIFT to throw out points, Default: true
sift_params.TwoPeak_Thresh = .9; % Allow 3DSIFT to throw out points, Default: true
sift_params.IndexSize = 2; % Min: 1 Default: 2
sift_params.xyScale = 1;
sift_params.tScale = 1;
sift_params.Display_flag = 0; % Display a sphere which can be rotated (Rotate 3D button) to view gradient directions
sift_params.Tessellation_flag = 1; % Keep this as 1
sift_params.Tessellation_levels = 1; % Min: zero Default: 1
sift_params.Tessel_thresh = 3; % take the top nearest tesselations in GetGradOri / PlaceInIndex
sift_params.nFaces = 20 * ( 4 ^ sift_params.Tessellation_levels ); % Number of faces in the tessellation, not a parameter
sift_params.descriptor_len = sift_params.IndexSize *...
sift_params.IndexSize * sift_params.IndexSize * sift_params.nFaces;
sift_params.Smooth_Flag = true; % Adds gradient data to surrounding bins in final histogram
sift_params.Smooth_Var = 20; % Determines amount of smoothing, Default: 20
sift_params.MaxIndexVal = 0.2;
% The rest of the variables are not modified often, but are included here
% for completeness sake
sift_params.IgnoreGradSign = 0;
sift_params.IndexSigma = 5.0;
sift_params.SigmaScaled = sift_params.IndexSigma * 0.5 * sift_params.IndexSize;
sift_params.MagFactor = 3;
sift_params.UseHistogramOri = 1;
sift_params.OriHistThresh = 0.8;
if (sift_params.UseHistogramOri)
sift_params.OriSigma = 1.5;
else
sift_params.OriSigma = 1.0;
end
sift_params.stream_num = 20;
sift_params.x_substream_stride = 256;
sift_params.y_substream_stride = 256;
%batch_processing parameters
params.WAIT_SEC = 10;
params.JOB_MAXTIME = 3600; %Any job should not take more than an hour
params.USABLE_MEM_RATE = 0.9;
params.MATLAB_PROC_CONTEXT = 800; %MiB
params.DOWN_SAMPLING_MAX_POOL_SIZE = 4;
%
%params.COLOR_CORRECTION_MAX_RUN_JOBS = 2;
params.COLOR_CORRECTION_MAX_THREADS = 10;
%
params.NORM_MAX_RUN_JOBS = 20;
params.NORM_DOWNSAMPLE_MAX_RUN_JOBS = 20;
%
params.CALC_DESC_MAX_RUN_JOBS = 30;
params.CALC_DESC_MAX_THREADS = 4;
%
params.CALC_CORR_MAX_RUN_JOBS = 1;
params.CALC_CORR_MAX_THREADS = 10;
%
params.REG_CORR_MAX_RUN_JOBS = 8;
params.REG_CORR_MAX_THREADS = 10;
%
params.AFFINE_MAX_RUN_JOBS = 8;
params.AFFINE_MAX_POOL_SIZE = 5;
params.AFFINE_MAX_THREADS = 10;
%
%params.TPS3DWARP_MAX_RUN_JOBS = 4;
%params.TPS3DWARP_MAX_POOL_SIZE = 10;
params.TPS3DWARP_MAX_THREADS = 10;
params.PUNCTA_MAX_POOL_SIZE = 1;
%cluster environment
params.NUM_LOGICAL_CORES = 40;