lisa {spicyR} | R Documentation

## Generate local indicators of spatial association

### Description

Generate local indicators of spatial association

### Usage

    lisa(
      cells,
      Rs = NULL,
      BPPARAM = BiocParallel::SerialParam(),
      window = "square",
      window.length = NULL,
      whichParallel = "imageID"
    )

### Arguments

`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.

### Value

A matrix of LISA curves

### Examples

    # 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 = '_')

[Package spicyR version 0.99.13 Index]