Calculates a metric that describes how well the local structure of each group prior to integration is preserved after integration. This procedure works as follows: For each group, compute a PCA, compute the top num.neighbors in pca space, compute the top num.neighbors in corrected pca space, compute the size of the intersection of those two sets of neighbors. Return the average over all groups.

LocalStruct(
object,
grouping.var,
idents = NULL,
neighbors = 100,
reduction = "pca",
reduced.dims = 1:10,
orig.dims = 1:10,
verbose = TRUE
)

## Arguments

object

Seurat object

grouping.var

Grouping variable

idents

Optionally specify a set of idents to compute metric for

neighbors

Number of neighbors to compute in pca/corrected pca space

reduction

Dimensional reduction to use for corrected space

reduced.dims

Number of reduced dimensions to use

orig.dims

Number of PCs to use in original space

verbose

Display progress bar

## Value

Returns the average preservation metric