RelabelMetaclusters {FlowSOM} | R Documentation |
Adapt the metacluster levels. Can be used to either give them new names, or potentially merge some metaclusters.
RelabelMetaclusters(fsom, labels)
fsom |
Result of calling the FlowSOM function |
labels |
Named vector, with the names the original metacluster names and the values the replacement |
Updated FlowSOM object
fileName <- system.file("extdata", "68983.fcs", package = "FlowSOM") ff <- flowCore::read.FCS(fileName) ff <- flowCore::compensate(ff, flowCore::keyword(ff)[["SPILL"]]) ff <- flowCore::transform(ff, flowCore::transformList(colnames(flowCore::keyword(ff)[["SPILL"]]), flowCore::logicleTransform())) flowSOM.res <- FlowSOM(ff, scale = TRUE, colsToUse = c(9, 12, 14:18), nClus = 10, seed = 1) PlotStars(flowSOM.res, backgroundValues = flowSOM.res$metaclustering) GetCounts(flowSOM.res) # Include MC9 in MC8 flowSOM.res <- RelabelMetaclusters(flowSOM.res, c("9" = "8")) PlotStars(flowSOM.res, backgroundValues = flowSOM.res$metaclustering) GetCounts(flowSOM.res) # Give different names flowSOM.res <- RelabelMetaclusters(flowSOM.res, c("1" = "1: CD8+", "7" = "7: gd+", "8" = "8: CD19+")) PlotStars(flowSOM.res, backgroundValues = flowSOM.res$metaclustering) PlotNumbers(flowSOM.res, level = "metaclusters") GetCounts(flowSOM.res)