Differential Gene Expression Analysis
Description
Detect differentially expressed genes (DEGs) in a standard ExpressionSet
object.
Usage
1 2 3 
Arguments
ExpressionSet 
a standard PhyloExpressionSet or DivergenceExpressionSet object. 
nrep 
either a numeric value specifying the constant number of replicates per stage or a numeric vector specifying the variable number of replicates for each stage position. 
method 
method to detect differentially expressed genes. 
lib.size 
the library sizes to equalize library sizes by quantiletoquantile normalization (see 
p.adjust.method 
p value correction method. 
comparison 
a character string specifying whether genes having foldchange or pvalues
below, above, or below AND above (both) the 
alpha 
a numeric value specifying the cutoff value above which Genes fulfilling the corresponding foldchange, logfoldchange, or pvalue should be retained and returned by 
filter.method 
a method how to 
n 
a numeric value for 
stage.names 
a character vector specifying the new names of collapsed stages. 
Details
All methods to perform dection of differentially expressed genes assume that your input
dataset has been normalized before passing it to DiffGenes. For RNASeq data
DiffGenes assumes that the libraries have been normalized to have the same size, i.e.,
to have the same expected column sum under the null hypothesis. If this isn't the case
please run equalizeLibSizes
before calling DiffGenes.
Available methods for the detection of differentially expressed genes:

method = "foldchange"
: ratio of replicate geometric means between developmental stages. Here, the DiffGenes functions assumes that absolute expression levels are stored in your inputExpresisonSet
. 
method = "logfoldchange"
: difference of replicate arithmetic means between developmental stages. Here, the DiffGenes functions assumes that log2a transformed expression levels are stored in your inputExpresisonSet
. 
method = "t.test"
: Welch t.test between replicate expression levels of two samples. 
method = "wilcox.test"
: Wilcoxon Rank Sum Test between replicate expression levels of two samples. 
method = "doubletail"
: Computes twosided pvalues by doubling the smaller tail probability (seeexactTestDoubleTail
for details). 
method = "smallp"
: Performs the method of small probabilities as proposed by Robinson and Smyth (2008) (seeexactTestBySmallP
for details). 
method = "deviance"
: Uses the deviance goodness of fit statistics to define the rejection region, and is therefore equivalent to a conditional likelihood ratio test (seeexactTestByDeviance
for details).
Exclude non differentially expressed genes from the result dataset:
When specifying the alpha
argument you furthermore, need to specify the filter.method
to decide how non differentially expressed genes should be classified in multiple sample comparisons and which genes should be retained in the final dataset returned by DiffGenes
. In other words, all genes < alpha
based on the following filter.method
are removed from the result dataset.
Following extraction criteria are implemented in this function:

const
: all genes that have at least one sample comparison that undercuts or exceeds thealpha
valuecut.off
will be excluded from theExpressionSet
. Hence, for a 7 stageExpressionSet
genes passing thealpha
threshold in 6 stages will be retained in theExpressionSet
. 
minset
: genes passing thealpha
value inceiling(n/2)
stages will be retained in theExpressionSet
, where n is the number of stages in theExpressionSet
. 
nset
: genes passing thealpha
value inn
stages will be retained in theExpressionSet
. Here, the argumentn
needs to be specified.
Note
In case input ExpressionSet
objects store 0 values, internally all expression levels are
shifted by +1
to allow sufficient foldchange and pvalue computations. Additionally, a warning
is printed to the console in case expression levels have been automatically shifted.
Author(s)
HajkGeorg Drost
See Also
Expressed
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49  data(PhyloExpressionSetExample)
# Detection of DEGs using the foldchange measure
DEGs < DiffGenes(ExpressionSet = PhyloExpressionSetExample[ ,1:8],
nrep = 2,
comparison = "below",
method = "foldchange",
stage.names = c("S1","S2","S3"))
head(DEGs)
# Detection of DEGs using the logfoldchange measure
# when choosing method = "logfoldchange" it is assumed that
# your input expression matrix stores log2 expression levels
log.DEGs < DiffGenes(ExpressionSet = tf(PhyloExpressionSetExample[1:5,1:8],log2),
nrep = 2,
comparison = "below",
method = "logfoldchange",
stage.names = c("S1","S2","S3"))
head(log.DEGs)
# Remove foldchange values < 2 from the dataset:
## first have a look at the range of foldchange values of all genes
apply(DEGs[ , 3:8],2,range)
# now remove genes undercutting the alpha = 2 threshold
# hence, remove genes having pvalues <= 0.05 in at
# least one sample comparison
DEGs.alpha < DiffGenes(ExpressionSet = PhyloExpressionSetExample[1:250 ,1:8],
nrep = 2,
method = "t.test",
alpha = 0.05,
comparison = "above",
filter.method = "nset",
n = 1,
stage.names = c("S1","S2","S3"))
# now again have a look at the range and find
# that foldchange values of 2 are the min value
apply(DEGs.alpha[ , 3:5],2,range)
# now check whether each example has at least one stage with a pvalue <= 0.05
head(DEGs.alpha)
