RESTORBIOME2: Volcano plot

Experiment with BU

Authors
Affiliation

Olivier Rué

Migale bioinformatics facility

Christelle Hennequet-Antier

Migale bioinformatics facility

Published

May 2, 2023

Modified

February 19, 2025

Show the code
#Use packages and functions
#Use packages and functions
library(ExperimentSubset)
library(dplyr)
library(purrr)
library(stringr)
library(EnhancedVolcano)
library(RColorBrewer)
library(colorspace)
library(openxlsx) # manipulation excel files

We used results from differential analysis performed on BU experiment using edgeR R package.

Show the code
nameEXP <- params$my.interest
my.files <- list.files(path = "../html") %>% 
  str_subset(., "G.xlsx$") %>%
  str_subset(., params$my.interest)

# load DE results
# cat("Experiment ", params$my.interest)

Volcano plots

Volcano plots represent a useful way to visualise the results of differential expression analyses. The x-axis is log2 fold change and represents biological significance. The y-axis is -Log10 (adjusted Pvalue) of the contrast tested and represents statistical significance. The highest genes on the graph are the most significantly differentially expressed (DE) genes.

Volcano plots were performed with EnhancedVolcano R package.

Here Volcano plot with annotation given by cazyMod and pulPredcolumns if available.

Show the code
 if (nameEXP == "BU") {

for( ctr in 1:length(my.files)){
  res <- read.xlsx(xlsxFile = paste0("../html/",my.files[ctr]), sheet = 1)
  my.title <- my.files[ctr] %>% str_remove(., ".xlsx")
  
  # p1 <- EnhancedVolcano(res,
  #               lab = res$Gene_ID,
  #               labSize = 0.0,  # if zero then no label
  #               x = 'log2FoldChange',
  #               y = 'padj',
  #               FCcutoff = 1,
  #               title = my.title)
  # print(p1)

  p3 <- EnhancedVolcano(res,
                lab = res$cazyMod,
                x = 'log2FoldChange',
                y = 'padj',
                FCcutoff = 1,
                title = paste(my.title, " with cazyMod annotation"))
  print(p3)
  
  p4 <- EnhancedVolcano(res,
                lab = res$pulPred,
                x = 'log2FoldChange',
                y = 'padj',
                FCcutoff = 1,
                title = paste(my.title, " with pulPred annotation"))
  print(p4)  
  

  # table of cazy genes
  pul <- res %>% filter(! is.na(pulPred))
  cazy <- res %>% filter(! is.na(cazyMod))

  # using openxlsx package to export results
  excelsheets <- list(complete = res, 
                    pul = pul, 
                    cazy = cazy) 

  write.xlsx(excelsheets, file = paste0("../html/",
                  my.title,"_cazy_pul.xlsx"))
} # End for
  
  } else {
    
  for( ctr in 1:length(my.files)){
  res <- read.xlsx(xlsxFile = paste0("../html/",my.files[ctr]), sheet = 1)
  my.title <- my.files[ctr] %>% str_remove(., ".xlsx")
  
      # p1 <- EnhancedVolcano(res,
  #               lab = res$Gene_ID,
  #               labSize = 0.0,  # if zero then no label
  #               x = 'log2FoldChange',
  #               y = 'padj',
  #               FCcutoff = 1,
  #               title = my.title)
  # print(p1)

  p3 <- EnhancedVolcano(res,
                lab = res$cazyMod,
                x = 'log2FoldChange',
                y = 'padj',
                FCcutoff = 1,
                title = paste(my.title, " with cazyMod annotation"))
  print(p3)

  # table of cazy genes
  # pul <- res %>% filter(! is.na(pulPred))
  cazy <- res %>% filter(! is.na(cazyMod))

  # using openxlsx package to export results
  excelsheets <- list(complete = res, 
                    # pul = pul, 
                    cazy = cazy) 

  write.xlsx(excelsheets, file = paste0("../html/",
                  my.title,"_cazy.xlsx"))
  }  # End for
  } # End  else

Reproducibility token

Show the code
sessioninfo::session_info(pkgs = "attached")
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.2 (2024-10-31)
 os       Ubuntu 24.04.1 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  fr_FR.UTF-8
 ctype    fr_FR.UTF-8
 tz       Europe/Paris
 date     2025-02-14
 pandoc   3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package                  * version date (UTC) lib source
 Biobase                  * 2.64.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 BiocGenerics             * 0.50.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 Biostrings               * 2.72.1  2024-06-02 [1] Bioconductor 3.19 (R 4.4.0)
 colorspace               * 2.1-1   2024-07-26 [1] CRAN (R 4.4.0)
 dplyr                    * 1.1.4   2023-11-17 [1] CRAN (R 4.4.0)
 EnhancedVolcano          * 1.22.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.2)
 ExperimentSubset         * 1.14.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.2)
 GenomeInfoDb             * 1.40.1  2024-05-24 [1] Bioconductor 3.19 (R 4.4.0)
 GenomicRanges            * 1.56.2  2024-10-09 [1] Bioconductor 3.19 (R 4.4.1)
 ggplot2                  * 3.5.1   2024-04-23 [1] CRAN (R 4.4.0)
 ggrepel                  * 0.9.6   2024-09-07 [1] CRAN (R 4.4.1)
 IRanges                  * 2.38.1  2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
 MatrixGenerics           * 1.16.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
 matrixStats              * 1.5.0   2025-01-07 [1] CRAN (R 4.4.2)
 openxlsx                 * 4.2.8   2025-01-25 [1] CRAN (R 4.4.2)
 purrr                    * 1.0.2   2023-08-10 [1] CRAN (R 4.4.0)
 RColorBrewer             * 1.1-3   2022-04-03 [1] CRAN (R 4.4.0)
 S4Vectors                * 0.42.1  2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
 SingleCellExperiment     * 1.26.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.2)
 SpatialExperiment        * 1.14.0  2024-05-01 [1] Bioconductor 3.19 (R 4.4.2)
 stringr                  * 1.5.1   2023-11-14 [1] CRAN (R 4.4.0)
 SummarizedExperiment     * 1.34.0  2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 TreeSummarizedExperiment * 2.12.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.2)
 XVector                  * 0.44.0  2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)

 [1] /home/orue/R/x86_64-pc-linux-gnu-library/4.4
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

──────────────────────────────────────────────────────────────────────────────

References

Reuse

This document will not be accessible without prior agreement of the partners

A work by Migale Bioinformatics Facility
Université Paris-Saclay, INRAE, MaIAGE, 78350, Jouy-en-Josas, France
Université Paris-Saclay, INRAE, BioinfOmics, MIGALE bioinformatics facility, 78350, Jouy-en-Josas, France