analyzeGscaTS: Gene Set Collection Analysis for Time-series data.

Description Usage Arguments Value See Also Examples

View source: R/gscaTS.R

Description

For each GSCA object of 'gscaList', this function will store the results from function analyzeGeneSetCollections in slot result, and update information about these results to slot summary of class GSCA.

Usage

1
2
3
analyzeGscaTS(gscaList, para = list(pValueCutoff = 0.05, pAdjustMethod = "BH",
  nPermutations = 1000, minGeneSetSize = 15, exponent = 1), verbose = TRUE,
  doGSOA = FALSE, doGSEA = TRUE, GSEA.by = "HTSanalyzeR2")

Arguments

gscaList

A named list of GSCA object generated by 'preprocessGscaTS'.

para

A list of parameters for GSEA and hypergeometric tests. Details please see analyze.

verbose

a single logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE), default is TRUE.

doGSOA

a single logical value specifying whether to perform gene set overrepresentation analysis (when doGSOA=TRUE) or not (when doGSOA=FALSE), default is FALSE.

doGSEA

a single logical value specifying whether to perform gene set enrichment analysis (when doGSEA=TRUE) or not (when doGSEA=FALSE), default is TRUE.

GSEA.by

A single character value to choose which algorithm to do GSEA. Valid value could either be "HTSanalyzeR2"(default) or "fgsea". If performed by "fgsea", the result explanation please refer to fgsea.

Value

In the end, this function will return an updated list of GSCA object.

See Also

analyze

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
data(d7, d13, d25)

## generate expInfor to describe the information of time series data
expInfor <- matrix(c("d7", "d13", "d25"), nrow = 3, ncol = 2,
                   byrow = FALSE, dimnames = list(NULL, c("ID", "Description")))

## package phenotypeTS into a list of phenotypes
datalist <- list(d7, d13, d25)
phenotypeTS <- lapply(datalist, function(x) {
                      tmp <- as.vector(x$neg.lfc)
                      names(tmp) <- x$id
                      tmp})

## set up a list of gene set collections
library(org.Hs.eg.db)
library(GO.db)
GO_BP <- GOGeneSets(species="Hs", ontologies=c("BP"))
ListGSC <- list(GO_BP=GO_BP)

## package hitsTS if you also want to do GSOA, otherwise ignore it
hitsTS <- lapply(datalist, function(x){
tmp <- x[x$neg.p.value < 0.01, "id"]
tmp})

## create an object of class GSCABatch with hitsTS
gscaTS <- GSCABatch(expInfor = expInfor, phenotypeTS = phenotypeTS,
                 listOfGeneSetCollections = ListGSC, hitsTS = hitsTS)

## preprocess GSCABatch
gscaTS1 <- preprocessGscaTS(gscaTS, species="Hs", initialIDs="SYMBOL",
                           keepMultipleMappings=TRUE, duplicateRemoverMethod="max",
                           orderAbsValue=FALSE)

## support parallel calculation using doParallel package
if (requireNamespace("doParallel", quietly=TRUE)) {
doParallel::registerDoParallel(cores=2)
} else {
}

## Not run: 
## do hypergeometric tests and GSEA
gscaTS2 <- analyzeGscaTS(gscaTS1, para=list(pValueCutoff=0.05, pAdjustMethod="BH",
                        nPermutations=100, minGeneSetSize=100,
                        exponent=1), doGSOA = TRUE, doGSEA = TRUE)
head(getResult(gscaTS2[[1]])$GSEA.results$GO_BP, 3)

## End(Not run)

CityUHK-CompBio/HTSanalyzeR2 documentation built on Dec. 11, 2018, 8:06 a.m.