File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed
Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,9 @@ function analyzeAll(obj, DatasetList)
297297 end
298298 [SMD ] = LD .genLocalizations();
299299
300+ % Filter out any localizations with nonzero imaginary standard errors.
301+ SMD = smi_helpers .Filters .filterImag(SMD , obj .Verbose );
302+
300303 % Keep track of why localizations were filtered out.
301304 obj.SMDPreThresh = smi_core .SingleMoleculeData .catSMD( ...
302305 obj .SMDPreThresh , LD .SMDPreThresh , false );
Original file line number Diff line number Diff line change 1818 SMD = filterFC(SMD , Verbose , nFC )
1919 SMD = filterNN(SMD , Verbose , n_NN , MedianMultiplier )
2020
21+ SMD = filterImag(SMD , Verbose )
22+
2123end % methods(Static)
2224
2325end % classdef Filters
Original file line number Diff line number Diff line change @@ -25,3 +25,5 @@ static methods:
2525 filter out localizations representing fewer than nFC frame connections
2626- ** [ filterNN] ( filterNN.m ) ** :
2727 localizations are filtered based on the nearest neighbor distance
28+ - ** [ filterImag] ( filterImag.m ) ** :
29+ filter out _ SE SMD fields with non-zero imaginary components
Original file line number Diff line number Diff line change 1+ function SMD = filterImag(SMD , Verbose )
2+ % filterImag: Filter out _SE SMD fields with non-zero imaginary components.
3+ %
4+ % INPUT:
5+ % SMD Single Molecule Data structure
6+ % Verbose verbosity flag [DEFAULT = false]
7+ %
8+ % OUTPUT:
9+ % SMD modified Single Molecule Data structure
10+
11+ % Created by
12+ % Michael J. Wester (5/23/2025)
13+
14+ if ~exist(' Verbose' , ' var' )
15+ Verbose = false ;
16+ end
17+
18+ n_prefilter = numel(SMD .X );
19+
20+ % Find SMD fields that contain an SE in their name.
21+ f = fields(SMD );
22+ SE = f(contains(f , ' _SE' ));
23+ % Eliminate fields that do not contain n_prefilter elements.
24+ inuse = arrayfun(@(i ) numel(SMD.(SE{i })) == n_prefilter , 1 : numel(SE ));
25+ SEinuse = SE(inuse );
26+
27+ % Check the fields for nonzero imaginary values.
28+ complex = [];
29+ for i = 1 : numel(SEinuse )
30+ complex = union(complex , find(imag(SMD.(SE{i })) ~= 0 ));
31+ end
32+
33+ noncomplex = setdiff(1 : n_prefilter , complex );
34+ SMD = smi_core .SingleMoleculeData .isolateSubSMD(SMD , noncomplex );
35+
36+ if Verbose >= 2 && numel(SMD .X ) ~= n_prefilter
37+ fprintf(' Complex standard errors removed = %d out of %d\n ' , ...
38+ n_prefilter - numel(SMD .X ), n_prefilter );
39+ end
40+
41+ end
You can’t perform that action at this time.
0 commit comments