Learn R Programming

FlowSOM (version 1.0.0)

FlowSOMSubset: FlowSOM subset

Description

Take a subset from a FlowSOM object

Usage

FlowSOMSubset(fsom,ids)

Arguments

fsom
FlowSOM object, as generated by BuildMST
ids
Array containing the ids to keep

Value

but with the same grid

See Also

BuildMST

Examples

Run this code
    # Read two files (Artificially, as we just split 1 file in 2 subsets)
    fileName <- system.file("extdata","lymphocytes.fcs",package="FlowSOM")
    ff1 <- read.FCS(fileName)[1:1000,]
    ff1@description$FIL <- "File1"
    ff2 <- read.FCS(fileName)[1001:2000,]
    ff2@description$FIL <- "File2"
    
    flowSOM.res <- FlowSOM(flowSet(c(ff1,ff2)), compensate=TRUE,transform=TRUE,
                            scale=TRUE,colsToUse=c(9,12,14:18),maxMeta=10)
    fSOM <- flowSOM.res[[1]]
    
    # see $metadata for subsets:
    fSOM$metaData
    
    # Use only the second file, without changing the map
    fSOM2 <- FlowSOMSubset(fSOM,
                        (fSOM$metaData[[2]][1]):(fSOM$metaData[[2]][2]))

Run the code above in your browser using DataLab