Description Objects from the Class Slots Methods Author(s) See Also Examples
This S4 class includes a series of methods to do gene set enrichment analysis and hypergeometric tests for high-throughput screens.
Objects of class GSCA can be created from
new("GSCA", listOfGeneSetCollections, geneList, hits) (see
the examples below)
listOfGeneSetCollections:a list of gene set collections (a 'gene set collection' is a list of gene sets).
geneList:a numeric or integer vector of phenotypes named by gene identifiers.
hits:a character vector of the gene identifiers (used as hits in the hypergeometric tests).
para:a list of parameters for hypergeometric tests and GSEA. These
parameters are pValueCutoff, pAdjustMethod, nPermutations,
minGeneSetSize and exponent (see function
analyzeGeneSetCollections for detailed descriptions about
these parameters).
result:a list of results (see the returned values in the function
analyzeGeneSetCollections).
summary:a list of summary information for listOfGeneSetCollections,
geneList, hits, para, and result.
preprocessed:a single logical value specifying whether or not the input data has been preprocessed.
An overview of methods with class-specific functionality: More detailed introduction can be found in help for each specific function.
preprocessdo preprocessing on input vectors of phenotypes and hits including:
a) removing NAs in the geneList and hits;
b) invoking function duplicateRemover to process
duplicated phenotypes (see duplicateRemover for more details);
c) invoking function annotationConvertor to convert annotations;
d) ranking phenotypes in a decreasing order.
analyzeperform hypergeometric tests and Gene Set Enrichment Analysis based on
input parameter list para.
appendGSTermsappend gene set terms to GSCA results
summarizeprint summary information about listOfGeneSetCollections,
geneList, hits, para, and result.
getTopGeneSetsselect top significant gene sets from object@results$`resultName`
by setting ntop or allSig.
writeHitswrite observed hits in gene sets for hypergeometric tests.
viewGSEAview a figure of GSEA results for a gene set in a gene set collection.
plotGSEAplot and save figures of GSEA results for top significant gene sets in a gene set collection.
viewEnrichMapplot an enrichment map for GSEA or hypergeometric test results
plotEnrichMapplot and save an enrichment map for GSEA or hypergeometric test results
reportgenerate html reports.
Xin Wang xw264@cam.ac.uk
preprocess
analyze
appendGSTerms
summarize
getTopGeneSets
writeHits
viewGSEA
plotGSEA
viewEnrichMap
plotEnrichMap
report
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 | ## Not run:
library(org.Dm.eg.db)
library(KEGG.db)
library(AnnotationDbi)
##library(igraph)
##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")
gscs <- list(PW_KEGG = PW_KEGG)
##create an object of class 'GSCA'
gsca <- new("GSCA", listOfGeneSetCollections=gscs, geneList =
KcViab_Data4Enrich, hits = hits)
##do preprocessing (KcViab_Data4Enrich has already been preprocessed)
gsca <- preprocess(gsca, species="Dm", initialIDs = "Entrez.gene",
keepMultipleMappings = TRUE, duplicateRemoverMethod = "max",
orderAbsValue = FALSE)
##do hypergeometric tests and GSEA
gsca <- analyze(gsca, para = list(pValueCutoff = 0.05, pAdjustMethod
= "BH", nPermutations = 1000, minGeneSetSize = 60, exponent = 1))
##print summary information
summarize(gsca)
##get all significant gene sets in "PW_KEGG"
sigGSs<-getTopGeneSets(gsca, "GSEA.results", "PW_KEGG", allSig=TRUE)
##view a GSEA figure
viewGSEA(gsca, gscName="PW_KEGG", gsName=sigGSs[["PW_KEGG"]][1])
dev.off()
##append gene set terms to results
gsca<-appendGSTerms(gsca, keggGSCs="PW_KEGG")
##view an enrichment map for GSEA results
eb<-viewEnrichMap(gsca, gscs="PW_KEGG", allSig=TRUE, gsNameType="term",
displayEdgeLabel=FALSE, layout="layout.fruchterman.reingold")
##write html reports
report(object = gsca, experimentName = "GSCATest", species = "Dm",
allSig = TRUE, keggGSCs = "PW_KEGG", reportDir="GSCATestReport")
##browse the index page
browseURL(file.path(getwd(), "GSCATestReport", "index.html"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.