Runnable code:
library(cola)
process_counts = function(data, column = NULL) {
mat = assays(data)$counts
mat = as.matrix(mat)
s = colSums(mat)
fa = s/mean(s)
for(i in 1:ncol(mat)) mat[, i]/fa[i]
mat = adjust_matrix(log2(mat + 1))
anno = NULL
if(!is.null(column)) {
anno = colData(data)
anno = as.data.frame(anno)
anno = anno[, column, drop = FALSE]
}
list(mat = mat, anno = anno)
}
library(scRNAseq)
data = NestorowaHSCData()
lt = process_counts(data)
rh = hierarchical_partition(lt$mat, subset = 500, cores = 4)
saveRDS(rh, file = "NestorowaHSC_cola_rh.rds")
cola_report(rh, output = "NestorowaHSC_cola_rh_report", title = "cola Report for Hierarchical Partitioning - 'NestorowaHSC'")
The HTML report is here. (generated by cola version 2.0.0, R 4.1.0.)