plotFactors: Plot scatter plots of unaligned and aligned factor loadings

View source: R/rliger.R

plotFactorsR Documentation

Plot scatter plots of unaligned and aligned factor loadings

Description

Generates scatter plots of factor loadings vs cells for both unaligned and aligned (normalized) factor loadings. This allows for easier visualization of the changes made to the factor loadings during the alignment step. Lists a subset of highly loading genes for each factor. Also provides an option to plot t-SNE coordinates of the cells colored by aligned factor loadings.

It is recommended to call this function into a PDF due to the large number of plots produced.

Usage

plotFactors(
  object,
  num.genes = 10,
  cells.highlight = NULL,
  plot.tsne = FALSE,
  verbose = TRUE
)

Arguments

object

liger object. Should call quantileAlignSNF before calling.

num.genes

Number of genes to display for each factor (default 10).

cells.highlight

Names of specific cells to highlight in plot (black) (default NULL).

plot.tsne

Plot t-SNE coordinates for each factor (default FALSE).

verbose

Print messages (TRUE by default)

Value

Plots to console (1-2 pages per factor)

Examples


ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
ligerex <- normalize(ligerex)
ligerex <- selectGenes(ligerex)
ligerex <- scaleNotCenter(ligerex)
ligerex <- optimizeALS(ligerex, k = 5, max.iter = 1)
ligerex <- quantile_norm(ligerex)
plotFactors(ligerex)
ligerex <- runTSNE(ligerex)
plotFactors(ligerex, plot.tsne = TRUE)


rliger documentation built on Nov. 9, 2023, 1:07 a.m.