locStructure | R Documentation |
locStructure
locStructure(
sce,
group,
dim_combined,
k = 100,
dim_red = "PCA",
assay_name = "logcounts",
n_dim = 10,
n_combined = 10,
res_name = NULL
)
sce |
|
group |
Character. Name of group/batch variable.
Needs to be one of |
dim_combined |
Charactyer. Name of the reduced dimensional
representation of the integrated data.
Needs to be one of |
k |
Numeric. Number of k-nearest neighbours (knn) to use. |
dim_red |
Character. Name of embeddings to calculate neighbourhoods before integration. Default is "PCA". |
assay_name |
Character. Name of the assay to use for PCA of the original (not integrated) data. Should not refer to "corrected" counts. |
n_dim |
Numeric. Number of dimensions to include for the original data. |
n_combined |
Numeric. Number of dimensions to include for the integrated data. |
res_name |
Character. Appendix of the result score's name (e.g. method used to combine batches). |
The locStructure function implements the localStructure function
from Seurat (See LocalStruct
. For each group it
calculates the k nearest neighbour within PCA space before integration and
compares it to the knn within the reduced dimensional representation after
integration. The score represents the proportion of overlapping neighbours.
The LocalStruct
function is based on the
RunPCA
function, while here runPCA
is used. This can cause small deviance from the
LocalStruct
function, but overall these functions are
equivalent.
A SingleCellExperiment
with the mixing metric within colData.
Stuart T Butler A Hoffman P Hafemeister C Papalexi E et. al. (2019) Comprehensive Integration of Single-Cell Data. Cell.
library(SingleCellExperiment)
sim_list <- readRDS(system.file("extdata/sim50.rds", package = "CellMixS"))
sce <- sim_list[["batch20"]][, c(1:50, 300:350)]
sce <- locStructure(sce, "batch", "MNN", k = 20, assay_name = "counts")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.