GSCABatch: An S4 class for Time series data packaging in Gene Set...

Description Usage Arguments Value Slots See Also Examples

View source: R/Batch_class.R

Description

This S4 class packages time-series data for further GSCA. To put it more clearly, it'll finally generate a list of GSCA objects for further analyses.

Usage

1
GSCABatch(expInfor, listOfGeneSetCollections, phenotypeTS, hitsTS = list())

Arguments

expInfor

A character matrix contains experiment information with each experiment in row and information in column. Should at least contain two columns named as 'ID' and 'Desription'.

listOfGeneSetCollections

A list of gene set collections (a 'gene set collection' is a list of gene sets).

phenotypeTS

A list of phenotypes, each element of this list is a numeric vector phenotypes named by gene identifiers for each time point. Note: the order of each element of this list must match the order of 'expInfor' ID.

hitsTS

A list of hits, each element is a character vector of the gene identifiers (used as hits in the hypergeometric tests). It's needed if you want do GSOA. Note: the order of each element of this list must match the order of 'expInfor' ID.

Value

This function will create a new object class 'GSCABatch'.

Slots

listOfGSCA

A list of initialized GSCA object for futher GSCA.

See Also

GSCA-class preprocessGscaTS, analyzeGscaTS, appendGSTermsTS

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
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})

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

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

CityUHK-CompBio/HTSanalyzeR2 documentation built on Dec. 3, 2020, 2:35 a.m.