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.
To install from CRAN:
install.packages('sigora')
As an alternative, you can download the tarball and install from the local file:
install.packages("sigora_3.0.tar.gz",type="source",repos = NULL)
To load the library:
library("sigora")
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 reandomly 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)
a1<-genesFromRandomPathways(seed=12345,kegH,3,50)
## originally selected pathways:
a1[["selectedPathways"]]
## what are the genes
a1[["genes"]]
## Traditional ora identifies dozens of statistically significant pathways!
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 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.
nciH<-makeGPS(pathwayTable=nciTable, saveFile='nciH.rda')
ils<-grep("^IL",idmap[,"Symbol"],value=TRUE)
ilnci<-sigora(queryList=ils,GPSrepo=nciH,level=3)
To preform Signature Overrepresentation Analysis, use the function
sigora. For traditional Overrepresentation Analysis, use
the function ora.
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="myResultsKEGG.csv")
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.
Mappings 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.
Foroushani AB, Brinkman FS and Lynn DJ (2013).“Pathway-GPS and SIGORA: identifying relevant pathways based on the over-representation of their gene-pair signatures.”PeerJ, 1
# NOT RUN {
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=nciTable)
ils<-grep("^IL",idmap[,"Symbol"],value=TRUE)
## signature overrepresentation analysis:
sigRes.ilnci<-sigora(queryList=ils,GPSrepo=nciH,level=3)
# }
Run the code above in your browser using DataLab