plot_pca_scatters {RNAseqQC}R Documentation

Plot matrix of PCA scatter plots

Description

Plot matrix of PCA scatter plots

Usage

plot_pca_scatters(
  obj,
  n_PCs = min(10, nrow(obj), ncol(obj)),
  show_var_exp = T,
  n_feats = 500,
  scale_feats = FALSE,
  na_frac = 0.3,
  metadata = NULL,
  color_by = NULL,
  shape_by = NULL,
  point_alpha = 0.7,
  point_rel_size = 2,
  transpose = FALSE,
  rasterise = FALSE,
  ...
)

Arguments

obj

A (features x samples) matrix or SummarizedExperiment object

n_PCs

Number of principal components to plot

show_var_exp

Whether to show a plot of the percentage of variance explained by each PC in the bottom left corner.

n_feats

Number of top-variable features to include.

scale_feats

Whether to scale the features.

na_frac

Only consider features with the stated maximum fraction of NAs or NaNs. NA/NaNs will be mean-imputed for PCA.

metadata

A data.frame used for annotating samples. rownames(metadata) must match colnames(obj).

color_by

Variable by which to color points. Must be a column in metadata or in colData(obj). Alternatively, it can be the name of a feature (a rowname of obj) or a gene name (an element of rowData(obj)$gene_name).

shape_by

Variable by which to color points. Must be a column in metadata or in colData(obj).

point_alpha

alpha value of geom_point()

point_rel_size

relative size of geom_point()

transpose

Wheter to transpose the whole matrix of scatter plots

rasterise

Whether to rasterise the points using ggrastr.

...

Other parameters passed on to ggrastr::rasterise

Value

The function displays the scatter plots of the PCs

Examples


set.seed(1)
data <- matrix(rnorm(100*6), ncol=6)
data <- t(t(data)+c(-1, -1.1, -1.2, 1, 1.1, 1.2))
plot_pca_scatters(data)


[Package RNAseqQC version 0.2.1 Index]