msiPlot: Draw a density (median signal intensity) plot

Description Usage Arguments Value Examples

View source: R/msiPlot.R

Description

Function to plot the density (median signal intensity) for given markers.

Usage

1
msiPlot(cfList, markers, byGroup = NULL, byCluster = NULL, ...)

Arguments

cfList

a cfList object. It should contain at least data in the 'expr' and 'samples' slots.

markers

character vector with column names of the markers to be plotted. A numeric vector is also accepted, note that 1 starts after removing columns 'clusterID' and 'sampleID'.

byGroup

a character, referring to a column name in the samples slot of the cfList. This will be used as the grouping for the y-axis.

byCluster

character vector specifying which cluster to be plotted. This will be used as the grouping for the y-axis.

...

Additional arguments passed on to geom_density_ridges.

Value

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Read Data
dirFCS <- system.file("extdata", package="cytofast")
cfData <- readCytosploreFCS(dir = dirFCS, colNames = "description")

# relabeling of clusterID
levels(cfData@expr[,"clusterID"]) <- gsub("[^0-9]", "", levels(cfData@expr[,"clusterID"]))  

# Add cell counts to cfList and add meta data
cfData <- cellCounts(cfData, frequency = TRUE, scale = TRUE)
meta <- spitzer[match(row.names(cfData@samples), spitzer$CSPLR_ST),]
cfData@samples <- cbind(cfData@samples, meta)

# Remove unnecessary markers
cfData@expr <- cfData@expr[,-c(3:10, 13:16, 55:59, 61:63)]

# Draw median signal intensity plot, by group
msiPlot(cfData, markers = c("MHC.II", "CD45", "CD4"), byGroup = 'group')

# Or by cluster
msiPlot(cfData, markers = c("MHC.II", "CD45", "CD4"), byCluster = c("1", "6", "10"))

cytofast documentation built on Nov. 8, 2020, 5:46 p.m.