ErmineR
R wrapper for ermineJ
Install / Use
/learn @PavlidisLab/ErmineRREADME
ErmineR <img src="ermineR.png" align="right" style="height:100px"/>
This is an R wrapper for Pavlidis Lab’s ermineJ. A tool for gene set enrichment analysis with multifunctionality correction.
Table of Contents
Installation
ermineR requries 64 bit version of java to function. If you are a Mac user make sure you have the java SDK.
After java is installed you can install ermineR by doing
devtools::install_github('PavlidisLab/ermineR')
If ermineR cannot find your java home by itself. Either install rJava or
use Sys.setenv(JAVA_HOME=javaHome) to point ermineR to the right path.
Some users report that the ermineJ executable loses its exection privilage after installation. If this happens you will get an error like
"Error in (function (annotation = NULL, aspects = c("Molecular Function", :
Something went wrong. Blame the dev
sh: [library installation path]/ermineR/ermineJ-3.1.2/bin/ermineJ.sh: Permission denied "
To fix this just do
chmod +x [library installation path]/ermineR/ermineJ-3.1.2/bin/ermineJ.sh
You may need sudo depending on where you install your packages
Usage
See documentation for ora, roc, gsr, precRecall and corr to
see how to use them.
An explanation of what each method does is given. We recommend users
start with the precRecall (for gene ranking-based enrichment analysis)
or ora (for hit-list over-representation analysis).
Replicable go terms
GO terms are updated frequently so results can differ between versions. The default option of all ermineR functions is to get the latest GO version however this means you may get different results when you repeat the experiment later. If you want to use a specific version of GO, ermineR provides functions to deal with that.
goToday: Downloads the latest version of go to a path you providegetGoDates: Lists all dates where a go version is available, from the most recent to oldestgoAtDate: Given a valid date, downloads the Go version from a specific date to a file path you provide
To use a specific version of GO, make sure to set geneSetDescription
argument of all ermineR functions to the file path where you saved the
go terms
Annotations
ErmineR requires annotation files to work. These files include gene
identifiers and their Go annotations, along with some optional
information. By default, ermineR supports annotation files generated by
Gemma. And will automatically
download them if you provide a valid annotation name. You can get a list
of valid annotation names using listGemmaAnnotations(). As a general
rule, if your platform has an identifier in GEO, the identifier that
starts with “GPL” is used as the Gemma identifier as well. There are
also generic annotation files available that contain all genes from a
species. These are typically named something like “Generic_human”.
You can manually download these annotation files from
https://gemma.msl.ubc.ca/annots/ or by using the
gemma.R::get_platform_annotations function. ErmineR typically uses
“noParents” versions of these files since parent terms are derived using
the ontology file acquired from GO.
Examples
Use GSR with gene scores
Here we will use a mock scores file located in our tests directory. The score file is specifically created to be enriched in genes with the term GO:0051082.
scores = read.table("tests/testthat/testFiles/pValues", header=T, row.names = 1)
head(scores)
## pvalue
## 206190_at 0.3163401
## 208385_at 0.5186824
## 65086_at 0.6620389
## 202281_at 0.4068895
## 211622_s_at 0.9128846
## 219257_s_at 0.2936740
This scores file only includes scores for 118 genes. The file was generated using GPL96’s probesets so that is the annotation we’ll be using. Any gene that is not reperesented by the score file will be ignored.
gsrOut = gsr(annotation = 'GPL96',
scores = scores,
scoreColumn = 1,
iterations = 10000,
bigIsBetter = FALSE,
logTrans = TRUE)
## Attempting to download annotation file
head(gsrOut$results) %>% knitr::kable()
| Name | ID | NumProbes | NumGenes | RawScore | Pval | CorrectedPvalue | MFPvalue | CorrectedMFPvalue | Multifunctionality | Same as | GeneMembers | |:----------------------------------------------|:-------------|----------:|---------:|---------:|----------:|----------------:|---------:|------------------:|-------------------:|:--------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | protein folding | GO:0006457 | 40 | 24 | 3.198073 | 0.0000000 | 0.0000000 | 0.000000 | 0.0000000 | 0.145 | NA | AIP|CALR|CCT5|CCT6A|CCT8L2|CDC37L1|CLGN|CLPX|DNAJB1|DNAJB4|GAK|HSP90AA1|HSPA1A|HSPA9|HSPB6|HSPD1|NUDC|PFDN6|PTGES3|RUVBL2|ST13|TCP1|TOR1A|UGGT1| | | unfolded protein binding | GO:0051082 | 52 | 29 | 3.299625 | 0.0000000 | 0.0000000 | 0.000000 | 0.0000000 | 0.174 | NA | AIP|CALR|CCT5|CCT6A|CCT8L2|CDC37L1|CHAF1A|CLGN|CLPX|DNAJB1|DNAJB4|HSP90AA1|HSPA1A|HSPA9|HSPB6|HSPD1|HTRA2|NUDC|PFDN6|PTGES3|RUVBL2|SHQ1|SRSF10|TAPBP|TCP1|TOMM20|TOR1A|TUBB4B|UGGT1| | | cytosol | GO:0005829 | 74 | 41 | 2.118055 | 0.0005727 | 0.0150806 | 0.000400 | 0.0105333 | 0.493 | NA | AAMP|AIP|ARC|BHMT2|CALR|CCT5|CCT6A|CDC37L1|CLPX|CRABP1|DNAJB1|DNAJB4|EPHB2|FRS2|GAK|GEMIN2|HCK|HSP90AA1|HSPA1A|HSPB6|HSPD1|HTRA2|NELFA|NUDC|OGG1|PASK|PEX5|PIKFYVE|POLR3K|PRKCI|PTGES3|RUVBL2|SHQ1|SPHK1|SRSF10|ST13|TCP1|TOR1A|TUBB4B|UNC13B|USP33| | | cellular component organization | GO:0016043 | 67 | 34 | 2.146421 | 0.0024970 | 0.0493218 | 0.004267 | 0.0842792 | 0.829 | NA | ARC|CALR|CHAF1A|CLGN|DDX46|EPHB2|GAK|GEMIN2|HCK|HSP90AA1|HSPA1A|HSPA9|HSPD1|HTRA2|NUDC|PEX5|PFDN6|PIKFYVE|PRKCI|PTGES3|RUVBL2|SEMA3B|SHQ1|SRSF10|SULF1|TAPBP|TCP1|TOMM20|TOR1A|TUBB4B|UNC13B|USP33|VPS8|ZNF207| | | cellular component organization or biogenesis | GO:0071840 | 67 | 34 | 2.146421 | 0.0024970 | 0.0394574 | 0.004267 | 0.0674234 | 0.828 | NA | ARC|CALR|CHAF1A|CLGN|DDX46|EPHB2|GAK|GEMIN2|HCK|HSP90AA1|HSPA1A|HSPA9|HSPD1|HTRA2|NUDC|PEX5|PFDN6|PIKFYVE|PRKCI|PTGES3|RUVBL2|SEMA3B|SHQ1|SRSF10|SULF1|TAPBP|TCP1|TOMM20|TOR1A|TUBB4B|UNC13B|USP33|VPS8|ZNF207| | | cellular component assembly | GO:0022607 | 45 | 22 | 2.386422 | 0.0032000 | 0.0421333 | 0.004500 | 0.0592500 | 0.556 | NA | ARC|CALR|CHAF1A|CLGN|DDX46|EPHB2|GAK|GEMIN2|HSP90AA1|HSPA1A|HSPA9|HSPD1|PFDN6|PIKFYVE|PTGES3|RUVBL2|SHQ1|SRSF10|TAPBP|TCP1|UNC13B|ZNF207| |
Use Precision Recall with gene scores
We will use the same scores file from the example above
precRecallOut = precRecall(annotation = 'GPL96',
scores = scores,
scoreColumn = 1,
iterations = 10000,
bigIsBetter = FALSE,
logTrans = TRUE)
## Attempting to download annotation file
head(precRecallOut$results) %>% knitr::kable()
| Name | ID | NumProbes | NumGenes | RawScore | Pval | CorrectedPvalue | MFPvalue | CorrectedMFPvalue | Multifunctionality | Same as | GeneMembers | |:---------------------------|:-------------|----------:|---------:|----------:|-------:|----------------:|---------:|------------------:|-------------------:|:--------|:---
