plotLoadings: Plot highest loadings of a factor

Description Usage Arguments Details Value Examples

View source: R/plotting.R

Description

Plot highest loadings of a factor

Usage

1
plotLoadings(object, term, n_genes = 10)

Arguments

object

an object of class Rcpp_SlalomModel

term

integer(1) or character(1), providing either index for desired term (if an integer) or the term name (if character)

n_genes

integer(1), number of loadings (genes) to show

Details

Show the factor loadings for a genes with the highest loadings for a given factor. Absolute weights are shown, with genes ordered by absolute weight. Indications are given on the plot as to whether the gene was originally in the factor geneset or added to it by the slalom model.

Value

a ggplot plot object

Examples

1
2
3
4
5
6
7
gmtfile <- system.file("extdata", "reactome_subset.gmt", package = "slalom")
genesets <- GSEABase::getGmt(gmtfile)
data("mesc")
model <- newSlalomModel(mesc, genesets, n_hidden = 5, min_genes = 10)
model <- initSlalom(model)
model <- trainSlalom(model, nIterations = 10)
plotLoadings(model, term = 2)

slalom documentation built on Nov. 8, 2020, 5:24 p.m.