estimateDE: Estimate degrees of differential expression (DE) for...

Description Usage Arguments Details Value Examples

View source: R/TCC.public.R

Description

This function calculates p-values (or the related statistics) for identifying differentially expressed genes (DEGs) from a TCC-class object. estimateDE internally calls a specified method implemented in other R packages.

Usage

1
2
3
4
5
6
7
8
9
estimateDE(tcc, test.method, FDR, paired,
           full, reduced,                   # for DESeq2
           design, contrast,                # for edgeR, DESeq2, voom
           coef,                            # for edgeR, voom
           group, cl,                       # for baySeq
           samplesize,                      # for baySeq, SAMseq
           logged, floor,                   # for WAD
           ...
)

Arguments

tcc

TCC-class object.

test.method

character string specifying a method for identifying DEGs: one of "edger", "deseq2", "bayseq", "voom", and "wad". See the "Details" field for detail. The default is "edger".

FDR

numeric value (between 0 and 1) specifying the threshold for determining DEGs.

paired

logical. If TRUE, the input data are regarded as (two-group) paired samples. If FALSE, the input data are regarded as unpaired samples. The default is FALSE.

full

a formula for creating full model described in DESeq2. The right hand side can involve any column of tcc$group is used as the model frame. See the nbinomLRT function in DESeq2 for details.

reduced

a formula for creating reduced model described in DESeq2. The right hand side can involve any column of tcc$group is used as the model frame. See the nbinomLRT function in DESeq2 for details.

design

the argument is used in edgeR, voom (limma) and DESeq2. For edgeR and voom, it should be the numeric matrix giving the design matrix for the generalized linear model. See the glmFit function in edgeR or the lmFit function in limma for details. For DESeq2, it should be a formula specifying the design of the experiment. See the DESeqDataSet function in DESeq2 for details.

contrast

the argument is used in edgeR and DESeq2. For edgeR, numeric vector specifying a contrast of the linear model coefficients to be tested equal to zero. See the glmLRT function in edgeR for details. For DESeq2, the argument is same to contrast which used in DESeq2 package to retrive the results from Wald test. See the results function in DESeq2 for details.

coef

integer or character vector indicating which coefficients of the linear model are to be tested equal to zero. See the glmLRT function in edgeR for details.

group

numeric or character string identifying the columns in the tcc$group for analysis. See the group argument of topCounts function in baySeq for details.

cl

snow object when using multi processors if test.method = "bayseq" is specified. See the getPriors.NB function in baySeq for details.

samplesize

integer specifying the sample size for estimating the prior parameters if test.method = "bayseq" (defaults to 10000).

logged

logical. If TRUE, the input data are regarded as log2-transformed. If FALSE, the log2-transformation is performed after the floor setting. The default is logged = FALSE. Ignored if test.method is not "wad".

floor

numeric scalar (> 0) specifying the floor value for taking logarithm. The default is floor = 1, indicating that values less than 1 are replaced by 1. Ignored if logged = TRUE. Ignored if test.method is not "wad".

...

further paramenters.

Details

estimaetDE function is generally used after performing the calcNormFactors function that calculates normalization factors. estimateDE constructs a statistical model for differential expression (DE) analysis with the calculated normalization factors and returns the p-values (or the derivatives). The individual functions in other packages are internally called according to the specified test.method parameter.

Value

A TCC-class object containing following fields:

stat$p.value

numeric vector of p-values.

stat$q.value

numeric vector of q-values calculated based on the p-values using the p.adjust function with default parameter settings.

stat$testStat

numeric vector of test statistics if "wad" is specified.

stat$rank

gene rank in order of the p-values or test statistics.

estimatedDEG

numeric vector consisting of 0 or 1 depending on whether each gene is classified as non-DEG or DEG. The threshold for classifying DEGs or non-DEGs is preliminarily given as the FDR argument.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Analyzing a simulation data for comparing two groups
# (G1 vs. G2) with biological replicates
# The DE analysis is performed by an exact test in edgeR coupled
# with the DEGES/edgeR normalization factors.
# For retrieving the summaries of DE results, we recommend to use
# the getResult function.
data(hypoData)
group <- c(1, 1, 1, 2, 2, 2)
tcc <- new("TCC", hypoData, group)
tcc <- calcNormFactors(tcc, norm.method = "tmm", test.method = "edger",
                       iteration = 1, FDR = 0.1, floorPDEG = 0.05)
tcc <- estimateDE(tcc, test.method = "edger", FDR = 0.1)
head(tcc$stat$p.value)
head(tcc$stat$q.value)
head(tcc$estimatedDEG)
result <- getResult(tcc)

jqsunac/TCC documentation built on March 20, 2021, 4:23 a.m.