# NOT RUN {
# Given preprocessed liger object: ligerex (contains two datasets Y and Z)
# get factorization using three restarts and 20 factors
ligerex <- optimizeALS(ligerex, k = 20, lambda = 5, nrep = 3)
# acquire new data (Y_new, Z_new) from the same cell type, let's add it to existing datasets
new_data <- list(Y_set = Y_new, Z_set = Z_new)
ligerex2 <- optimizeNewData(ligerex, new.data = new_data, which.datasets = list('y_set', 'z_set'))
# acquire new data from different cell type (X), we'll just add another dataset
# it's probably most similar to y_set
ligerex <- optimizeNewData(ligerex, new.data = list(x_set = X), which.datasets = list('y_set'),
add.to.existing = FALSE)
# }
Run the code above in your browser using DataLab