Search code examples
rimage-processingbioinformaticsspatstatcolocation

Spatstat Point Pattern Analysis for colocalization


I am trying to do some cololcaization analysis, i.e. I want to show if one cell type tends to show up closer to another different celltype significantly in a microsopy image.

I tried to do this with R spatstat package I was able to visualize my dataset:

enter image description here

mypattern is one kind of cell and mypattern2 ist another kind of cell. When u look at the L-plots you can see that there is some kind of clustering as the curve is deviating from poission.

I thought about using nearest neighbor apporoach which is the nncross function in spatstat. But how can I show now if this distance is random (two random point pattern) or significantly relevant? Does anyone has an idea? I saw a lot about simulations like Monte-Carlo but I have no idea how to begin coding...

I would be glad for any help!

Kind regards, Hashirama


Solution

  • The L function should not be used here because the data are highly inhomogeneous.

    I suggest you combine the two point patterns into a single "marked" point pattern,

    X <- superimpose(A=mypattern1, B=mypattern2)
    

    Then estimate the spatially-varying densities of points

    D <- density(split(X))
    plot(D)
    

    or the spatially varying proportions of each type of cell

     R <- relrisk(X)
     plot(R)
    

    You can also use segregation.test or a contingency table of nearest neighbours (dixon).

    See Chapter 14 of the spatstat book and the help files for relrisk, density.splitppp and segregation.test.