To be done before publication

6.1 Project summary

  • Customer Karine GALLARDO
  • Email karine.gallardo-guerrero@inrae.fr
  • Sample Type human RNA
  • Application mRNA sequencing via polyA selection
  • Quote Number 50-595289658
  • Configuration HiSeq 2x150bp HiSeq 2x150bp

6.2 Description of workflow

6.2.1 RNA-seq Library Prepraration Workflow

6.2.2 Bioinformatics Analysis Workflow

6.3 Mapping sequence reads to the reference genome

Sequence reads were trimmed to remove possible adapter sequences and nucleotides with poor quality using Trimmomatic v.0.36. The trimmed reads were mapped to the Pisum_sativum reference genome available on ENSEMBL using the STAR aligner v.2.5.2b. The STAR aligner is a splice aligner that detects splice junctions and incorporates them to help align the entire read sequences. BAM files were generated as a result of this step. Below are the statistics of mapping the reads to the reference genome.

Code
#pkg 
library(tidyverse)
library(patchwork)
library(readxl)

# src
source(here::here("src/function/stat_function/stat_analysis_main.R")) # for make plot 
source(here::here("src/function/fig_export.R")) # This function saves a given plot (plot_x) as both a PDF and a high-resolution PNG file at specified dimensions.

# cosmetics
pallet=read_excel(here::here("data/color_palette.xlsm")) %>%
      filter(set == "edaphic_condition") %>%
      dplyr::select(color, treatment) %>%
      pull(color) %>%
      setNames(read_excel(here::here("data/color_palette.xlsm")) %>%
                 filter(set == "edaphic_condition") %>%
                 pull(treatment)
               )
Code
sample_info<-read_excel(here::here("data/rnaseq/50-595289658_NGSBI_Completed_file_send to GENEWIZ_2021-12-22.xlsx"), sheet = "Groupings", skip = 2) %>% 
  filter(!`Sample Name` %in% c("Vegetative leaves", "Roots")) %>% 
  dplyr::rename(sample_id = "Sample Name", 
                group = "Groupings (i.e. biological replicates)") %>% 
  dplyr::select(sample_id, group) %>% 
  tidyr::separate(group, into = c("compartment", "sampling", "genotype", "water_condition", "sulfur_condition"), sep = "_") %>% 
    dplyr::mutate(genotype = case_when(
        genotype %in% "2684" ~ "W78*",
        genotype %in% "4693" ~ "E568K",
        genotype %in% "CAM2684" ~ "WT1",
        genotype %in% "CAM4693" ~ "WT2", 
        genotype %in% "KAY" ~ "KAY"),
        genotype = forcats::fct_relevel(genotype, "KAY", "WT1", "W78*", "WT2", "E568K"),
        water_condition = forcats::fct_relevel(water_condition, "WW", "WS"),
        condition = paste(sep = "_", genotype, sulfur_condition), 
        sulfur_condition = forcats::fct_relevel(sulfur_condition, "SS", "SD"),
        sampling = forcats::fct_relevel(sampling, "E0", "E1", "E2"),
        edaphic_condition = paste(sep = "_", water_condition, sulfur_condition), 
        edaphic_condition = forcats::fct_relevel(edaphic_condition, "WW_SS", "WW_SD", "WS_SS", "WS_SD")
  )

mapping_resum_r<- read_csv(file = here::here("data/rnaseq/AZENTA RNA-Seq Analysis Report.csv"), show_col_types = FALSE) %>% 
   dplyr::rename(c("Unique_mapped_reads" = `% Unique Mapped Reads` ,
                   "Total_reads" = `Total Reads`,
                   "sample_id" = `Sample ID`)) %>% 
  left_join(., sample_info, by = "sample_id") %>% 
  filter(compartment == "R") %>% 
  as.data.frame()

mapping_resum_vl<- read_csv(file = here::here("data/rnaseq/AZENTA RNA-Seq Analysis Report.csv"), show_col_types = FALSE) %>% 
   dplyr::rename(c("Unique_mapped_reads" = `% Unique Mapped Reads` ,
                   "Total_reads" = `Total Reads`,
                   "sample_id" = `Sample ID`)) %>% 
  left_join(., sample_info, by = "sample_id") %>% 
  filter(compartment == "VL") %>% 
  as.data.frame()

plot_unique_r=stat_analyse(
    data=mapping_resum_r,
    column_value = "Unique_mapped_reads",
    category_variables = c("edaphic_condition"),
    grp_var = "genotype",
    show_plot = T,
    outlier_show = T, 
    label_outlier = "sample_id",
    biologist_stats = T,
    Ylab_i = paste0("Unique Mapped Reads for root"),
  control_conditions = c("WW_SS"),
  hex_pallet = pallet,
  strip_normale = F
)

plot_unique_vl=stat_analyse(
    data=mapping_resum_vl,
    column_value = "Unique_mapped_reads",
    category_variables = c("edaphic_condition"),
    grp_var = "genotype",
    show_plot = T,
    outlier_show = T, 
    label_outlier = "sample_id",
    biologist_stats = T,
    Ylab_i = paste0("Unique Mapped Reads for vegetative leaves"),
  control_conditions = c("WW_SS"),
  hex_pallet = pallet,
  strip_normale = F
)

plot_total_r=stat_analyse(
    data=mapping_resum_r,
    column_value = "Total_reads",
    category_variables = "edaphic_condition",
    grp_var = "genotype",
    show_plot = T,
    outlier_show = T, 
    label_outlier = "sample_id",
    biologist_stats = T,
    Ylab_i = paste0("Total Mapped Reads for root"),
  control_conditions = c("WW_SS"),
  hex_pallet = pallet,
  strip_normale = F
)

plot_total_vl=stat_analyse(
    data=mapping_resum_vl,
    column_value = "Total_reads",
    category_variables = "edaphic_condition",
    grp_var = "genotype",
    show_plot = T,
    outlier_show = T, 
    label_outlier = "sample_id",
    biologist_stats = T,
    Ylab_i = paste0("Total Mapped Reads for vegetative leaves"),
  control_conditions = c("WW_SS"),
  hex_pallet = pallet,
  strip_normale = F
)

plot_unique_r = plot_unique_r[["plot"]]+labs(color="Treatment",fill="Treatment")
plot_unique_vl = plot_unique_vl[["plot"]]+labs(color="Treatment",fill="Treatment")
plot_total_r = plot_total_r[["plot"]]+labs(color="Treatment",fill="Treatment")
plot_total_vl = plot_total_vl[["plot"]]+labs(color="Treatment",fill="Treatment") 
            

px=(plot_unique_r + plot_unique_vl) / (plot_total_r + plot_total_vl) + plot_layout(guides = "collect") & theme(legend.position = "bottom")

#export to delet

fig_export(path = here::here("report/rnaseq/plot/mapped_reads_performance"), px, height = 10, width = 12)

6.4 Extracting gene hit counts

Unique gene hit counts were calculated by using featureCounts from the Subread package v.1.5.2. The hit counts were summarized and reported using the gene_id feature in the annotation file. Only unique reads that fell within exon regions were counted.