knitr::opts_chunk$set(echo = TRUE)
library(plotly)

Started on r format(Sys.time(), "%Y-%m-%d %H:%M:%S")

FastQC_Result {.tabset}

Read Counts

The read counts in each sample.

readCount <- ans4Report[["Read Counts"]]
if (all(!is.na(readCount))){
  m <- list(
    l = 80,
    r = 80,
    b = 200,
    t = 100,
    pad = 0
  )
  plot_ly(x=names(readCount), y=readCount, type="bar") %>%
    layout(title="Total reads",
           yaxis = list(title = "Counts [Mio]"),
           margin = m
    )
} else {
  print("read counts not available in sushi dataset; do check individual reports")
}

Fastqc Quality Measures

The summary of FastQC reports.

tbl <- ans4Report[["Fastqc quality measures"]]
knitr::kable(tbl, col.names=colnames(tbl), row.names=TRUE)

Per Base Read Quality

The black and white heatmaps show the average reads quality
over all samples per base. The color scale corresponds to the percentage of reads at each reads quality.

qualMatrixList <- ans4Report[["Per Base Read Quality"]]
plotList <- plotQualityMatrixAsHeatmapGG2(qualMatrixList, 
                                          isR2=grepl("_R2$", names(qualMatrixList)))
isPaired <- isTRUE(param$paired)
# To plot in the order of R1, R2 in row
library(grid)
library(gridExtra)
## This is quite stupid.
if(isPaired){
  grid.arrange(plotList[["R1"]][["Avg Qual Colors"]],
               plotList[["R2"]][["Avg Qual Colors"]], ncol = 2)
}else{
  grid.arrange(plotList[["R1"]][["Avg Qual Colors"]], ncol = 2)
}
if(isPaired){
  grid.arrange(plotList[["R1"]][["Average"]],
               plotList[["R2"]][["Average"]], ncol = 2)
}else{
  grid.arrange(plotList[["R1"]][["Average"]], ncol = 2)
}

The blue and read heatmaps show the difference between each sample's reads quality and the average reads quality per base. The red represents a higher percentage of reads over the average, while the blue represents a lower percentage of reads over the average.

if(isPaired){
  grid.arrange(plotList[["R1"]][["Diff Qual Colors"]],
               plotList[["R2"]][["Diff Qual Colors"]], ncol = 2)
}else{
  grid.arrange(plotList[["R1"]][["Diff Qual Colors"]], ncol = 2)
}
sampleIndices <- which(!(names(plotList[["R1"]]) %in%
                       c("Avg Qual Colors", "Average", "Diff Qual Colors")))
for(sampleIndex in sampleIndices){
  if(isPaired){
    grid.arrange(plotList[["R1"]][[sampleIndex]],
                 plotList[["R2"]][[sampleIndex]], ncol = 2)
  }else{
    grid.arrange(plotList[["R1"]][[sampleIndex]], ncol = 2)
  }
}

Correlation

Correlation between Library concentration measurements and ReadCounts. It's only shown when "LibConc_qPCR" or "LibConc_100_800bp" columns exit in dataset.

dataset <- ans4Report[["dataset"]]
if(nrow(dataset) > 1){
  plotReadCountToLibConc(dataset,
                         colname='LibConc_qPCR [Characteristic]')
  plotReadCountToLibConc(dataset,
                         colname='LibConc_100_800bp [Characteristic]')
}

Heatmaps of reads/concentration per cell on the plate

Sequenced reads or concentration per cell, on the plate layout. The current supported plate layout format is "PlateNumber_[A-Z][Integer]", e.g. "1_A2". Otherwise, the platelayout is not shown.

The heatmap values are in $log10$ scale. The colorScale ranges from half of median value to twice of median value.

plateMatrix <- plateStatistics(dataset)
if(!is.na(plateMatrix)){
  l <- htmltools::tagList()
  ## This is the way of plotting plotly figures within a loop in knitr code chunk
  for(plateName in names(plateMatrix)){
    for(colname in names(plateMatrix[[plateName]])){
      p <- heatmapPlate(plateMatrix[[plateName]][[colname]], 
                        title=paste(plateName, colname, sep=": "),
                        center=TRUE, log10=TRUE,
                        width = 500*(1 + sqrt(5))/2, height = 500)
      l[[paste(plateName, colname, sep=": ")]] <- as_widget(p)
    }
  }
  l
}

Input Dataset

ezInteractiveTableRmd(values=ans4Report[["dataset"]])

SessionInfo

ezSessionInfo()


uzh/ezRun documentation built on April 29, 2024, 10:31 a.m.