| cfList-class | R Documentation | 
This is an S4 class that contains all the data and results
for the cytofast workflow. Most functions in this package will both
use and return a cfList.
This class is used througout the cytofast workflow, most functions in this
package will both use and return a cfList. FCS files created by
Cytosplore can be easily read in with readCytosploreFCS) and will
be returned as a cfList. It is also possible to manually create instances of this
class if another clustering method is preferred. Below an example is
shown for FlowSOM.
samplesdata frame containing all meta information on each sample
exprdata frame containing the marker expression
countsdata frame containing (standardized) cell counts per cluster and per sample
resultslist containing any results
samplesa method for obtaining the samples data
expra method for obtaining the marker expression
countsa method for obtaining the cell counts
resultsa method for obtaining any results from performed tests
### manually create instance of cfList class
library(FlowSOM)
## Cluster with FlowSOM
dirFCS <- system.file("extdata", package="cytofast")
fSOM <- FlowSOM(input = dirFCS, 
                transform = FALSE,
                scale = FALSE,
                colsToUse = c(9:11, 15:52),
                nClus = 10, # Note that this is an ambiguous choice
                seed = 123)
## expr slot
# retrieve clusters
clusterID <- as.factor(fSOM$map$mapping[,1])
levels(clusterID) <- fSOM$metaclustering
# retrieve samples (As example, we assume each FCS file is its own sample)
sampleID <- lapply(fSOM$metaData, function(x){rep(x[1], each = length(x[1]:x[2]))})
attr(sampleID, 'names') <- NULL
sampleID <- as.factor(unlist(sampleID)) 
levels(sampleID) <- paste("ID", 1:10, sep="_")
exprD <- data.frame(clusterID, 
                    sampleID, 
                    fSOM$data[, c(9:11, 15:52)])
## samples slot
samplesD <- data.frame(sampleID = levels(sampleID), 
                       group = rep(c("group1", "group1"), each=5)) 
## create cfList
cfList(samples = samplesD,
       expr = exprD)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.