This function will group, summarize and then plot data from an ArchRProject for visual comparison.

plotGroups(
  ArchRProj = NULL,
  groupBy = "Sample",
  colorBy = "colData",
  name = "TSSEnrichment",
  imputeWeights = if (!grepl("coldata", tolower(colorBy[1])))
    getImputeWeights(ArchRProj),
  maxCells = 1000,
  quantCut = c(0.002, 0.998),
  log2Norm = NULL,
  pal = NULL,
  discreteSet = "stallion",
  ylim = NULL,
  size = 0.5,
  baseSize = 6,
  ratioYX = NULL,
  ridgeScale = 2,
  plotAs = "ridges",
  threads = getArchRThreads(),
  ...
)

Arguments

ArchRProj

An ArchRProject object.

groupBy

The name of the column in cellColData to use for grouping cells together for summarizing and plotting.

colorBy

A string indicating whether the numeric values to be used in the violin plot should be from a column in cellColData ("cellColData") or from a data matrix in the ArrowFiles (i.e. "GeneScoreMatrix", "MotifMatrix", "PeakMatrix").

name

The name of the column in cellColData or the featureName/rowname of the data matrix to be used for plotting. For example if colorBy is "cellColData" then name refers to a column name in the cellcoldata (see getCellcoldata()). If colorBy is "GeneScoreMatrix" then name refers to a gene name which can be listed by getFeatures(ArchRProj, useMatrix = "GeneScoreMatrix").

imputeWeights

The weights to be used for imputing numerical values for each cell as a linear combination of other cells values. See addImputationWeights() and getImutationWeights() for more information.

maxCells

The maximum cells to consider when making the plot.

quantCut

If this is not null, a quantile cut is performed to threshold the top and bottom of the distribution of values. This prevents skewed color scales caused by strong outliers. The format of this should be c(a,b) where a is the upper threshold and b is the lower threshold. For example, quantCut = c(0.025,0.975) will take the top and bottom 2.5 percent of values and set them to the value of the 97.5th and 2.5th percentile values respectively.

log2Norm

A boolean value indicating whether a log2 transformation should be performed on the values (if continuous) in plotting.

pal

A custom palette (see paletteDiscrete or ArchRPalettes) used to override discreteSet/continuousSet for coloring vector.

discreteSet

The name of a discrete palette from ArchRPalettes for visualizing colorBy if a discrete color set is desired.

ylim

A vector of two numeric values indicating the lower and upper bounds of the y-axis on the plot.

size

The numeric size of the points to be plotted.

baseSize

The base font size to use in the plot.

ratioYX

The aspect ratio of the x and y axes on the plot.

ridgeScale

The scale factor for the relative heights of each ridge when making a ridgeplot with ggridges.

plotAs

A string that indicates whether a rigdge plot ("ridges") should be plotted or a violin plot ("violin") should be plotted.

threads

The number of threads to be used for parallel computing.

...

Additional parameters to pass to ggGroup().