knitr::opts_chunk$set(echo = TRUE)
This package implements the pathway analysis method SIGORA. For an in depth description of the method, please see our manuscript in PeerJ. In short: a GPS (gene pair signature) is a (weighted) pair of genes that as a combination occurs only in a single pathway within a pathway repository. A query list is a vector containing a gene list of interest (e.g. genes that are differentially expressed in a particular condition). A present GPS is a GPS for which both components are in the query list. SIGORA identifies relevant pathways based on the over-representation analysis of their (present) GPS.
@section Getting started:
To load the library:
library("sigora")
A thought experiment Imagine you randomly selected 3 KEGG pathways, and then randomly selected a total of 50 genes from all genes that that are associated with any of these pathways. Using traditional methods (hypergeometric test using individual genes), how many pathways would you estimate to show up as statistically overrepresented in this "query list" of 50 genes?
Let us do this experiment! Everything related to
human KEGG Pathways can be found in kegH
. A function to randomly
select $n$ genes from m randomly selected pathways is
genesFromRandomPathways
. The traditional Overrepresentation Analysis
(which is the basis for many popular tools) is available through ora
.
Putting these together:
data(kegH) set.seed(seed = 12345) a1 <- genesFromRandomPathways( kegH, 3, 50) ## originally selected pathways: a1[["selectedPathways"]] ## what are the genes a1[["genes"]] ## Traditional ora identifies dozens of statistically significant pathways! head(ora(a1[["genes"]], kegH)) ## Now let us try sigora with the same input: sigoraRes <- sigora(GPSrepo = kegH, queryList = a1[["genes"]], level = 4) ## Again, the three originally selected pathways were: a1[["selectedPathways"]]
You might want to rerun the above few lines of code with different values
for seed
and convince yourself that there indeed is a need for a new
way of pathway analysis.
The current version of the package comes with precomputed GPS-repositories
for KEGG human and mouse (kegH
and kegM
respectively), as well as for
Reactome human and mouse (reaH
and reaM
respectively). The package
provides a function for creating GPS-repositories from user's own
gene-function repository of choice (example Gene Ontology Biological
Processes). The following section describes this process of creating one's
own GPS-repositories using the PCI-NCI pathways from National Cancer
Institute as an example.
You can create your own GPS repositories using the makeGPS()
function.
There are no particular
requirements on the format of your source repository, except: it should be
provided either a tab delimited file or a dataframe with \bold{three columns
in the following order:
- PathwayID, PathwayName, Gene.
data(nciTable) ## what does the input look like? head(nciTable) ## create a SigObject. use the saveFile parameter for future reuse. data(idmap) nciH <- makeGPS(pathwayTable = nciTable, saveFile = NULL) ils <- grep("^IL", idmap[, "Symbol"], value = TRUE) ilnci <- sigora(queryList = ils, GPSrepo = nciH, level = 3)
Analysis, use the function sigora
. For traditional
Overrepresentation Analysis, use the function ora
.
Exporting the results Simply provide a file name to the
saveFile
parameter of sigora
, i.e. (for the above
experiment):
sigRes <- sigora(kegH, queryList = a1$genes, level = 2, saveFile = NULL)
You will notice that the file also contains the list of the relevant genes from the query list in each pathway. The genes are listed as human readable gene symbols and sorted by their contribution to the statistical significance of the pathway.
between ENSEMBL-IDS, ENTREZ-IDS and Gene-Symbols are performed automatically.
You can, for instance, create a GPS-repository using ENSEMBL-IDs and perform Signature Overrepresentation Analysis using this repository on a list of ENTREZ-IDs.
data('kegH') data('idmap') barplot( table(kegH$L1$degs), col = "red", main = "distribution of number of functions per gene in KEGG human pathways.", ylab = "frequency", xlab = "number of functions per gene" ) ## creating your own GPS repository nciH <- makeGPS(pathwayTable = load_data('nciTable')) ils <- grep("^IL", idmap[, "Symbol"], value = TRUE) ## signature overrepresentation analysis: sigRes.ilnci <- sigora(queryList = ils, GPSrepo = nciH, level = 3)
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.