## Not run:
# # 1) Enrichment analysis for SCOP domain superfamilies (sf)
# ## 1a) load SCOP.sf (as 'InfoDataFrame' object)
# SCOP.sf <- dcRDataLoader('SCOP.sf')
# ### randomly select 50 domains as a list of domains of interest
# data <- sample(rowNames(SCOP.sf), 50)
# ## 1b) perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, domain="SCOP.sf", ontology="GOMF")
# eoutput
# ## 1c) view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ## 1d) visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
# ## 1e) the same as above but using a customised background
# ### randomly select 500 domains as background
# background <- sample(rowNames(SCOP.sf), 500)
# ### perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, background=background, domain="SCOP.sf",
# ontology="GOMF")
# eoutput
# ### view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ### visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
#
# ###########################################################
# # 2) Enrichment analysis for Pfam domains (Pfam)
# ## 2a) load Pfam (as 'InfoDataFrame' object)
# Pfam <- dcRDataLoader('Pfam')
# ### randomly select 100 domains as a list of domains of interest
# data <- sample(rowNames(Pfam), 100)
# ## 2b) perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, domain="Pfam", ontology="GOMF")
# eoutput
# ## 2c) view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ## 2d) visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
# ## 2e) the same as above but using a customised background
# ### randomly select 1000 domains as background
# background <- sample(rowNames(Pfam), 1000)
# ### perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, background=background, domain="Pfam",
# ontology="GOMF")
# eoutput
# ### view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ### visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
#
# ###########################################################
# # 3) Enrichment analysis for InterPro domains (InterPro)
# ## 3a) load InterPro (as 'InfoDataFrame' object)
# InterPro <- dcRDataLoader('InterPro')
# ### randomly select 100 domains as a list of domains of interest
# data <- sample(rowNames(InterPro), 100)
# ## 3b) perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, domain="InterPro", ontology="GOMF")
# eoutput
# ## 3c) view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ## 3d) visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
# ## 3e) the same as above but using a customised background
# ### randomly select 1000 domains as background
# background <- sample(rowNames(InterPro), 1000)
# ### perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, background=background, domain="InterPro",
# ontology="GOMF")
# eoutput
# ### view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ### visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
#
# ###########################################################
# # 4) Enrichment analysis for Rfam RNA families (Rfam)
# ## 4a) load Rfam (as 'InfoDataFrame' object)
# Rfam <- dcRDataLoader('Rfam')
# ### randomly select 100 RNAs as a list of RNAs of interest
# data <- sample(rowNames(Rfam), 100)
# ## 4b) perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, domain="Rfam", ontology="GOBP")
# eoutput
# ## 4c) view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=FALSE)
# ## 4d) visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
# ## 4e) the same as above but using a customised background
# ### randomly select 1000 RNAs as background
# background <- sample(rowNames(Rfam), 1000)
# ### perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, background=background, domain="Rfam",
# ontology="GOBP")
# eoutput
# ### view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=FALSE)
# ### visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
#
# ###########################################################
# # 5) Advanced usage: customised data for domain, ontology and annotations
# # 5a) create domain, ontology and annotations
# ## for domain
# domain <-
# dcBuildInfoDataFrame(input.file="http://dcgor.r-forge.r-project.org/data/InterPro/InterPro.txt",
# output.file="domain.RData")
# ## for ontology
# dcBuildOnto(relations.file="http://dcgor.r-forge.r-project.org/data/onto/igraph_GOMF_edges.txt",
# nodes.file="http://dcgor.r-forge.r-project.org/data/onto/igraph_GOMF_nodes.txt",
# output.file="ontology.RData")
# ## for annotations
# dcBuildAnno(domain_info.file="http://dcgor.r-forge.r-project.org/data/InterPro/InterPro.txt",
# term_info.file="http://dcgor.r-forge.r-project.org/data/InterPro/GO.txt",
# association.file="http://dcgor.r-forge.r-project.org/data/InterPro/Domain2GOMF.txt",
# output.file="annotations.RData")
# ## 5b) prepare data and background
# ### randomly select 100 domains as a list of domains of interest
# data <- sample(rowNames(domain), 100)
# ### randomly select 1000 domains as background
# background <- sample(rowNames(domain), 1000)
# ## 5c) perform enrichment analysis, producing an object of S4 class 'Eoutput'
# eoutput <- dcEnrichment(data, background=background,
# domain.RData='domain.RData', ontology.RData='ontology.RData',
# annotations.RData='annotations.RData')
# eoutput
# ## 5d) view the top 10 significance terms
# view(eoutput, top_num=10, sortBy="pvalue", details=TRUE)
# ### visualise the top 10 significant terms in the ontology hierarchy
# ### color-coded according to 10-based negative logarithm of adjusted p-values (adjp)
# visEnrichment(eoutput)
# ## End(Not run)
Run the code above in your browser using DataLab