Last updated: 2021-11-27

Checks: 6 1

Knit directory: 2021_MPSIIIBvQ96-RNAseq-7dpfLarve/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20211120) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 482cbf7. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rapp.history
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/.DS_Store
    Ignored:    data/fastqc_align/.DS_Store
    Ignored:    data/fastqc_raw/.DS_Store
    Ignored:    data/fastqc_trim/.DS_Store
    Ignored:    data/starAlignLog/.DS_Store

Untracked files:
    Untracked:  code/mergeFiles.sh
    Untracked:  data/fastqc_align_dedup/
    Untracked:  data/featureCounts/
    Untracked:  data/meta/

Unstaged changes:
    Modified:   analysis/QC.Rmd
    Modified:   data/fastqc_align/21-01528_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01528_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01529_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01529_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01530_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01530_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01531_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01531_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01532_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01532_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01533_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01533_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01534_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01534_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01535_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01535_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01536_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01536_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01539_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01539_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01540_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01540_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01541_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01541_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01542_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01542_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01543_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01543_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01544_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01544_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01545_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01545_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01548_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01548_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01549_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01549_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01551_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01551_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01552_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01552_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01553_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01553_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01554_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01554_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01555_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01555_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/fastqc_align/21-01556_S1_merged.Aligned.sortedByCoord.out_fastqc.html
    Modified:   data/fastqc_align/21-01556_S1_merged.Aligned.sortedByCoord.out_fastqc.zip
    Modified:   data/starAlignLog/21-01528_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01528_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01528_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01529_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01529_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01529_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01530_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01530_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01530_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01531_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01531_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01531_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01532_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01532_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01532_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01533_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01533_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01533_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01534_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01534_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01534_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01535_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01535_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01535_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01536_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01536_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01536_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01539_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01539_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01539_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01540_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01540_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01540_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01541_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01541_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01541_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01542_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01542_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01542_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01543_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01543_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01543_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01544_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01544_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01544_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01545_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01545_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01545_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01548_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01548_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01548_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01549_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01549_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01549_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01551_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01551_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01551_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01552_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01552_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01552_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01553_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01553_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01553_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01554_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01554_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01554_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01555_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01555_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01555_S1_merged.Log.progress.out
    Modified:   data/starAlignLog/21-01556_S1_merged.Log.final.out
    Modified:   data/starAlignLog/21-01556_S1_merged.Log.out
    Modified:   data/starAlignLog/21-01556_S1_merged.Log.progress.out

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/QC.Rmd) and HTML (docs/QC.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 482cbf7 Karissa Barthelson 2021-11-24 second commit

Introduction

library(tidyverse)
library(magrittr)
library(readxl)
library(ngsReports)
library(AnnotationHub)
library(pander)
library(scales)
library(pheatmap)
library(ggpubr)

theme_set(theme_bw())
ah <- AnnotationHub() %>%
    subset(species == "Danio rerio") %>%
    subset(rdataclass == "EnsDb")

ensDb <- ah[["AH83189"]] # for release 101, latest version and the alignment
grTrans <- transcripts(ensDb)
trLengths <- exonsBy(ensDb, "tx") %>%
    width() %>%
    vapply(sum, integer(1))
mcols(grTrans)$length <- trLengths[names(grTrans)]
gcGene <- grTrans %>%
  mcols() %>%
  as.data.frame() %>%
  dplyr::select(gene_id, tx_id, gc_content, length) %>%
  as_tibble() %>%
  group_by(gene_id) %>%
  summarise(
    gc_content = sum(gc_content*length) / sum(length),
    length = ceiling(median(length))
  )
grGenes <- genes(ensDb)
mcols(grGenes) %<>%
  as.data.frame() %>%
  left_join(gcGene) %>%
  as.data.frame() %>%
  DataFrame()
meta <- read_excel("data/meta/naglu_v_Q96_larvae_metadata.xlsx", sheet = 3) %>% 
  na.omit() %>% 
  left_join(read_excel("data/meta/naglu_v_Q96_larvae_metadata.xlsx", sheet = 5) %>% 
              mutate(temp1 = str_split(temp, pattern = " ")) %>% 
              mutate(ULN = lapply(temp1, function(x){
                x %>% 
                  .[1]
              }), 
              sample_name =  lapply(temp1, function(x){
                x %>% 
                  .[2]
              }), 
              RIN = lapply(temp1, function(x){
                x %>% 
                  .[4]
              })
              ) %>% 
              unnest() %>% 
              dplyr::select(ULN, sample_name, RIN) %>% 
              na.omit() %>% 
              unique
  ) %>% 
  mutate(Genotype = case_when(
    `naglu genotype` == "wt" & `psen1 genotype` == "wt" ~ "wt",
    `naglu genotype` == "A603fs/A603fs" & `psen1 genotype` == "wt" ~ "MPS-IIIB",
    `naglu genotype` == "wt" & `psen1 genotype` == "Q96_K97del/+" ~ "EOfAD-like",
  ) %>% 
    factor(levels = c("wt", "MPS-IIIB", "EOfAD-like")))

Here, I will assess the quality of the RNA-seq data for the psen1 Q96_K97del/+ vs naglu A603fs/A603fs experiment on zebrafish larvae at 7 days post fertilisation (dpf).

Total RNA was purified from the head end of the individual larvae, while the tail end was used for gDNA extraction and PCR genotyping. The total RNA was DNase treated (to remove any genomic DNA which was carried over from the RNA extraction), then delivered to SAGC for polyA+ library preparation and sequencing using the MGI DNBSEQ technology.

The sequencing was performed over four lanes which were subsequently merged. This was done using the merge.sh script shown below.

## Insert the merge files script here
readLines("code/mergeFiles.sh") %>% 
  cat(sep = "\n")
#!/bin/bash
#SBATCH -p batch
#SBATCH -N 1
#SBATCH -n 8
#SBATCH --time=0-01:00:00
#SBATCH --mem=16GB
#SBATCH --mail-type=END
#SBATCH --mail-type=FAIL
#SBATCH --mail-user=karissa.barthelson@adelaide.edu.au

##Params
mkdir /hpcfs/users/a1211024/q96-v-naglu7dpf/temp
FASTDATA1=/hpcfs/users/a1211024/q96-v-naglu7dpf/V350030606
TEMP=/hpcfs/users/a1211024/q96-v-naglu7dpf/temp
FASTOUT=/hpcfs/users/a1211024/q96-v-naglu7dpf/fastq

## Concatenating the F reads 
for R1 in ${FASTDATA1}/*_1_R1_001.fastq.gz
  do

# Define the other lanes
  R2=${R1%_1_R1_001.fastq.gz}_2_R1_001.fastq.gz
  R3=${R1%_1_R1_001.fastq.gz}_3_R1_001.fastq.gz
  R4=${R1%_1_R1_001.fastq.gz}_4_R1_001.fastq.gz
  CATNAME=$(basename ${R1%_1_R1_001.fastq.gz})
  echo -e "cat will merge:\t${R1}\n\t${R2}\n\t${R3}\n\t${R4}"
  echo -e "New file name will be:\t${TEMP}/${CATNAME}_merged_R1_001.fastq.gz"
  cat ${R1} ${R2} ${R3} ${R4} > ${TEMP}/${CATNAME}_merged_R1_001.fastq.gz

  done


## Concatenating the R reads 
for R1 in ${FASTDATA1}/*_1_R2_001.fastq.gz
  do

# Define the other lanes
  R2=${R1%_1_R2_001.fastq.gz}_2_R2_001.fastq.gz
  R3=${R1%_1_R2_001.fastq.gz}_3_R2_001.fastq.gz
  R4=${R1%_1_R2_001.fastq.gz}_4_R2_001.fastq.gz
  CATNAME=$(basename ${R1%_1_R2_001.fastq.gz})
  echo -e "cat will merge:\t${R1}\n\t${R2}\n\t${R3}\n\t${R4}"
  echo -e "New file name will be:\t${TEMP}/${CATNAME}_merged_R2_001.fastq.gz"
  cat ${R1} ${R2} ${R3} ${R4} > ${TEMP}/${CATNAME}_merged_R2_001.fastq.gz

  done


# ## Move the merged files from temp -  fastq
mkdir 01_rawdata
mkdir 01_rawdata/fastq

mv ${TEMP}/*fastq.gz 01_rawdata/fastq

# remove the temp files/dirs
rm ${TEMP}/*.*
rmdir ${TEMP}

fastqc: raw data

Here, I will use the ngsReports package to combine and visualise the fastqc results.

fastqc_raw <- list.files(
  path = "data/fastqc_raw",
  pattern = "zip", 
  recursive = TRUE,
  full.names = TRUE) %>% 
  FastqcDataList()

The total number of reads ranged between 60,101,550 and 76,097,954 reads. Note that the number of reads in the R1 file indeed equals to the number of reads in the R2 file.

readTotals(fastqc_raw) %>% 
  mutate(Read = case_when(
    grepl(Filename, pattern = "_R1") ~ "R1", 
    grepl(Filename, pattern = "_R2") ~ "R2"
  ), 
  ULN = str_remove(Filename, "_S1_merged.+")
  ) %>% 
  left_join(meta) %>% 
  ggplot(aes(x = ULN, y = Total_Sequences, fill = Read)) + 
           geom_col(position = "dodge") +
  coord_flip() +
  scale_fill_viridis_d(end = 0.8) +
  facet_wrap(~Genotype, scales = "free_y", ncol = 1, strip.position = "right")

The base quality of all the reads also looked good. However, something a bit strange is going on in the sample 21-015556 file R2 file. Inspecting the boxplot for this file and it looks OK to me.

plotBaseQuals(fastqc_raw)

plotBaseQuals(fastqc_raw[44])

plotBaseQuals(fastqc_raw[44], plotType = "boxplot")

GC Content

All samples have similar GC content. No issues are present.

plotGcContent(
  x = fastqc_raw, 
  plotType = "line",
  gcType = "Transcriptome", 
  species = "Drerio", 
  usePlotly = TRUE
) +
  theme(legend.position = "none")
NULL

Over-repreented seq

No over-represented sequences are present in this dataset.

getModule(fastqc_raw, "Overrep") 
# A tibble: 0 x 0

trimmed data fastQC

The raw fastq. files were then processed with fastp. In this step, the adaptor sequeces were trimmed from the reads. Then all length and quality filters were left as default values. Less than 1% of the reads was discarded, and no observed changes are apparent in the %GC in the reads.

fastqc_trim <- list.files(path = "data/fastqc_trim",
  pattern = "zip", 
  recursive = TRUE,
  full.names = TRUE) %>% 
  FastqcDataList()
trimStats <- readTotals(fastqc_raw) %>%
  dplyr::rename(Raw = Total_Sequences) %>%
  left_join(readTotals(fastqc_trim), by = "Filename") %>%
  dplyr::rename(Trimmed = Total_Sequences) %>%
  mutate(
    Discarded = 1 - Trimmed / Raw,
    Retained = Trimmed / Raw
  )

trimStats %>% 
  mutate(ULN = str_remove(Filename, "_S1_merged.+")
  ) %>% 
  left_join(meta) %>% 
  unique() %>% 
  ggplot(aes(y = ULN)) +
  geom_col(aes(x = Discarded*100)) +
  facet_wrap(~Genotype, scales = "free_y", ncol = 1, strip.position = "right") +
  labs(x = "Percentage reads discarded by fastp")

ggarrange(
  plotGcContent(
    x = fastqc_raw, 
    plotType = "line",
    gcType = "Transcriptome", 
    species = "Drerio"
  ) +
    theme(legend.position = "none") +
    ggtitle("Before fastp"), 
  plotGcContent(
  x = fastqc_trim, 
  plotType = "line",
  gcType = "Transcriptome", 
  species = "Drerio"
) +
  theme(legend.position = "none")+
  ggtitle("After fastp")
) 

Aligned QC

The reads were aligned to the GRCz11 genome. The majority of reads were aligned uniquely. S

fastqc_align <- list.files(
  path = "data/fastqc_align",
  pattern = "zip", 
  recursive = TRUE,
  full.names = TRUE) %>% 
  FastqcDataList()
list.files("data/starAlignLog", full.names = TRUE) %>% 
  .[grepl(x = ., pattern = "Log.final.out")] %>% 
  ngsReports::plotAlignmentSummary(type = "star") +
  scale_fill_viridis_d(end = 0.8) +
  theme(legend.position = "right") +
  ggtitle("Summary of alignment (STAR)", 
          subtitle = "In all samples, the majority of reads mapped uniquely to the zebrafish genome.")

plotGcContent(x = fastqc_align, 
    plotType = "line",
    gcType = "Transcriptome", 
    species = "Drerio"
  ) +
  theme(legend.position = "none") 

Dedup align QC

This dataset was processed with UMIs, which allow PCR duplicates to be removed. I did this using umi-tools. After de-duplciation ** reads were retained.

fastqc_align_dedup <- list.files(
  path = "data/fastqc_align_dedup",
  pattern = "zip", 
  recursive = TRUE,
  full.names = TRUE) %>% 
  FastqcDataList()
readTotals(fastqc_align) %>% 
  mutate(align = "raw") %>% 
  bind_rows(readTotals(fastqc_align_dedup) %>% 
              mutate(align = "dedup")) %>% 
  mutate(ULN = str_remove(Filename, "_S1_merged.+")) %>% 
  left_join(meta) %>% 
  ggplot(aes(x = ULN, y = Total_Sequences, fill = align)) + 
           geom_col(position = "dodge") +
  coord_flip() +
  scale_fill_viridis_d(end = 0.8) +
  scale_y_continuous(labels = comma) +
  facet_wrap(~Genotype, scales = "free_y", ncol = 1, strip.position = "right")

FeatureCounts summary

FC_summary <- read.delim("data/featureCounts/counts.out.summary")
  
colnames(FC_summary) %<>% 
  str_remove(pattern = "_S1_merged.Aligned.sortedByCoord.dedup.out.bam") %>% 
  str_remove(pattern = "X04_dedup.bam.") %>% 
  str_replace(pattern = "\\.", replacement = "\\-")

FC_summary %>% 
 gather(key = "ULN", value = "NumReads", starts_with("21")) %>% 
  left_join(meta) %>% 
  as_tibble() %>% 
  dplyr::filter(NumReads > 0) %>%   
  ggplot(aes(y = ULN, x = NumReads, fill = Status)) +
  geom_col() +
  scale_fill_viridis_d(end = 0.8) +
  scale_x_continuous(labels = comma) +
  facet_wrap(~Genotype, scales = "free_y", ncol = 1, strip.position = "right")


sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.3

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
 [1] ensembldb_2.12.1        AnnotationFilter_1.12.0 GenomicFeatures_1.40.1 
 [4] AnnotationDbi_1.50.3    Biobase_2.48.0          GenomicRanges_1.40.0   
 [7] GenomeInfoDb_1.24.2     IRanges_2.22.2          S4Vectors_0.26.1       
[10] ggpubr_0.4.0            pheatmap_1.0.12         scales_1.1.1           
[13] pander_0.6.4            AnnotationHub_2.20.2    BiocFileCache_1.12.1   
[16] dbplyr_2.1.1            ngsReports_1.4.2        BiocGenerics_0.34.0    
[19] readxl_1.3.1            magrittr_2.0.1          forcats_0.5.1          
[22] stringr_1.4.0           dplyr_1.0.7             purrr_0.3.4            
[25] readr_1.4.0             tidyr_1.1.3             tibble_3.1.2           
[28] ggplot2_3.3.5           tidyverse_1.3.1        

loaded via a namespace (and not attached):
  [1] backports_1.2.1               workflowr_1.6.2              
  [3] plyr_1.8.6                    lazyeval_0.2.2               
  [5] crosstalk_1.1.1               BiocParallel_1.22.0          
  [7] digest_0.6.27                 htmltools_0.5.1.1            
  [9] fansi_0.5.0                   memoise_2.0.0                
 [11] cluster_2.1.2                 openxlsx_4.2.4               
 [13] Biostrings_2.56.0             modelr_0.1.8                 
 [15] matrixStats_0.59.0            askpass_1.1                  
 [17] prettyunits_1.1.1             jpeg_0.1-8.1                 
 [19] colorspace_2.0-2              blob_1.2.1                   
 [21] rvest_1.0.0                   rappdirs_0.3.3               
 [23] ggrepel_0.9.1                 haven_2.4.1                  
 [25] xfun_0.24                     crayon_1.4.1                 
 [27] RCurl_1.98-1.3                jsonlite_1.7.2               
 [29] zoo_1.8-9                     glue_1.4.2                   
 [31] gtable_0.3.0                  zlibbioc_1.34.0              
 [33] XVector_0.28.0                DelayedArray_0.14.1          
 [35] car_3.0-11                    abind_1.4-5                  
 [37] DBI_1.1.1                     rstatix_0.7.0                
 [39] Rcpp_1.0.7                    progress_1.2.2               
 [41] viridisLite_0.4.0             xtable_1.8-4                 
 [43] foreign_0.8-81                flashClust_1.01-2            
 [45] bit_4.0.4                     DT_0.18                      
 [47] truncnorm_1.0-8               htmlwidgets_1.5.3            
 [49] httr_1.4.2                    RColorBrewer_1.1-2           
 [51] ellipsis_0.3.2                farver_2.1.0                 
 [53] XML_3.99-0.6                  pkgconfig_2.0.3              
 [55] sass_0.4.0                    utf8_1.2.1                   
 [57] labeling_0.4.2                tidyselect_1.1.1             
 [59] rlang_0.4.11                  reshape2_1.4.4               
 [61] later_1.2.0                   munsell_0.5.0                
 [63] BiocVersion_3.11.1            cellranger_1.1.0             
 [65] tools_4.0.2                   cachem_1.0.5                 
 [67] cli_3.0.0                     generics_0.1.0               
 [69] RSQLite_2.2.7                 broom_0.7.8                  
 [71] evaluate_0.14                 fastmap_1.1.0                
 [73] ggdendro_0.1.22               yaml_2.2.1                   
 [75] knitr_1.33                    bit64_4.0.5                  
 [77] fs_1.5.0                      zip_2.2.0                    
 [79] whisker_0.4                   mime_0.11                    
 [81] leaps_3.1                     xml2_1.3.2                   
 [83] biomaRt_2.44.4                compiler_4.0.2               
 [85] rstudioapi_0.13               plotly_4.9.4.1               
 [87] curl_4.3.2                    png_0.1-7                    
 [89] interactiveDisplayBase_1.26.3 ggsignif_0.6.2               
 [91] reprex_2.0.0                  bslib_0.2.5.1                
 [93] stringi_1.6.2                 highr_0.9                    
 [95] lattice_0.20-44               ProtGenerics_1.20.0          
 [97] Matrix_1.3-4                  vctrs_0.3.8                  
 [99] pillar_1.6.1                  lifecycle_1.0.0              
[101] BiocManager_1.30.16           jquerylib_0.1.4              
[103] cowplot_1.1.1                 data.table_1.14.0            
[105] bitops_1.0-7                  rtracklayer_1.48.0           
[107] httpuv_1.6.1                  R6_2.5.0                     
[109] latticeExtra_0.6-29           hwriter_1.3.2                
[111] promises_1.2.0.1              ShortRead_1.46.0             
[113] rio_0.5.27                    MASS_7.3-54                  
[115] assertthat_0.2.1              SummarizedExperiment_1.18.2  
[117] openssl_1.4.4                 rprojroot_2.0.2              
[119] withr_2.4.2                   GenomicAlignments_1.24.0     
[121] Rsamtools_2.4.0               GenomeInfoDbData_1.2.3       
[123] hms_1.1.0                     grid_4.0.2                   
[125] rmarkdown_2.9                 carData_3.0-4                
[127] git2r_0.28.0                  scatterplot3d_0.3-41         
[129] shiny_1.6.0                   lubridate_1.7.10             
[131] FactoMineR_2.4