lisa {spicyR} | R Documentation |
Generate local indicators of spatial association
lisa( cells, Rs = NULL, BPPARAM = BiocParallel::SerialParam(), window = "square", window.length = NULL, whichParallel = "imageID", sigma = NULL )
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 fiting inhomogeneous L-curves |
A matrix of LISA curves
# 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 = '_')