[Python] Adjusting Radial Distribution Function (RDF) for Inhomogeneous Multi-Type Point...

Discussão em 'Python' iniciado por Stack, Junho 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working with large-scale 3D spatial transcriptomics data — essentially a multitype point pattern with ~100 million points, each defined by an (x, y, z) coordinate and a categorical gene label (i.e., mark). My aim is to use the Radial Distribution Function (RDF) to characterize pairwise spatial relationships between different gene types across the sample.

    I'm currently using the freud Python library to compute the RDF across all pairs of gene types. However, the spatial distribution of points is clearly inhomogeneous due to underlying tissue architecture — with higher densities in some regions and sparse areas elsewhere. This violates the stationarity assumptions underlying standard RDF/PCF calculations and likely biases the results, especially at short distances.

    In the 2D case, the pcfcross.inhom() function in the spatstat R package offers a good solution by correcting for inhomogeneity via local intensity estimates. Unfortunately, given the size of my dataset, performance suffers dramatically (hence my shift to using the freud package)

    Question

    Is there a principled way to adjust the RDF calculation in freud (or an alternative library optimised for massive point pattern/particle datasets) to account for inhomogeneity in 3D spatial point patterns?

    Would computing and dividing by the product of local densities at each pair of points be a viable adaptation?

    I'd appreciate any suggestions on methods, libraries, or scalable approximations others have used for inhomogeneous point process modeling in 3D, especially in computational biology or particle simulation.

    Continue reading...

Compartilhe esta Página