plotDimRed: getDimRedPlot

View source: R/dimRed.R

plotDimRedR Documentation

getDimRedPlot

Description

Generate a plot from a feature matrix

Usage

plotDimRed(
  X,
  dimRedFun = getDimRedCoords.pca,
  annot = NULL,
  colorCol = NULL,
  shapeCol = NULL,
  colScheme = NULL,
  ptSize = 3,
  addLabels = FALSE,
  addDensity = FALSE,
  annot.text = NULL,
  ...
)

Arguments

X

feature matrix containing one row for each observation and one column for each feature

dimRedFun

function to do dimension reduction. E.g. getDimRedCoords.pca, getDimRedCoords.mds, getDimRedCoords.tsne,

annot

annotation matrix with the same number of rows as X

colorCol

name or index in the annotation matrix (annot) that should be used for coloring the points if colorCol not supplied but annot is supplied, it defaults to the first annotation column

shapeCol

name or index in the annotation matrix (annot) that should be used for point shapes if shapeCol not supplied but annot is supplied and has more than one column, it defaults to the second annotation column

colScheme

color sheme to be used in coloring the points

ptSize

size of the points in the scatterplot

addLabels

should observation labels be added to each point

addDensity

should Gaussian Kernel density estimation be performed and the contour lines plotted for each color group

annot.text

optional text to be added in the lower right corner of the plot

...

arguments to be passed on to dimRedFun

Value

a ggplot2 object containing the dimension reduction plot

Author(s)

Fabian Mueller


demuellae/muRtools documentation built on Nov. 6, 2024, 9:44 a.m.