  Cryo-electron tomography (cryo-ET) is uniquely suited to precisely localize
macromolecular complexes in situ, that is in a close-to-native state within
their cellular compartments, in three-dimensions at high resolution. Point
pattern analysis (PPA) allows quantitative characterization of the spatial
organization of particles. However, current implementations of PPA functions
are not suitable for applications to cryo-ET data because they do not consider
the real, typically irregular 3D shape of cellular compartments and molecular
complexes. Here, we designed and implemented first and the second-order, uni-
and bivariate PPA functions in a Python package for statistical spatial
analysis of particles located in three dimensional regions of arbitrary shape,
such as those encountered in cellular cryo-ET imaging (PyOrg).
  To validate the implemented functions, we applied them to specially designed
synthetic datasets. This allowed us to find the algorithmic solutions that
provide the best accuracy and computational performance, and to evaluate the
precision of the implemented functions. Applications to experimental data
showed that despite the higher computational demand, the use of the
second-order functions is advantageous to the first-order ones, because they
allow characterization of the particle organization and statistical inference
over a range of distance scales, as well as the comparative analysis between
experimental groups comprising multiple tomograms.
  Altogether, PyOrg is a versatile, precise, and efficient open-source software
for reliable quantitative characterization of macromolecular organization
within cellular compartments imaged in situ by cryo-ET, as well as to other 3D
imaging systems where real-size particles are located within regions possessing
complex geometry.
