plotFactorHist {MOFA} | R Documentation |
Plot a histogram of latent factor values.
plotFactorHist(object, factor, group_by = NULL, group_names = "", alpha = 0.5, binwidth = NULL, showMissing = FALSE)
object |
a trained |
factor |
character vector with the factor name or numeric vector with the index of the factor. |
group_by |
specifies groups used to color the samples of the histogram.
This can be either:
a character giving the name of a feature,
the name of a covariate (only if using a |
group_names |
names for the groups. |
alpha |
transparency parameter. Default is 0.5 |
binwidth |
binwidth for histogram. Default is |
showMissing |
boolean indicating whether to remove sample
for which |
One of the first steps for the annotation of factors
is to visualise and color them using known covariates such as phenotypic or clinical data.
This method generates a histogram of the sample values in a given latent factor.
Similar functions are plotFactorScatter
for doing scatter plots between pairs of factors
and plotFactorBeeswarm
for doing Beeswarm plots of single factors.
Returns a ggplot2
object
# Example on the CLL data filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata") MOFA_CLL <- loadModel(filepath) plotFactorHist(MOFA_CLL, factor=1) plotFactorHist(MOFA_CLL, factor=1, group_by= "IGHV") # Example on the scMT data filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata") MOFA_scMT <- loadModel(filepath) plotFactorHist(MOFA_scMT, factor=2)