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 run time, not converging.
ligerex <- optimizeALS(ligerex, k = 5, max.iters = 1)
# Preparing subset with random sampling.
# Subset can also be obtained with prior knowledge from metadata.
cell_names_1 <- sample(rownames(ligerex@H[[1]]), 20)
cell_names_2 <- sample(rownames(ligerex@H[[2]]), 20)
ligerex2 <- optimizeSubset(ligerex, cell.subset = list(cell_names_1, cell_names_2),
max.iters = 1)
# }
Run the code above in your browser using DataLab