preprocessGscaTS: A preprocessing method for a GSCABatch object of Time-series...

Description Usage Arguments Value See Also Examples

View source: R/gscaTS.R

Description

This function will do basic preprocessing for each GSCA object of 'GSCABatch'.

Usage

1
2
3
4
5
6
7
8
9
preprocessGscaTS(
  object,
  species = "Hs",
  initialIDs = "SYMBOL",
  keepMultipleMappings = TRUE,
  duplicateRemoverMethod = "max",
  orderAbsValue = FALSE,
  verbose = TRUE
)

Arguments

object

A GSCABatch object.

species

A single character value specifying the species of the inputs. It supports all the species of OrgDb objects in AnnotationDbi. The format should be an abbreviation of the organism as setted by AnnotationDbi. For example, the commonly used ones are "Dm" ("Drosophila_melanogaster"), "Hs" ("Homo_sapiens"), "Rn" ("Rattus_norvegicus"), "Mm" ("Mus_musculus"), "Ce" ("Caenorhabditis_elegans"), and etc.

initialIDs

A single character value specifying the type of initial identifiers for input phenotypeTS The valid terms need match with the keytypes of species db such as keytypes(org.Hs.eg.db).

keepMultipleMappings

A single logical value. If TRUE, the function keeps the entries with multiple mappings (first mapping is kept). If FALSE, the entries with multiple mappings will be discarded.

duplicateRemoverMethod

A single character value specifying the method to remove the duplicates. See help(duplicateRemover) for details.

orderAbsValue

A single logical value indicating whether the values should be converted to absolute values and then ordered (if TRUE), or ordered as they are (if FALSE).

verbose

A single logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE).

Value

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

See Also

preprocess

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

## 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)
gscaTS1

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