library(goldclipReport)
library(knitr)
library(ggplot2)
library(dplyr)

knitr::opts_chunk$set(fig.width = 12, 
                      fig.height = 8, 
                      fig.path = 'Figures',
                      echo = FALSE,
                      cache = FALSE,
                      prompt = FALSE,
                      tidy = FALSE,
                      comment = NA,
                      message = FALSE,
                      warning = FALSE,
                      rownames.print = FALSE)
print_df <- function(x){
  x %>%
  kableExtra::kable() %>%
  kableExtra::kable_styling() %>%
  kableExtra::scroll_box(width = "100%")
}

stat_files <- params$stat_files

Alignment Statistics

## for count table
stat_files <- normalizePath(stat_files)
df_stat <- map_stat_read(stat_files, origin = TRUE) %>%
  tidyr::gather(key = "group", value = "count", -c(id, total)) %>%
  # tidyr::gather(key = "group", value = "count", 2:8) %>%
  dplyr::mutate(count = prettyNum(count, big.mark = ","),
                total = prettyNum(total, big.mark = ",")) %>%
  tidyr::spread(key = group, value = count) 

print_df(df_stat)

# df_stat <- map_stat_read(stat_files, origin = TRUE)
# print_df(df_stat)

Note:
rRNA, unique, multiple, map to reference genome rRNA.sp, unique.sp, multiple.sp map to spike-in genome unmap, does not map to any given sequences

df_plot <- map_stat_plot(stat_files, stat = "percentage")
print(df_plot)

EOF



bakerwm/goldclipReport documentation built on July 9, 2019, 4:54 p.m.