knitr::opts_chunk$set(message=FALSE, comment="#>") devtools::load_all(".")
Please visit https://montilab.github.io/hypeR-docs/
You can also try out our web-application if you prefer an interface!
We recommend the latest version of R (>= 4.0.0) but hypeR currently requires R (>= 3.6.0) to be installed directly from Github or Bioconductor. To install with R (>= 3.5.0) see below. Use with R (\< 3.5.0) is not recommended.
Install the development version of the package from Github. [Recommended]
devtools::install_github("montilab/hypeR")
Or install the development version of the package from Bioconductor.
BiocManager::install("montilab/hypeR", version="devel")
Or install with Conda.
conda create --name hyper source activate hyper conda install -c r r-devtools R library(devtools) devtools::install_github("montilab/hypeR")
Or install with previous versions of R.
git clone https://github.com/montilab/hypeR nano hypeR/DESCRIPTION # Change Line 8 # Depends: R (>= 3.6.0) -> Depends: R (>= 3.5.0) R install.packages("path/to/hypeR", repos=NULL, type="source")
library(hypeR)
data(wgcna) # Process many signatures signatures <- wgcna[[1]] str(signatures) # Access to hundreds of genesets genesets <- msigdb_gsets("Homo sapiens", "C2", "CP:KEGG", clean=TRUE) print(genesets)
mhyp <- hypeR(signatures, genesets, test="hypergeometric", background=30000)
hyp_dots(mhyp, merge=TRUE, fdr=0.05, title="Co-expression Modules")
hypeR employs multiple types of enrichment analyses (e.g. hypergeometric, kstest, gsea). Depending on the type, different kinds of signatures are expected. There are three types of signatures hypeR()
expects.
# Simply a character vector of symbols (hypergeometric) signature <- c("GENE1", "GENE2", "GENE3") # A ranked character vector of symbols (kstest) ranked.signature <- c("GENE2", "GENE1", "GENE3") # A ranked named numerical vector of symbols with ranking weights (gsea) weighted.signature <- c("GENE2"=1.22, "GENE1"=0.94, "GENE3"=0.77)
A geneset is simply a list of vectors, therefore, one can use any custom geneset in their analyses, as long as it's appropriately defined.
genesets <- list("GSET1" = c("GENE1", "GENE2", "GENE3"), "GSET2" = c("GENE4", "GENE5", "GENE6"), "GSET3" = c("GENE7", "GENE8", "GENE9"))
All workflows begin with performing hyper enrichment with hyper()
. Often we are just interested in a single signature, as described above. In this case, hyper()
will return a hyp
object. This object contains relevant information to the enrichment results and is recognized by downstream methods.
hyp_obj <- hypeR(signature, genesets)
Please visit the documentation for detailed functionality. Below is a brief list of some methods.
BIOCARTA <- msigdb_gsets(species="Homo sapiens", category="C2", subcategory="CP:BIOCARTA") KEGG <- msigdb_gsets(species="Homo sapiens", category="C2", subcategory="CP:KEGG") REACTOME <- msigdb_gsets(species="Homo sapiens", category="C2", subcategory="CP:REACTOME")
# Show interactive table hyp_show(hyp_obj) # Plot dots plot hyp_dots(hyp_obj) # Plot enrichment map hyp_emap(hyp_obj) # Plot hiearchy map (relational genesets) hyp_hmap(hyp_obj)
# Map enrichment to an igraph object (relational genesets) hyp_to_graph(hyp_obj) # Save to excel hyp_to_excel(hyp_obj, file_path="hypeR.xlsx") # Save to table hyp_to_table(hyp_obj, file_path="hypeR.txt") # Generate markdown report hyp_to_rmd(hyp_obj, file_path="hypeR.rmd", title="Hyper Enrichment (hypeR)", subtitle="YAP, TNF, and TAZ Knockout Experiments", author="Anthony Federico, Stefano Monti")
citation("hypeR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.