ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
ligerex <- normalize(ligerex)
ligerex <- selectGenes(ligerex)
ligerex <- scaleNotCenter(ligerex)
# \donttest{
# Assume we are performing the factorization
# Specification for minimal example test time, not converging
ligerex <- optimizeALS(ligerex, k = 5, max.iters = 1)
# Suppose we have new data, namingly Y_new and Z_new from the same cell type.
# Add it to existing datasets.
new_data <- list(Y_set = ctrl, Z_set = stim)
# 2 iters do not lead to converge, it's for minimal test time
ligerex2 <- optimizeNewData(ligerex, new.data = new_data,
which.datasets = list('ctrl', 'stim'),
max.iters = 1)
# acquire new data from different cell type (X), we'll just add another dataset
# it's probably most similar to ctrl
X <- ctrl
# 2 iters do not lead to converge, it's for minimal test time
ligerex3 <- optimizeNewData(ligerex, new.data = list(x_set = X),
which.datasets = list('ctrl'),
add.to.existing = FALSE,
max.iters = 1)
# }
Run the code above in your browser using DataLab