imputeEmbedding: Impute values using StabMap joint embedding

View source: R/imputeEmbedding.R

imputeEmbeddingR Documentation

Impute values using StabMap joint embedding

Description

Performs naive imputation of values from the list of mosaic data and joint embedding from StabMap.

Usage

imputeEmbedding(
  assay_list,
  embedding,
  reference = Reduce(union, lapply(assay_list, colnames)),
  query = Reduce(union, lapply(assay_list, colnames)),
  neighbours = 5,
  fun = mean
)

Arguments

assay_list

List of mosaic data from which to perform imputation.

embedding

Joint embedding from which to extract nearest neighbour relationships.

reference

Character vector of cell names to treat as reference cells.

query

Character vector of cell names to treat as query cells.

neighbours

Number of nearest neighbours to consider (default 5).

fun

function (default ‘mean') to aggregate nearest neighbours’ imputed values.

Value

List containing imputed values from each assay_list data matrix which contains reference cells.

Examples

set.seed(2021)
assay_list = mockMosaicData()
lapply(assay_list, dim)

# stabMap
out = stabMap(assay_list,
              ncomponentsReference = 20,
              ncomponentsSubset = 20)

# impute values
imp = imputeEmbedding(assay_list, out)

# inspect the imputed values
lapply(imp, dim)
imp[[1]][1:5,1:5]


MarioniLab/StabMap documentation built on Sept. 28, 2022, 2:28 a.m.