-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeDefaultOptions.m
More file actions
154 lines (98 loc) · 5.29 KB
/
makeDefaultOptions.m
File metadata and controls
154 lines (98 loc) · 5.29 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
function options = makeDefaultOptions(options)
%smoothSigma -> standard dev. of gaussian with which to smooth data,
% use -1 to have no smoothing (default = 5)
%sigmaThreshold -> # of standard deviations above zero required for
% peaks (default = 2)
%diffThreshold -> half-width of peak window (default = 150)
%noiseLevel -> noise level (default = .005)
%template_pca_dimension -> # of modes in clustering PCA (default = 50)
%first_mode -> first mode in the PCA to uselikelihood model (default = 5)
%k -> number of clusters in kmeans (default = 12)
%maxNumPeaks -> maximum # of peaks to use in clustering (default = 10000);
%kmean_replicates -> # of replicates in kmeans (default = 5)
%kmeans_maxIter -> max # of iterations for kmeans (default = 1000)
%fs = sampling frequency of original data
%baseline_quantile = quantile of noise data to take as baseline value.
% If set less than or equal to zero, there will be no
% baseline (default = .9)
%min_template_size = minimum # of peaks in a template (default = 50)
%baseline_threshold = likelihood threshold for baseline (default = 0)
%use_likelihood_threshold = logical to use baseline threshold or not (default = false)
smoothSigma_default = 3;
sigmaThreshold_default = 2;
diffThreshold_default = 150;
noiseLevel_default = -1;
first_mode_default = 2;
template_pca_dimension_default = 50;
k_default = 12;
maxNumPeaks_default = 10000;
kmeans_replicates_default = 5;
kmeans_maxIter_default = 1000;
fs_default = 1e4;
baseline_quantile_default = .9;
min_template_size_default = 50;
baseline_threshold_default = 0;
use_likelihood_threshold_default = false;
if options.setAll
options.smoothSigma = smoothSigma_default;
options.sigmaThreshold = sigmaThreshold_default;
options.diffThreshold = diffThreshold_default;
options.noiseLevel = noiseLevel_default;
options.first_mode = first_mode_default;
options.k = k_default;
options.maxNumPeaks = maxNumPeaks_default;
options.kmeans_replicates = kmeans_replicates_default;
options.template_pca_dimension = template_pca_dimension_default;
options.kmeans_maxIter = kmeans_maxIter_default;
options.fs = fs_default;
options.baseline_quantile = baseline_quantile_default;
options.min_template_size = min_template_size_default;
options.baseline_threshold = baseline_threshold_default;
options.use_likelihood_threshold = use_likelihood_threshold_default;
else
if ~isfield(options,'smoothSigma') || isempty(options.smoothSigma)
options.smoothSigma = smoothSigma_default;
end
if ~isfield(options,'sigmaThreshold') || isempty(options.sigmaThreshold)
options.sigmaThreshold = sigmaThreshold_default;
end
if ~isfield(options,'diffThreshold') || isempty(options.diffThreshold)
options.diffThreshold = diffThreshold_default;
end
if ~isfield(options,'noiseLevel') || isempty(options.noiseLevel)
options.noiseLevel = noiseLevel_default;
end
if ~isfield(options,'first_mode') || isempty(options.first_mode)
options.first_mode = first_mode_default;
end
if ~isfield(options,'k') || isempty(options.k)
options.k = k_default;
end
if ~isfield(options,'maxNumPeaks') || isempty(options.maxNumPeaks)
options.maxNumPeaks = maxNumPeaks_default;
end
if ~isfield(options,'kmeans_replicates') || isempty(options.kmeans_replicates)
options.kmeans_replicates = kmeans_replicates_default;
end
if ~isfield(options,'template_pca_dimension') || isempty(options.template_pca_dimension)
options.template_pca_dimension = template_pca_dimension_default;
end
if ~isfield(options,'kmeans_maxIter') || isempty(options.kmeans_maxIter)
options.kmeans_maxIter = kmeans_maxIter_default;
end
if ~isfield(options,'fs') || isempty(options.fs)
options.fs = fs_default;
end
if ~isfield(options,'baseline_quantile') || isempty(options.baseline_quantile)
options.baseline_quantile = baseline_quantile_default;
end
if ~isfield(options,'min_template_size') || isempty(options.min_template_size)
options.min_template_size = min_template_size_default;
end
if ~isfield(options,'baseline_threshold') || isempty(options.baseline_threshold)
options.baseline_threshold = baseline_threshold_default;
end
if ~isfield(options,'use_likelihood_threshold') || isempty(options.use_likelihood_threshold)
options.use_likelihood_threshold = use_likelihood_threshold_default;
end
end