Contents

Introduction

This study explores expression profiles of basal stem-cell enriched cells (B) and committed luminal cells (L) of the mammary gland of virgin, pregnant and lactating mice [1]. Six groups are compared corresponding to a combination of cell type and mouse status. Each group contains two biological replicates. Sequences and counts datasets are publicly available from the Gene Expression Omnibus (GEO) with the serie accession number GSE60450. The RNA-Seq data is analysed by edgeR development team [2].

As described in edgeR user guide, we tested for significant differential expression in gene, using the QL F-test [3]. Here, we focused in gene expression analysis in only one type of cell, i.e. luminal cells for the three developmental status (virgin, pregnant and lactating mice). Among the 15,804 expressed genes, we obtained 7,302 significantly differentially expressed (DE) genes for the comparison virgin versus pregnant, 7,699 for the comparison pregnant versus lactate, and 9,583 for the comparison virgin versus lactate, with Benjamini-Hochberg correction to control the false discovery rate at 5%.

Data

Vignette build convenience (for less build time and package size) need that data were pre-calculated (provided by the package), and that illustrations were not interactive.

1 Genes of interest

We load examples files from ViSEAGO package using system.file from the locally installed package. We read the gene identifiers for the background (= expressed genes) file and the three lists of DE genes of the study. Here, gene identifiers are GeneID from EntrezGene database.

Here, we display the first 6 GeneID from the L_pregnantvslactateDE list.

2 GO annotation of genes

In this study, we build a myGENE2GO object using the Bioconductor org.Mm.eg.db database package for the mouse species. This object contains all available GO annotations for categories Molecular Function (MF), Biological Process (BP), and Cellular Component (CC).

NB: Don’t forget to check if the last current annotation database version is installed in your R session! See ViSEAGO::available_organisms(Bioconductor).



- object class: gene2GO
- database: Bioconductor
- stamp/version: 2018-Oct11
- organism id: org.Mm.eg.db

GO annotations:
- Molecular Function (MF): 22744 annotated genes with 90922 terms (4133 unique terms)
- Biological Process (BP): 23239 annotated genes with 160094 terms (12087 unique terms)
- Cellular Component (CC): 23416 annotated genes with 105430 terms (1727 unique terms)

3 Functional GO enrichment

3.1 GO enrichment tests

We perform a functional Gene Ontology (GO) enrichment analysis from differentially expressed (DE) genes of luminal cells in the mammary gland. The enriched Biological process (BP) are obtained using a Fisher’s exact test with elim algorithm developped in topGO package.

First, we create three topGOdata objects, using ViSEAGO::create_topGOdata method, corresponding to the three DE genes lists for the comparison virgin versus pregnant, pregnant versus lactate, and virgin versus lactate. The gene background corresponding to expressed genes in luminal cells of the mammary gland and GO annotations are also provided.

Now, we perform the GO enrichment tests for BP category with Fisher’s exact test and elim algorithm using topGO::runTest method.

NB: p-values of enriched GO terms are not adjusted and considered significant if below 0.01.

3.2 Combine enriched GO terms

We combine the results of the three enrichment tests into an object using ViSEAGO::merge_enrich_terms method. A table of enriched GO terms in at least one comparison is displayed in interactive mode, or printed in a file using ViSEAGO::show_table method. The printed table contains for each enriched GO terms, additional columns including the list of significant genes and frequency (ratio between the number of significant genes and number of background genes in a specific GO tag) evaluated by comparison.



- object class: gene2GO
- database: Bioconductor
- stamp/version: 2018-Apr4
- organism id: org.Mm.eg.db

GO annotations:
- Molecular Function (MF): 23049 annotated genes with 92018 terms (4118 unique terms)
- Biological Process (BP): 23843 annotated genes with 162583 terms (11881 unique terms)
- Cellular Component (CC): 23583 annotated genes with 102801 terms (1662 unique terms)
> BP_sResults
- object class: enrich_GO_terms
- ontology: BP
- input:
        PregnantvsLactate: elim
        VirginvsLactate: elim
        VirginvsPregnant: elim
- topGO summary:
 PregnantvsLactate
      BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7699
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 198
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        Nontrivial_nodes: 8155 
 VirginvsLactate
      BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 9583
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 151
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        Nontrivial_nodes: 8180 
 VirginvsPregnant
      BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7302
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 232
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        Nontrivial_nodes: 8143 
 
- enrich GOs data.table (p<0.01 in at least one list): 509 GO terms of 3 conditions.
        PregnantvsLactate : 198 terms
        VirginvsLactate : 151 terms
        VirginvsPregnant : 232 terms


bioconductor_table1

3.3 Graphs of GO enrichment tests

Several graphs summarize important features. An interactive barchart showing the number of GO terms enriched or not in each comparison, using ViSEAGO::GOcount method. Intersections of lists of enriched GO terms between comparisons are displayed in an Upset plot using ViSEAGO::Upset method.

gocount

upset

4 GO terms Semantic Similarity

GO annotations of genes created at a previous step and enriched GO terms are combined using ViSEAGO::build_GO_SS method. The Semantic Similarity (SS) between enriched GO terms are calculated using ViSEAGO::compute_SS_distances method which is a wrapper of functions implemented in the GOSemSim package [4]. Here, we choose Wang method based on the topology of GO graph structure. The built object myGOs contains all informations of enriched GO terms and the SS distances between them.




- object class: GO_SS
- database: Bioconductor
- stamp/version: 2018-Apr4
- organism id: org.Mm.eg.db
- ontology: BP
- input:
        PregnantvsLactate: elim
        VirginvsLactate: elim
        VirginvsPregnant: elim
- topGO summary:
 PregnantvsLactate
      BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7699
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 198
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        Nontrivial_nodes: 8155 
 VirginvsLactate
      BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 9583
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 151
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        Nontrivial_nodes: 8180 
 VirginvsPregnant
      BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7302
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 232
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        Nontrivial_nodes: 8143 
 
- enrich GOs data.table: 509 GO terms of 3 conditions.
        PregnantvsLactate : 198 terms
        VirginvsLactate : 151 terms
        VirginvsPregnant : 232 terms
- terms distances:  Wang

5 Visualization and interpretation of enriched GO terms

5.1 Multi Dimensional Scaling of GO terms - A preview

A Multi Dimensional Scale (MDS) plot with ViSEAGO::MDSplot method provides a representation of distances among a set of enriched GO terms on the two first dimensions. Some patterns could appear at this time and could be investigated in the interactive mode. The plot could also be printed in a png file.

mds1

5.2 Clustering heatmap of GO terms

To fully explore the results of this functional analysis, a hierarchical clustering using ViSEAGO::GOterms_heatmap is performed based on Wang SS distance between enriched GO terms and ward.D2 aggregation criteria.

Clusters of enriched GO terms are obtained by cutting branches off the dendrogram. Here, we choose a dynamic branch cutting method based on the shape of clusters using dynamicTreeCut [5,6]. Here, we use parameters to detect small clusters in agreement with the dendrogram structure.

Enriched GO terms are ranked in a dendrogram and colored depending on their cluster assignation. Additional illustrations are displayed: the GO description of terms (trimmed if more than 50 characters), a heatmap of -log10(pvalue) of enrichment test for each comparison, and optionally the Information Content (IC). The IC of a GO term is computed by the negative log probability of the term occurring in the GO annotations database of the studied species. A rarely used term contains a greater amount of IC. The illustration is displayed with ViSEAGO::show_heatmap method.


GOtermsheatmap

A table of enriched GO terms in at least one of the comparison is displayed in interactive mode, or printed in a file using ViSEAGO::show_table method. The columns GO cluster number and IC value are added to the previous table of enriched terms table. The printed table contains for each enriched GO terms, additional columns including the list of significant genes and frequency (ratio between the number of significant genes and number of background genes in a specific GO tag) evaluated by comparison.

bioconductor_table2

NB: For this vignette, this illustration is not interactive.

5.3 Multi Dimensional Scaling of GO terms

We also display a colored Multi Dimensional Scale (MDS) plot showing the overlay of GO terms clusters from Wang_clusters_wardD2 object with ViSEAGO::MDSplot method. It is a way to check the coherence of GO terms clusters on the MDS plot.

mds2

6 Visualization and interpretation of GO clusters

This part is dedicated to explore relationships between clusters of GO terms defined by the last hierarchical clustering with ViSEAGO::GOterms_heatmap method. This analysis should be conducted if the number of clusters of GO terms is large enough and therefore difficult to investigate.

6.1 Compute semantic similarity between GO clusters

A Semantic Similarity (SS) between clusters of GO terms, previously defined, is calculated using ViSEAGO::compute_SS_distances method. Here, we choose the Best-Match Average, also known as BMA method implemented in the GOSemSim package [4]. It calculates the average of all maximum similarities between two clusters of GO terms.

A colored Multi Dimensional Scale (MDS) plot with ViSEAGO::MDSplot method provides a representation of distances between the clusters of GO terms. Each circle represents a cluster of GO terms and its size depends on the number of GO terms that it contains. Clusters of GO terms that are close should share a functional coherence.


mds3

6.2 GO clusters semantic similarities heatmap

A new hierarchical clustering using ViSEAGO::GOclusters_heatmap is performed based on the BMA SS distance between the clusters of GO terms, previously computed, and the ward.D2 aggregation criteria.

Clusters of GO terms are ranked in a dendrogram and colored depending on their cluster assignation. Additional illustrations are displayed: the definition of the cluster of GO terms corresponds to the first common GO term ancestor followed by the cluster label in brackets, and the heatmap of GO terms count in the corresponding cluster. The illustration is displayed with ViSEAGO::show_heatmap method.


BMA

An history of the enrichment functional analysis is reported.


- object class: GO_clusters
- database: Bioconductor
- stamp/version: 2018-Apr4
- organism id: org.Mm.eg.db
- ontology: BP
- input:
        PregnantvsLactate: elim
        VirginvsLactate: elim
        VirginvsPregnant: elim
- topGO summary:
 PregnantvsLactate
      BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7699
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_PregnantvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 198
        feasible_genes: 14402
        feasible_genes_significant: 7185
        genes_nodeSize: 5
        Nontrivial_nodes: 8155 
 VirginvsLactate
      BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 9583
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsLactate 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 151
        feasible_genes: 14402
        feasible_genes_significant: 8898
        genes_nodeSize: 5
        Nontrivial_nodes: 8180 
 VirginvsPregnant
      BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4
        available_genes: 15804
        available_genes_significant: 7302
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        nodes_number: 8189
        edges_number: 18887
      elim_BP_VirginvsPregnant 
        description: Bioconductor org.Mm.eg.db 2018-Apr4 
        test_name: fisher p<0.01
        algorithm_name: elim
        GO_scored: 8189
        GO_significant: 232
        feasible_genes: 14402
        feasible_genes_significant: 6875
        genes_nodeSize: 5
        Nontrivial_nodes: 8143 
 
- enrich GOs data.table: 509 GO terms of 3 conditions.
        PregnantvsLactate : 198 terms
        VirginvsLactate : 151 terms
        VirginvsPregnant : 232 terms
- clusters distances: BMA
- Heatmap:
          * GOterms: TRUE
                    - GO.tree:
                              tree.distance: Wang
                              tree.aggreg.method: ward.D2
                              cut.dynamic.pamStage: TRUE
                              cut.dynamic.pamRespectsDendro: TRUE
                              cut.dynamic.deepSplit: 2
                              cut.dynamic.minClusterSize: 2
                              number of clusters: 56
                              clusters min size: 1
                              clusters mean size: 30
                              clusters max size: 56
                   - sample.tree: FALSE
          * GOclusters: TRUE
                       - tree:
                              distance: BMA
                              aggreg.method: ward.D2

7 Conclusion

A functional Gene Ontology (GO) enrichment analysis was performed using ViSEAGO package, from differentially expressed (DE) genes in luminal cells of the mouse mammary gland. It facilitates the interpretation of biological processes involved between these three comparisons of virgin, pregnant and lactating mice. It provides both a synthetic and detailed view using interactive functionalities respecting the GO graph structure and ensuring functional coherence.

Information session

R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /home/biocbuild/bbs-3.11-bioc/R/lib/libRblas.so
LAPACK: /home/biocbuild/bbs-3.11-bioc/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ViSEAGO_1.2.0    BiocStyle_2.16.0

loaded via a namespace (and not attached):
  [1] bitops_1.0-6           matrixStats_0.56.0     bit64_0.9-7           
  [4] webshot_0.5.2          RColorBrewer_1.1-2     progress_1.2.2        
  [7] httr_1.4.1             UpSetR_1.4.0           dynamicTreeCut_1.63-1 
 [10] tools_4.0.0            R6_2.4.1               DT_0.13               
 [13] KernSmooth_2.23-17     DBI_1.1.0              BiocGenerics_0.34.0   
 [16] lazyeval_0.2.2         colorspace_1.4-1       tidyselect_1.0.0      
 [19] gridExtra_2.3          prettyunits_1.1.1      bit_1.1-15.2          
 [22] curl_4.3               compiler_4.0.0         graph_1.66.0          
 [25] Biobase_2.48.0         TSP_1.1-10             SparseM_1.78          
 [28] plotly_4.9.2.1         bookdown_0.18          topGO_2.40.0          
 [31] caTools_1.18.0         scales_1.1.0           askpass_1.1           
 [34] rappdirs_0.3.1         stringr_1.4.0          digest_0.6.25         
 [37] rmarkdown_2.1          R.utils_2.9.2          AnnotationForge_1.30.0
 [40] pkgconfig_2.0.3        htmltools_0.4.0        dbplyr_1.4.3          
 [43] htmlwidgets_1.5.1      rlang_0.4.5            RSQLite_2.2.0         
 [46] visNetwork_2.0.9       jsonlite_1.6.1         gtools_3.8.2          
 [49] GOSemSim_2.14.0        dendextend_1.13.4      dplyr_0.8.5           
 [52] R.oo_1.23.0            RCurl_1.98-1.2         magrittr_1.5          
 [55] GO.db_3.10.0           Rcpp_1.0.4.6           munsell_0.5.0         
 [58] S4Vectors_0.26.0       viridis_0.5.1          lifecycle_0.2.0       
 [61] R.methodsS3_1.8.0      stringi_1.4.6          yaml_2.2.1            
 [64] MASS_7.3-51.6          gplots_3.0.3           plyr_1.8.6            
 [67] BiocFileCache_1.12.0   grid_4.0.0             blob_1.2.1            
 [70] gdata_2.18.0           parallel_4.0.0         crayon_1.3.4          
 [73] lattice_0.20-41        hms_0.5.3              knitr_1.28            
 [76] pillar_1.4.3           igraph_1.2.5           codetools_0.2-16      
 [79] biomaRt_2.44.0         stats4_4.0.0           XML_3.99-0.3          
 [82] glue_1.4.0             gclus_1.3.2            evaluate_0.14         
 [85] data.table_1.12.8      BiocManager_1.30.10    vctrs_0.2.4           
 [88] foreach_1.5.0          gtable_0.3.0           openssl_1.4.1         
 [91] purrr_0.3.4            tidyr_1.0.2            heatmaply_1.1.0       
 [94] assertthat_0.2.1       ggplot2_3.3.0          xfun_0.13             
 [97] viridisLite_0.3.0      seriation_1.2-8        tibble_3.0.1          
[100] iterators_1.0.12       registry_0.5-1         AnnotationDbi_1.50.0  
[103] memoise_1.1.0          IRanges_2.22.0         cluster_2.1.0         
[106] DiagrammeR_1.0.5       ellipsis_0.3.0        

References

1. Fu NY, Rios AC, Pal B, Soetanto R, Lun AT, Liu K, et al. EGF-mediated induction of Mcl-1 at the switch to lactation is essential for alveolar cell survival. Nat Cell Biol. 2015;17:365–75.

2. Chen Y, McCarthy D, Ritchie M, Robinson M, Smyth GK. EdgeRUsersGuide.

3. Lund SP, Nettleton D, McCarthy DJ, Smyth GK. Detecting differential expression in RNA-sequence data using quasi-likelihood with shrunken dispersion estimates. Stat Appl Genet Mol Biol. 2012;11.

4. Yu G, Li F, Qin Y, Bo X, Wu Y, Wang S. GOSemSim: an R package for measuring semantic similarity among GO terms and gene products. Bioinformatics. 2010;26:976–8.

5. Langfelder P, Zhang B, Horvath S. Defining clusters from a hierarchical cluster tree: the Dynamic Tree Cut package for R. Bioinformatics. 2008;24:719–20.

6. Langfelder P, Zhang B, Steve Horvath. DynamicTreeCut: Methods for detection of clusters in hierarchical clustering dendrograms [Internet]. 2016. Available from: https://CRAN.R-project.org/package=dynamicTreeCut