Contents

1 Introduction

InterMine constitutes a powerful open source data warehouse system which integrates diverse biological data sets and provides a growing number of analysis tools, including enrichment analysis widgets (Smith et al. 2012; Kalderimis et al. 2014).

Specifically, the gene set enrichment tool looks for annotations to a set of genes that occur more than would be expected by chance, given a background population of annotations. The hypergeometric distribution is used to calculate a P-value for each annotation and a choice of correction methods for multiple testing (Bonferonni, Holm-Bonferonni and Benjamini Hochberg) are available (Smith et al. 2012; Kalderimis et al. 2014).

InterMine provides Gene Ontology enrichment statistics as well as enrichment statistics for other annotation types including protein domains, pathways, human diseases, mammalian phenotypes and publications. The default background population is all genes in the genome with the specified annotation type. However, the background population can be changed by specifying another list. More information can be found in the online documentation.

2 Perform enrichment analysis with InterMineR

Performing enrichment analysis with InterMineR is preceded by two steps:

  1. Retrieve the list of bioentities of interest (Genes, Proteins, SNPs, etc.) for which the analysis will be performed.

  2. Get the enrichment widget name which indicates the annotation types that you want to investigate for enrichment (e.g. Gene Ontology Terms, protein domains, KEGG and Reactome Pathways, human diseases, mammalian phenotypes and publications).

2.1 Retrieve list containing the genes of interest from InterMineR

In this example, enrichment analysis is performed using a list of genes which are associated with all forms of Diabetes according to OMIM.

The PL_DiabetesGenes dataset is included in the InterMineR package and can also be found online in HumanMine.

Retrieve PL_DiabetesGenes data and get gene identifiers as HumanrMine Gene.symbol and Gene.primaryIdentifier values (ENTREZ IDs).

##         type child_name child_type
## 602     Gene         id           
## 1290 Protein         id           
## 1535     SNP         id
##   Gene.symbol                                 Gene.name
## 1       ABCC8 ATP binding cassette subfamily C member 8
## 2         ACE           angiotensin I converting enzyme
## 3        AKT2             AKT serine/threonine kinase 2
##   Gene.primaryIdentifier Gene.secondaryIdentifier Gene.length
## 1                   6833          ENSG00000006071       83961
## 2                   1636          ENSG00000159640       21320
## 3                    208          ENSG00000105221       55215
##   Gene.organism.name
## 1       Homo sapiens
## 2       Homo sapiens
## 3       Homo sapiens
## [1] "ABCC8" "ACE"   "AKT2"
## [1] "6833" "1636" "208"

2.2 Get enrichment widgets

After obtaining the Gene.id values of interest, we must determine the type of annotation for the enrichment analysis.

To retrieve all available widgets for a Mine we can use the getWidgets function.

##    startClass                           title widgetType
## 1     Protein       Protein Domain Enrichment enrichment
## 2        Gene          Publication Enrichment enrichment
## 3        Gene         Chromosome Distribution      chart
## 4        Gene        Gene Ontology Enrichment enrichment
## 5        Gene              Pathway Enrichment enrichment
## 6         SNP Publication Enrichment for SNPs enrichment
## 7        <NA>                    Interactions      table
## 8         SNP  GWAS study Enrichment for SNPs enrichment
## 9         SNP         Chromosome Distribution      chart
## 10       Gene       Protein Domain Enrichment enrichment
##                                                                                                                                                                                                                       description
## 1                                                                                                                                                                                Protein Domains enriched for items in this list.
## 2                                                                                                                                                                                   Publications enriched for genes in this list.
## 3  Actual: number of items in this list found on each chromosome.  Expected: given the total number of items on the chromosome and the number of items in this list, the number of items expected to be found on each chromosome.
## 4                                                                                                                                                                                       GO terms enriched for items in this list.
## 5                                                                                                                                                          Pathways enriched for genes in this list - data from KEGG and Reactome
## 6                                                                                                                                                                                    Publications enriched for SNPs in this list.
## 7                                                                Genes (from the list or not) that interact with genes in this list.  Counts may include the same interaction more than once if observed in multiple experiments.
## 8                                                                                                                                                                                    GWAS studies enriched for SNPs in this list.
## 9  Actual: number of items in this list found on each chromosome.  Expected: given the total number of items on the chromosome and the number of items in this list, the number of items expected to be found on each chromosome.
## 10                                                                                                                                                                               Protein Domains enriched for items in this list.
##                                                 enrichIdentifier
## 1           proteinDomainRegions.proteinDomain.primaryIdentifier
## 2                                          publications.pubMedId
## 3                                                           <NA>
## 4                   goAnnotation.ontologyTerm.parents.identifier
## 5                                            pathways.identifier
## 6                         GWASResults.study.publication.pubMedId
## 7                                                           <NA>
## 8                         GWASResults.study.publication.pubMedId
## 9                                                           <NA>
## 10 proteins.proteinDomainRegions.proteinDomain.primaryIdentifier
##                                name startClassDisplay
## 1   prot_dom_enrichment_for_protein primaryIdentifier
## 2            publication_enrichment primaryIdentifier
## 3  chromosome_distribution_for_gene              <NA>
## 4            go_enrichment_for_gene primaryIdentifier
## 5                pathway_enrichment primaryIdentifier
## 6        snp_publication_enrichment primaryIdentifier
## 7                      interactions              <NA>
## 8         snp_gwas_study_enrichment primaryIdentifier
## 9   chromosome_distribution_for_snp              <NA>
## 10     prot_dom_enrichment_for_gene primaryIdentifier
##                                              enrich targets
## 1           proteinDomainRegions.proteinDomain.name Protein
## 2                                publications.title    Gene
## 3                                              <NA>    Gene
## 4            goAnnotation.ontologyTerm.parents.name    Gene
## 5                                     pathways.name    Gene
## 6               GWASResults.study.publication.title     SNP
## 7                                              <NA>    Gene
## 8                            GWASResults.study.name     SNP
## 9                                              <NA>     SNP
## 10 proteins.proteinDomainRegions.proteinDomain.name    Gene
##                                                     filters   chartType
## 1                                                      <NA>        <NA>
## 2                                                      <NA>        <NA>
## 3                                      organism.name=[list] ColumnChart
## 4  biological_process,cellular_component,molecular_function        <NA>
## 5              All,KEGG pathways data set,Reactome data set        <NA>
## 6                                                      <NA>        <NA>
## 7                                                      <NA>        <NA>
## 8                                                      <NA>        <NA>
## 9                                      organism.name=[list] ColumnChart
## 10                                                     <NA>        <NA>
##                labels
## 1                <NA>
## 2                <NA>
## 3  Count & Chromosome
## 4                <NA>
## 5                <NA>
## 6                <NA>
## 7                <NA>
## 8                <NA>
## 9  Count & Chromosome
## 10               <NA>

HumanMine provides enrichment for genes, proteins and SNPs, but here we are interested only in the gene-related, enrichment widgets.

##    startClass                     title widgetType
## 2        Gene    Publication Enrichment enrichment
## 4        Gene  Gene Ontology Enrichment enrichment
## 5        Gene        Pathway Enrichment enrichment
## 10       Gene Protein Domain Enrichment enrichment
##                                                               description
## 2                           Publications enriched for genes in this list.
## 4                               GO terms enriched for items in this list.
## 5  Pathways enriched for genes in this list - data from KEGG and Reactome
## 10                       Protein Domains enriched for items in this list.
##                                                 enrichIdentifier
## 2                                          publications.pubMedId
## 4                   goAnnotation.ontologyTerm.parents.identifier
## 5                                            pathways.identifier
## 10 proteins.proteinDomainRegions.proteinDomain.primaryIdentifier
##                            name startClassDisplay
## 2        publication_enrichment primaryIdentifier
## 4        go_enrichment_for_gene primaryIdentifier
## 5            pathway_enrichment primaryIdentifier
## 10 prot_dom_enrichment_for_gene primaryIdentifier
##                                              enrich targets
## 2                                publications.title    Gene
## 4            goAnnotation.ontologyTerm.parents.name    Gene
## 5                                     pathways.name    Gene
## 10 proteins.proteinDomainRegions.proteinDomain.name    Gene
##                                                     filters chartType labels
## 2                                                      <NA>      <NA>   <NA>
## 4  biological_process,cellular_component,molecular_function      <NA>   <NA>
## 5              All,KEGG pathways data set,Reactome data set      <NA>   <NA>
## 10                                                     <NA>      <NA>   <NA>

The column names provides the character strings that can be passed as arguments to the doEnrichment function and thus define the type of enrichment analysis.

2.3 Perform enrichment analysis with InterMineR

We will perform Gene Ontology Enrichment analysis for the genes in our list using the Gene.id values and the ‘go_enrichment_for_gene’ widget.

As mentioned above ‘PL_DiabetesGenes’ constitutes a genelist which already exists in HumanMine. Therefore, the enrichment analysis could also be performed by passing the name of the list to the genelist argument, with the same results:

doEnrichment function returns a list which contains:

  • a data.frame with the results of the enrichment analysis which was performed in the defined InterMine platform. p-values are given after applying the correction algorithm. Count and populationAnnotationCount columns contain the number of genes that belong to each GO term in the list and in the background population respectively.
##   identifier                     description                 pValue count
## 1 GO:0030072       peptide hormone secretion 2.1574571527914352E-19    21
## 2 GO:0046879               hormone secretion  3.151042144650987E-19    22
## 3 GO:0009914               hormone transport   5.03709770698072E-19    22
## 4 GO:0030073               insulin secretion  6.982356406080463E-17    18
## 5 GO:0023061                  signal release  1.305533140658726E-16    22
## 6 GO:0046883 regulation of hormone secretion  1.362659568146168E-16    19
##   populationAnnotationCount
## 1                       240
## 2                       297
## 3                       309
## 4                       199
## 5                       417
## 6                       252
## [1] 695   5
  • the size of the reference background population (populationCount)
## [1] 16368
  • the number of input features that were not included in the enrichment analysis (notAnalyzed)
## [1] 6
  • the name and url of the Mine (im)
## $mine
##                            HumanMine 
## "http://www.humanmine.org/humanmine" 
## 
## $token
## [1] ""
  • the rest of the parameters used to perform the analysis (parameters)
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ids 
## "1111223,1154072,1023066,1289145,1081177,1185614,1233411,1045730,1200810,1000165,1123255,1110592,1240909,1066420,1271723,1058563,1198741,1054723,1103487,1248547,1243559,1185273,1266975,1040092,1096845,1204150,1276769,1158084,1284092,1189851,1045052,1080121,1233076,1036968,1128899,1037607,1033459,1066434,1201550,1102330,1014543,1286771,1052600,1135417,1258182,1263184,1090012,1016985,1143998,1192242,1046839,1191074,1201371,1242073,1118800,1154478,1009851,1129293,1055800,1142038,1085579,1150267,1238219,1023611,1002387,1155942,1221379,1059634" 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            widget 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "go_enrichment_for_gene" 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              maxp 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "0.05" 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        correction 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "Benjamini Hochberg"

2.4 Apply filters on enrichment analysis

Some of the enrichment widgets contain filters which, when applied, limit the annotation types of the enrichment analysis.

In our example, if we want to retrieve only the enriched GO terms in our list of genes that are related to molecular function, we will use the appropriate filter:

## [1] "biological_process,cellular_component,molecular_function"
##   identifier
## 1 GO:0016773
## 2 GO:0003705
## 3 GO:0016772
## 4 GO:0001012
## 5 GO:0000980
## 6 GO:0000977
##                                                                                  description
## 1                                     phosphotransferase activity, alcohol group as acceptor
## 2 transcription factor activity, RNA polymerase II distal enhancer sequence-specific binding
## 3                            transferase activity, transferring phosphorus-containing groups
## 4                                            RNA polymerase II regulatory region DNA binding
## 5                            RNA polymerase II distal enhancer sequence-specific DNA binding
## 6                          RNA polymerase II regulatory region sequence-specific DNA binding
##                  pValue count populationAnnotationCount
## 1 0.0016639782980631742    18                      1364
## 2  0.001788854488949391     6                        92
## 3  0.002130585335160086    20                      1624
## 4 0.0023546706224918355    13                       777
## 5  0.002465654722518649     6                       106
## 6  0.002575586733299186    13                       775
## [1] 20  5

2.5 Apply multiple test correction

To reduce the probability of false positive errors, three different multiple correction algorithms can be applied to the results of the enrichment analysis:

  • Benjamini Hochberg (default)
  • Holm-Bonferroni
  • Bonferroni

The application of one of these algorithms changes the p-values and determines the number of the results which will be returned from the analysis:

## NULL
##   identifier                                           description
## 1  IPR006897 Hepatocyte nuclear factor 1, beta isoform, C-terminal
## 2  IPR023219      Hepatocyte nuclear factor 1, dimerisation domain
## 3  IPR006899               Hepatocyte nuclear factor 1, N-terminal
## 4  IPR006020                                         PTB/PI domain
## 5  IPR000734                         Triacylglycerol lipase family
## 6  IPR013818                                   Lipase/vitellogenin
##                  pValue count populationAnnotationCount
## 1 1.1151399403557156E-5     2                         2
## 2 1.1151399403557156E-5     2                         2
## 3  3.338150019168922E-5     2                         3
## 4  3.285826277100501E-4     3                        40
## 5  4.931622661513312E-4     2                        10
## 6  4.931622661513312E-4     2                        10

3 Visualization of InterMineR Gene Ontology Enrichment analysis results

3.1 Convert InterMineR enrichment analysis results to a GeneAnswer-class object

In order to visualize the InterMineR enrichment analysis results, we will use the function convertToGeneAnswers. This function was created to facilitate the visualization of doEnrichment function results by converting them into a GeneAnswers-class object.

This way we can utilize the functions of the package GeneAnswers to visualize the results of the enrichment analysis and the relations between the features (e.g. genes) and/or the annoatation categories (e.g. GO terms) (Feng et al. 2010, 2012; Huang et al. 2014).

## [1] "GeneAnswers"
## attr(,"package")
## [1] "GeneAnswers"
## This GeneAnswers instance was build from GO based on hyperG test.
## Statistical information of 695 categories with p value less than 0.05 are reported. Other categories are considered as nonsignificant.
## There are 695 categories related to the given 68 genes
## 
## Summary of GeneAnswers instance information:
## 
## Slot: geneInput
##   GeneID
## 1   6833
## 2   1636
## 3    208
## 4  26060
## 5    359
## 6    551
## ......
## 
## Slot: testType
## [1] "hyperG"
## 
## Slot: pvalueT
## [1] 0.05
## 
## Slot: genesInCategory
## $`GO:0030072`
##  [1] "6833"   "640"    "11132"  "9451"   "2645"   "3077"   "6928"   "3172"  
##  [9] "3557"   "3569"   "3630"   "3667"   "8660"   "3710"   "3767"   "4544"  
## [17] "4760"   "3651"   "6514"   "169026" "6934"  
## 
## $`GO:0046879`
##  [1] "6833"   "640"    "11132"  "9451"   "2645"   "3077"   "6928"   "3172"  
##  [9] "3557"   "3569"   "3630"   "3667"   "8660"   "3710"   "3767"   "4544"  
## [17] "4760"   "3651"   "56729"  "6514"   "169026" "6934"  
## 
## $`GO:0009914`
##  [1] "6833"   "640"    "11132"  "9451"   "2645"   "3077"   "6928"   "3172"  
##  [9] "3557"   "3569"   "3630"   "3667"   "8660"   "3710"   "3767"   "4544"  
## [17] "4760"   "3651"   "56729"  "6514"   "169026" "6934"  
## 
## $`GO:0030073`
##  [1] "6833"   "640"    "11132"  "9451"   "2645"   "6928"   "3172"   "3557"  
##  [9] "3667"   "8660"   "3710"   "3767"   "4544"   "4760"   "3651"   "6514"  
## [17] "169026" "6934"  
## 
## $`GO:0023061`
##  [1] "6833"   "640"    "11132"  "9451"   "2645"   "3077"   "6928"   "3172"  
##  [9] "3557"   "3569"   "3630"   "3667"   "8660"   "3710"   "3767"   "4544"  
## [17] "4760"   "3651"   "56729"  "6514"   "169026" "6934"  
## 
## $`GO:0046883`
##  [1] "6833"   "640"    "11132"  "2645"   "3077"   "3172"   "3569"   "3630"  
##  [9] "3667"   "8660"   "3710"   "3767"   "4544"   "4760"   "3651"   "56729" 
## [17] "6514"   "169026" "6934"  
## 
## ......
## 
## Slot: geneExprProfile
## NULL
## 
## Slot: annLib
## [1] "org.Hs.eg.db"
## 
## Slot: categoryType
## [1] "GO"
## 
## Slot: enrichmentInfo
##            genes in Category percent in the observed List
## GO:0030072                21                    0.3088235
## GO:0046879                22                    0.3235294
## GO:0009914                22                    0.3235294
## GO:0030073                18                    0.2647059
## GO:0023061                22                    0.3235294
## GO:0046883                19                    0.2794118
##            percent in the genome fold of overrepresents odds ratio
## GO:0030072            0.01466276               21.06176   30.02553
## GO:0046879            0.01814516               17.83007   25.87923
## GO:0009914            0.01887830               17.13764   24.85564
## GO:0030073            0.01215787               21.77239   29.25045
## GO:0023061            0.02547654               12.69911   18.29434
## GO:0046883            0.01539589               18.14846   24.79786
##                 p value  fdr p value
## GO:0030072 2.157457e-19 2.157457e-19
## GO:0046879 3.151042e-19 3.151042e-19
## GO:0009914 5.037098e-19 5.037098e-19
## GO:0030073 6.982356e-17 6.982356e-17
## GO:0023061 1.305533e-16 1.305533e-16
## GO:0046883 1.362660e-16 1.362660e-16
## ......

GeneAnswers is package designed for the enrichment analysis and visualization of gene lists. It is worth mentioning that the InterMineR filters for the widgets of Gene Ontology and Pathway Enrichment:

## [1] "biological_process,cellular_component,molecular_function"
## [2] "All,KEGG pathways data set,Reactome data set"

match the following available values:

InterMineR widget name InterMineR filter convertToGeneAnswers categoryType
go_enrichment_for_gene biological_process GO.BP
go_enrichment_for_gene cellular_component GO.CC
go_enrichment_for_gene molecular_function GO.MF
pathway_enrichment KEGG pathways data set KEGG
pathway_enrichment Reactome data set REACTOME.PATH

for the categoryType argument of the geneAnswerBuilder function, and can be assigned accordingly in the categoryType argument of the convertToGeneAnswers, therby facilitating the conversion of InterMineR Gene Ontology and Pathway Enrichment analysis results to GeneAnswers-class objects.

## [1] "GeneAnswers"
## attr(,"package")
## [1] "GeneAnswers"
## This GeneAnswers instance was build from GO.MF based on hyperG test.
## Statistical information of 20 categories with p value less than 0.05 are reported. Other categories are considered as nonsignificant.
## There are 20 categories related to the given 68 genes
## 
## Summary of GeneAnswers instance information:
## 
## Slot: geneInput
##   GeneID
## 1   6833
## 2   1636
## 3    208
## 4  26060
## 5    359
## 6    551
## ......
## 
## Slot: testType
## [1] "hyperG"
## 
## Slot: pvalueT
## [1] 0.05
## 
## Slot: genesInCategory
## $`GO:0016773`
##  [1] "1636"  "208"   "551"   "640"   "5611"  "9451"  "2056"  "2645"  "3082" 
## [10] "3569"  "3630"  "3643"  "3667"  "8660"  "9479"  "5770"  "26191" "7422" 
## 
## $`GO:0003705`
## [1] "50943" "3159"  "6928"  "3172"  "5078"  "3651" 
## 
## $`GO:0016772`
##  [1] "1636"  "208"   "551"   "640"   "5611"  "9451"  "2056"  "2645"  "3082" 
## [10] "3569"  "3630"  "3643"  "3667"  "8660"  "9479"  "4938"  "5468"  "5770" 
## [19] "26191" "7422" 
## 
## $`GO:0001012`
##  [1] "50943" "3159"  "6927"  "6928"  "3172"  "8462"  "4760"  "5078"  "3651" 
## [10] "5325"  "5468"  "6925"  "6934" 
## 
## $`GO:0000980`
## [1] "50943" "3159"  "6928"  "3172"  "5078"  "3651" 
## 
## $`GO:0000977`
##  [1] "50943" "3159"  "6927"  "6928"  "3172"  "8462"  "4760"  "5078"  "3651" 
## [10] "5325"  "5468"  "6925"  "6934" 
## 
## ......
## 
## Slot: geneExprProfile
## NULL
## 
## Slot: annLib
## [1] "org.Hs.eg.db"
## 
## Slot: categoryType
## [1] "GO.MF"
## 
## Slot: enrichmentInfo
##            genes in Category percent in the observed List
## GO:0016773                18                   0.26470588
## GO:0003705                 6                   0.08823529
## GO:0016772                20                   0.29411765
## GO:0001012                13                   0.19117647
## GO:0000980                 6                   0.08823529
## GO:0000977                13                   0.19117647
##            percent in the genome fold of overrepresents odds ratio
## GO:0016773           0.083752917               3.160557   3.938358
## GO:0003705           0.005649024              15.619565  17.034362
## GO:0016772           0.099717549               2.949507   3.761802
## GO:0001012           0.047709689               4.007079   4.717843
## GO:0000980           0.006508658              13.556604  14.771759
## GO:0000977           0.047586884               4.017419   4.730628
##                p value fdr p value
## GO:0016773 0.001663978 0.001663978
## GO:0003705 0.001788854 0.001788854
## GO:0016772 0.002130585 0.002130585
## GO:0001012 0.002354671 0.002354671
## GO:0000980 0.002465655 0.002465655
## GO:0000977 0.002575587 0.002575587
## ......

Briefly, in the following sections we present how to use several functions of the GeneAnswers package to visualize the results of the Gene Ontology Enrichment analysis on the PL_DiabetesGenes gene list.

For more information about the usage of GeneAnswers package, the user should look at the respective documentation.

3.2 PieChart and BarPlot graphs

Figure 1: Pie chart of the top five GO terms with the smallest FDR-corrected p-values.

Figure 2: Bar plot of the top five GO terms with the smallest FDR-corrected p-values.