1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| %%R require(ggplot2) require(SCENIC) require(SCopeLoomR) require(AUCell)
regulonAUC <- importAUCfromText('auc_mtx.tsv') regulonAUC <- regulonAUC[onlyNonDuplicatedExtended(rownames(regulonAUC)),] # cellInfo = SeuratObject@metadata regulonActivity_byCellType <- sapply(split(rownames(cellInfo), cellInfo$CellType), function(cells) rowMeans(getAUC(regulonAUC)[,cells])) regulonActivity_byCellType_Scaled <- t(scale(t(regulonActivity_byCellType), center = T, scale=T)) pheatmap::pheatmap(regulonActivity_byCellType_Scaled, #fontsize_row=3, color=colorRampPalette(c("blue","white","red"))(100), breaks=seq(-3, 3, length.out = 100), treeheight_row=10, treeheight_col=10, border_color=NA)
|