lisa {lisaClust} | R Documentation |
Generate local indicators of spatial association
lisa( cells, Rs = NULL, BPPARAM = BiocParallel::SerialParam(), window = "convex", window.length = NULL, whichParallel = "imageID", sigma = NULL, lisaFunc = "K", minLambda = 0.05, fast = TRUE )
cells |
A SegmentedCells or data frame that contains at least the variables x and y, giving the coordinates of each cell, and cellType. |
Rs |
A vector of the radii that the measures of association should be calculated. |
BPPARAM |
A BiocParallelParam object. |
window |
Should the window around the regions be 'square', 'convex' or 'concave'. |
window.length |
A tuning parameter for controlling the level of concavity when estimating concave windows. |
whichParallel |
Should the function use parallization on the imageID or the cellType. |
sigma |
A numeric variable used for scaling when filting inhomogeneous L-curves. |
lisaFunc |
Either "K" or "L" curve. |
minLambda |
Minimum value for density for scaling when fitting inhomogeneous L-curves. |
fast |
A logical describing whether to use a fast approximation of the inhomogeneous local L-curves. |
A matrix of LISA curves
library(spicyR) # Read in data as a SegmentedCells objects isletFile <- system.file("extdata","isletCells.txt.gz", package = "spicyR") cells <- read.table(isletFile, header=TRUE) cellExp <- SegmentedCells(cells, cellProfiler = TRUE) # Cluster cell types markers <- cellMarks(cellExp) kM <- kmeans(markers,8) cellType(cellExp) <- paste('cluster',kM$cluster, sep = '') # Generate LISA lisaCurves <- lisa(cellExp) # Cluster the LISA curves kM <- kmeans(lisaCurves,2) region(cellExp) <- paste('region',kM$cluster,sep = '_')