hi_loadings: Extract genes with highest loadings

Description Usage Arguments Value Examples

View source: R/hi_loadings.R

Description

Extract genes with highest loadings

Usage

1
2
3
4
5
6
7
8
hi_loadings(
  pcaobj,
  whichpc = 1,
  topN = 10,
  exprTable = NULL,
  annotation = NULL,
  title = "Top/bottom loadings"
)

Arguments

pcaobj

A prcomp object

whichpc

An integer number, corresponding to the principal component of interest

topN

Integer, number of genes with top and bottom loadings

exprTable

A matrix object, e.g. the counts of a DESeqDataSet. If not NULL, returns the counts matrix for the selected genes

annotation

A data.frame object, with row.names as gene identifiers (e.g. ENSEMBL ids) and a column, gene_name, containing e.g. HGNC-based gene symbols

title

The title of the plot

Value

A ggplot2 object, or a matrix, if exprTable is not null

Examples

1
2
3
4
5
6
dds <- makeExampleDESeqDataSet_multifac(betaSD = 3, betaSD_tissue = 1)
rlt <- DESeq2::rlogTransformation(dds)
pcaobj <- prcomp(t(SummarizedExperiment::assay(rlt)))
hi_loadings(pcaobj, topN = 20)
hi_loadings(pcaobj, topN = 10, exprTable = dds)
hi_loadings(pcaobj, topN = 10, exprTable = counts(dds))

pcaExplorer documentation built on Nov. 8, 2020, 5:29 p.m.