Quantitative analysis is an important part of any single-molecule localization microscopy (SMLM) data analysis workflow to extract biological insights from the coordinates of the single fluorophores, but current approaches are restricted to simple geometries or do not work on heterogenous structures.
Here, we present LocMoFit (Localization Model Fit), an open-source framework to fit an arbitrary model directly to the localization coordinates in SMLM data. Using maximum likelihood estimation, this tool extracts the most likely parameters for a given model that best describe the data, and can select the most likely model from alternative models. We demonstrate the versatility of LocMoFit by measuring precise dimensions of the nuclear pore complex and microtubules. We also use LocMoFit to assemble static and dynamic multi-color protein density maps from thousands of snapshots. In case an underlying geometry cannot be postulated, LocMoFit can perform single-particle averaging of super-resolution structures without any assumption about geometry or symmetry. We provide extensive simulation and visualization routines to validate the robustness of LocMoFit and tutorials based on example data to enable any user to increase the information content they can extract from their SMLM data.