dr.plotting: Plot DR data

View source: R/dr.plotting.R

dr.plottingR Documentation

Plot DR data

Description

This function plots the indicated dimensional reduction (DR) from a previously calculated FlowCT::dim.reduction() object.

Usage

dr.plotting(
  data,
  assay.i = "normalized",
  plot.dr,
  dims = c(1, 2),
  color.by = "expression",
  shape.by = NULL,
  facet.by = NULL,
  omit.markers = NULL,
  title = "",
  label.by = NULL,
  size = 1,
  raster,
  return.df = F,
  colors
)

Arguments

data

A object with DR generated with FlowCT::dim.reduction() or a data.frame with DR, expression and metadata information (like the first element list of the object generated with FlowCT::dim.reduction()).

assay.i

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

plot.dr

String indicating the desired DR to plot (this indicated DR should be prevoulsy calculated to being plotted). If 'pca.loadings', the plotting result will show the weight of each marker for each PC (the first two components).

color.by

Variable from (from colData(fcs.SCE)) for dots coloring. If color.by = "expression" (default), plot will be automatically splitted for each marker.

shape.by

Variable from (from colData(fcs.SCE)) for dots shaping. Default = NULL.

facet.by

Variable from (from colData(fcs.SCE)) for plot spliting. Default = NULL.

omit.markers

Vector with markers to omit when plotting with color.by = "expression". Default = NULL.

title

Title to add to the plot.

label.by

Variable from (from colData(fcs.SCE)) for dots labeling. Default = NULL.

size

Point size. Default = 1.

raster

Number of pixels to consider for rastering image, if none indicated, not rasterization will performed. It is based on scattermore package.

return.df

Logical indicating if built data.frame with DR information and metadata must be returned. Default = FALSE.

colors

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

n.dims

Vector indicating the two DR components to plot. Default = c(1,2) (by now, these are the only dims allowed).

Examples

## Not run: 
dr.plotting(fcs, plot.dr = "tSNE", color.by = "condition")
dr.plotting(fcs, plot.dr = "UMAP", color.by = "patient_id")
dr <- dr.plotting(fcs, plot.dr = "PCA", color.by = "SOM", facet.by = "condition", return.df = T)

## End(Not run)

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