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. |
color_by |
Variable by which to color points. Must be a column in metadata or in |
shape_by |
Variable by which to color points. Must be a column in metadata or in |
point_alpha |
alpha value of |
point_rel_size |
relative size of |
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)