diffExp: Function for Differential Expression

Description Usage Arguments Details Examples

View source: R/diffExp.R

Description

Identified differentially expressed genes from two different condition

Usage

1
diffExp(object, comparison = NULL, volcanoPlot = FALSE, ...)

Arguments

object

Quantified data obtained from gcProcess or preprocess function

comparison

Condition to be compared, currently working is "control-Treated"

volcanoPlot

by default False

...

Details

This function identify differentially expressed genes between two condit ion. This function is different from DiffExpR function implemented in RNASeq ana lysis.

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
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (object, comparison = NULL, volcanoPlot = FALSE, ...) 
{
    state <- object@phenoData$Treatment
    f <- factor(state)
    design <- model.matrix(~0 + f)
    colnames(design) <- levels(f)
    contrast.matrix <- limma::makeContrasts(comparison, levels = design)
    fit <- limma::lmFit(object@qData, design)
    fit <- limma::contrasts.fit(fit, contrast.matrix)
    ebayes <- limma::eBayes(fit)
    if (volcanoPlot == TRUE) {
        jpeg("Valcanoplot.jpg")
        limma::volcanoplot(ebayes, coef = 1, highlight = 0, names = fit$genes$ID, 
            xlab = "Log Fold Change", ylab = "Log Odds", pch = 16, 
            cex = 0.35)
        dev.off()
    }
    object@diffExp <- limma::topTable(ebayes, number = Inf)
    new("NcmsProcessData", object)
  }

HTDA documentation built on May 31, 2017, 2:29 a.m.