AUCell_createViewerApp: Create AUCell viewer app

Description Usage Arguments Value Note Examples

View source: R/aux_createViewerApp.R

Description

Creates a Shiny app to explore AUCell results

Usage

1
2
3
4
5
6
7
8
AUCell_createViewerApp(
  auc,
  thresholds = NULL,
  tSNE = NULL,
  exprMat = NULL,
  cellInfo = NULL,
  colVars = NULL
)

Arguments

auc

AUC object returned by AUCell_calcAUC

thresholds

Thresholds corresponding to each gene set (optional)

tSNE

t-SNE coordinates for the cells (optional). The row names should correspond to the cell ID. The column names should be "tsne1" and "tsne2".

exprMat

Expression matrix (optional)

cellInfo

Phenodata (optional)

colVars

Color for the phenodata variables (as list, optional)

Value

Thresholds and cells selected within the app (as list).

Note

With lasso: "To make a multiple selection, press the SHIFT key. To clear the selection, press the ESC key."

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
######
# Fake run of AUCell
set.seed(123)
exprMatrix <- matrix(
  data=sample(c(rep(0, 5000), sample(1:3, 5000, replace=TRUE))),
  nrow=20, 
  dimnames=list(paste("Gene", 1:20, sep=""), 
                paste("Cell", 1:500, sep="")))
geneSets <- list(geneSet1=sample(rownames(exprMatrix), 10),
                 geneSet2=sample(rownames(exprMatrix), 5))

cells_rankings <- AUCell_buildRankings(exprMatrix)
cells_AUC <- AUCell_calcAUC(geneSets, cells_rankings, aucMaxRank=5, nCores=1)
selectedThresholds <- NULL
# cellsTsne<- Rtsne::Rtsne(t(exprMatrix),max_iter = 10)$Y
cellsTsne<- tsne::tsne(t(exprMatrix),max_iter = 10)
rownames(cellsTsne) <- colnames(exprMatrix)

cellInfo <- data.frame(cellType1=sample(LETTERS[1:3],ncol(exprMatrix), replace=TRUE), 
                       cellType2=sample(letters[5:7],ncol(exprMatrix), replace=TRUE), 
                       nGenes=abs(rnorm(ncol(exprMatrix))), 
                       row.names=colnames(exprMatrix))
######

# Create app 
aucellApp <- AUCell_createViewerApp(auc=cells_AUC, thresholds=selectedThresholds, 
                                    tSNE=cellsTsne, exprMat=exprMatrix, cellInfo=cellInfo)

# The exact commands to lauch the app depend on the R settings 
# For example:
# library(shiny)
# options(shiny.host="0.0.0.0") 
# savedSelections <- runApp(aucellApp) 
# (see Shiny's doc for help)

AUCell documentation built on Nov. 8, 2020, 5:51 p.m.