runANOVA: Perform differential expression analysis on SCE with ANOVA

Description Usage Arguments Details Value Examples

View source: R/runDEAnalysis.R

Description

Condition specification allows two methods: 1. Index level selection. Arguments index1 and index2 will be used. 2. Annotation level selection. Arguments class, classGroup1 and classGroup2 will be used.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
runANOVA(
  inSCE,
  useAssay = "logcounts",
  index1 = NULL,
  index2 = NULL,
  class = NULL,
  classGroup1 = NULL,
  classGroup2 = NULL,
  analysisName,
  groupName1,
  groupName2,
  covariates = NULL,
  onlyPos = FALSE,
  log2fcThreshold = 0.25,
  fdrThreshold = 0.05,
  overwrite = FALSE
)

Arguments

inSCE

SingleCellExperiment inherited object.

useAssay

character. A string specifying which assay to use for ANOVA. Default "logcounts".

index1

Any type of indices that can subset a SingleCellExperiment inherited object by cells. Specifies which cells are of interests. Default NULL.

index2

Any type of indices that can subset a SingleCellExperiment inherited object by cells. specifies the control group against those specified by index1. If NULL when using index specification, index1 cells will be compared with all other cells. Default NULL.

class

A vector/factor with ncol(inSCE) elements, or a character scalar that specifies a column name of colData(inSCE). Default NULL.

classGroup1

a vector specifying which "levels" given in class are of interests. Default NULL.

classGroup2

a vector specifying which "levels" given in class is the control group against those specified by classGroup1. If NULL when using annotation specification, classGroup1 cells will be compared with all other cells.

analysisName

A character scalar naming the DEG analysis. Required

groupName1

A character scalar naming the group of interests. Required.

groupName2

A character scalar naming the control group. Required.

covariates

A character vector of additional covariates to use when building the model. All covariates must exist in names(colData(inSCE)). Default NULL.

onlyPos

Whether to only output DEG with positive log2_FC value. Default FALSE.

log2fcThreshold

Only out put DEGs with the absolute values of log2FC greater than this value. Default 0.25

fdrThreshold

Only out put DEGs with FDR value less than this value. Default 0.05

overwrite

A logical scalar. Whether to overwrite result if exists. Default FALSE.

Details

NOTE that ANOVA method does not produce Log2FC value, but P-value and FDR only.

Value

The input SingleCellExperiment object with metadata(inSCE)$diffExp updated with the results: a list named by analysisName, with $groupNames containing the naming of the two conditions, $useAssay storing the assay name that was used for calculation, $select storing the cell selection indices (logical) for each condition, $result storing a data.frame of the DEGs summary, and $method storing "ANOVA".

Examples

1
2
3
4
5
6
7
data(scExample, package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
library(scater)
sce <- logNormCounts(sce)
sce <- runANOVA(inSCE = sce, groupName1 = "Sample1",
 groupName2 = "Sample2", index1 = 1:20, index2 = 21:40,
 analysisName = "ANOVA", fdrThreshold = NULL)

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.