计算平均值时,使用的是 unloged data。也就是先对 data 进行 exp(x)-1 操作(R中就是 expm1函数),再取平均值 > exp(1) [1] 2.718282 > exp(1)-1 [1] 1.718282 > expm1(1) [1] 1.718282 手工计算比R包多了10倍时间: > system.time({ + dat1=AverageExpression(pbmc, group.by = "seurat_c...
```R seurat_object <- CreateSeuratObject(counts = data) result <- averageExpression(seurat_object) ``` `CreateSeuratObject`函数将数据转换为`seurat`对象,`averageExpression`函数计算每个基因的平均表达量。 《seurat包averageexpression方法》篇2 `seurat`包中的`averageExpression`方法用于计算表达矩阵中每一行的...
I've checked and this function gives the same result as Seurat's function. Here's some Rbenchmark on the pbmc3k dataset with some clusters: library(rbenchmark) benchmark("sparse" = { avg.sparse <- AverageExpression.Sparse(pbmc.divisive) }, "Seurat" = { avg.seurat <- suppressMessages(A...