annotate: Function for Gene-Set Enrichment Analysis

Usage Arguments Details Examples

View source: R/annotate.R

Usage

1
annotate(object, annotation = "ath1121501", ont = "MF", pvalue = 0.5, entrez, entrezid)

Arguments

object

Differentially expressed data generated from diffExp function

annotation

bioconductor annotation database default ath1121501

ont

ontology i.e MF,BP,CC default MF

pvalue

Significant cutoff default 0.05

entrez

yes or no

entrezid

if entrez is yes, then the entrez id object

Details

The function calculate Gene-Set Enrichment Analysis (GSEA) using hyperg eometric t-test for both up and down regulated genes at a logfold cutoof 1 and - 1.

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
##---- 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, annotation = "ath1121501", ont = "MF", pvalue = 0.5, 
    entrez, entrezid) 
{
    up <- object@diffExp[which(object@diffExp$logFC >= 1), ]
    down <- object@diffExp[which(object@diffExp$logFC >= -1), 
        ]
    de <- rbind(up, down)
    geneUniverse <- rownames(object@qData)
    geneSample <- de$ID
    if (entrez == "no") {
        genesample1 <- entrezid[which(rownames(entrezid) %in% 
            geneSample), ]
        geneUniverse1 <- entrezid[which(rownames(entrezid) %in% 
            geneUniverse), ]
        params <- new("GOHyperGParams", geneIds = genesample1, 
            universeGeneIds = geneUniverse1, annotation = annotation, 
            ontology = ont, pvalueCutoff = pvalue, conditional = FALSE, 
            testDirection = "over")
        hgOver <- GOstats::hyperGTest(params)
    }
    else {
        params <- new("GOHyperGParams", geneIds = geneSample, 
            universeGeneIds = geneUniverse, annotation = annotation, 
            ontology = ont, pvalueCutoff = pvalue, conditional = FALSE, 
            testDirection = "over")
        hgOver <- GOstats::hyperGTest(params)
    }
    object@enrichment <- summary(hgOver)
    new("PreProcessData", object)
  }

HTDA documentation built on May 2, 2019, 4:53 p.m.