Question of validity of using sections data as a representation of real tissue statistical properties. This validity is discussed and it is believed that 2D projections of the tissues do not provide with the accurate spatial distribution patterns
The aim of this pipeline is to compare spatial metrics both on true spatial data and on 2D sections, also to elaborate the method how to overcome the bias derived from two-dimensional sampling
Pair-correlation function
Given that space is isotropic let suggest that probability of observing a point around location x is
Let
Layers of spheres get more diffuse, so for large distances, the probability of finding two spheres with a given separation is essentially constant > a more dense system has more spheres, this it's more likely to find two of them with a given distance
The PC function accounts for these factors by normalizing by the density; this at large values of r it goes to 1, uniform probability
- Pick a value of
dr
- Loop over all values of r
- Count all particles that are a distance between
r
andr+dr
away from the particle you're considering - Divide your total count by N > average local density
- Divide this number by
$4\pi r^2dr$ (volume of the spherical shell) - Divide this by the particle number density
$\rho$ - ensures that$g(r)=1$
- Count all particles that are a distance between
For 2D volume correction will be just
Pipeline: reshape
> express
> cluster
> choose
> slices
> main
(dependent of slices
)
reshape.py
- takes stacks of images corresponding to the certain cell markers and cell masks ~ clusterization. This script creates cell datasets with coordinatescell_coordinates.csv
and with intensities of certain cell markers -cell_intensities.csv
express.r
- creates expression matrices, both rawexpression_annotated.csv
and correctedexpression_annotated_corrected.csv
with compensation matrixcompensationMatrix.csv
cluster.py
- performs clusterization and manual annotation of expression matrixexpression_annotated_corrected.csv
. Makes various plots for analysischoose.py
- selects cell cluster obtain in the previous script >cell_coordinates_clusters.csv
module.r
- contains function to perform random sections based on the 3d datasetcell_coordinates
. Compute Pair-correlation function for each of the slicesslice.r
- visualize both pcf of 3d initial dataset and of its 2d slices