barplot.cell.pops: Stacked barplot with cell clusters

View source: R/barplot.cell.pops.R

barplot.cell.popsR Documentation

Stacked barplot with cell clusters

Description

This function calculates cluster proportions (or raw counts) for each identified cluster and plot them on a stacked barplot.

Usage

## S3 method for class 'cell.pops'
barplot(
  fcs.SCE,
  assay.i = "normalized",
  cell.clusters,
  plot = T,
  count.by,
  facet.by = NULL,
  return.mode,
  colors = NULL
)

Arguments

fcs.SCE

A fcs.SCE object generated through FlowCT::fcs.SCE().

assay.i

Name of matrix stored in the fcs.SCE object from which calculate correlation. Default = "normalized".

cell.clusters

Name of column containing clusters identified through FlowCT::clustering.flow().

plot

Logical indicating whether plotting stacked barplot. Default = TRUE.

count.by

Variable name (from colData(fcs.SCE)) for calculating proportions (or counts) and drawing the x-axis in the stacked bar plotting.

facet.by

Variable name (from colData(fcs.SCE)) for splitting the stacked bar plotting. Default = NULL.

return.mode

String for specifying if final resuls should be proportions ("percentage") or raw counts ("counts"). Default = NULL.

colors

Vector with colors for plotting. Default = NULL (i.e., it will choose automatically a vector of colors according to FlowCT::div.colors()).

Examples

## Not run: 
prop_table <- barplot.cell.pops(fcs.SCE = fcs, cell.clusters = "SOM_named", 
    count.by = "sample_id", facet.by = "condition", 
    return.mode = "percentage")
counts_table <- barplot.cell.pops(fcs.SCE = fcs, cell.clusters = "SOM_named", 
    count.by = "condition", return.mode = "counts")

## End(Not run)

jgarces02/FlowCT documentation built on March 28, 2023, 12:42 p.m.