Learn R Programming

HTSanalyzeR (version 2.24.0)

preprocess: A preprocessing method for objects of class GSCA or NWA

Description

This is a generic function.

When implemented as the S4 method for objects of class GSCA or NWA, this function filters out invalid data, removes duplicated genes, converts annotations to Entrez identifiers, etc.

To use this function for objects of class GSCA:

preprocess(object, species="Dm", initialIDs="FlybaseCG", keepMultipleMappings =TRUE, duplicateRemoverMethod="max", orderAbsValue=FALSE, verbose=TRUE)

To use this function for objects of NWA:

preprocess(object, species="Dm", initialIDs="FlybaseCG", keepMultipleMappings =TRUE, duplicateRemoverMethod="max", verbose=TRUE)

Usage

preprocess(object, ...)

Arguments

object
an object. When this function is implemented as the S4 method of class GSCA or NWA, this argument is an object of class 'GSCA' or NWA.
...
other arguments depending on class (see below for the arguments supported by class GSCA and/or NWA)

Value

In the end, this function will return an updated object of class GSCA or NWA.

Details

This function will do the following preprocessing steps:

1:
filter out p-values (the slot pvalues of class NWA), phenotypes (the slot phenotypes of class NWA) and data for enrichment (the slot geneList of class GSCA) with NA values or without valid names, and invalid gene names (the slot hits of class GSCA);

2:
invoke function duplicateRemover to remove duplicated genes in the slot pvalues, phenotypes of class NWA, and the slot geneList and hits of class GSCA;

3:
invoke function annotationConvertor to convert annotations from initialIDs to Entrez identifiers. Please note that the slot hits and the names of the slot geneList of class GSCA, the names of the slot pvalues and the names of the slot phenotypes of class NWA must have the same type of gene annotation specified by initialIDs;
4:
order the data for enrichment decreasingly for objects of class GSCA.

See the function duplicateRemover for more details about how to remove duplicated genes.

See the function annotationConvertor for more details about how to convert annotations.

See Also

duplicateRemover, annotationConvertor

Examples

Run this code
## Not run: 
# library(org.Dm.eg.db)
# library(KEGG.db)
# ##load data for enrichment analyses
# data("KcViab_Data4Enrich")
# ##select hits
# hits <- names(KcViab_Data4Enrich)[which(abs(KcViab_Data4Enrich) > 2)]
# ##set up a list of gene set collections
# PW_KEGG <- KeggGeneSets(species = "Dm")
# gscList <- list(PW_KEGG = PW_KEGG)
# ##create an object of class 'GSCA'
# gsca <- new("GSCA", listOfGeneSetCollections=gscList, geneList =
# KcViab_Data4Enrich, hits = hits)
# ##print gsca
# summarize(gsca, what = c("GeneList", "Hits"))
# ##do preprocessing (KcViab_Data4Enrich has already been preprocessed)
# gsca <- preprocess(gsca, species="Dm", initialIDs = "Entrez.gene", 
# keepMultipleMappings = TRUE, duplicateRemoverMethod = "max", 
# orderAbsValue = FALSE)
# ##print updated object
# summarize(gsca, what = c("GeneList", "Hits"))
# ## End(Not run)

Run the code above in your browser using DataLab