Commit 5d698d72 authored by Holger Brandl's avatar Holger Brandl

started cutadapt summary report migration to latest version

parent 843116cf
......@@ -4,9 +4,9 @@
## Note This script is supposed to be knitr::spin'ed
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.9/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.9/R/ggplot_commons.R")
require(knitr)
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.46/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.46/R/ggplot_commons.R")
load_pack(knitr)
## can we access variables from the parent spin.R process?
#echo("rscript is ", r_script)
......@@ -85,12 +85,12 @@ readSummaryStats <- function(logFile){
Too_short_Reads=(paste("grep -F 'Too short reads' ", logFile ) %>% pipe() %>% readLines() %>% strsplit( "[^0-9\\.]+") %>% unlist() %>% as.numeric())[3]
)
}
trimmingStats <- logDataFiles %>% ldply(readSummaryStats)
trimmingStats <- logDataFiles %>% map_df(readSummaryStats)
#+ results = 'asis'
trimmingStats %>% head() %>% kable()
write.delim(trimmingStats, file="cutadapt_summary.trimmingStats.txt")
write_tsv(trimmingStats, file="cutadapt_summary.trimmingStats.txt")
#' [Trimming Statistics](cutadapt_summary.trimmingStats.txt)
myfun <- function(x) x/100
......@@ -132,13 +132,13 @@ readAdapterStats <- function(logFile){
Overlapped_at_3prime=(paste("grep -F 'overlapped the 3' ", logFile ) %>% pipe() %>% readLines() %>% str_split_fixed( "[^0-9]+", 2) )[,1] %>% as.numeric()
)
}
adapterTrimmingStats <- logDataFiles %>% ldply(readAdapterStats)
adapterTrimmingStats <- logDataFiles %>% map_df(readAdapterStats)
#+ results = 'asis'
adapterTrimmingStats %>% head() %>% kable()
#+
write.delim(adapterTrimmingStats, file="cutadapt_summary.adapterTrimmingStats.txt")
write_tsv(adapterTrimmingStats, file="cutadapt_summary.adapterTrimmingStats.txt")
#' [Adapter Statistics](cutadapt_summary.adapterTrimmingStats.txt)
#with(adapterTrimmingStats, Trimmed==Overlapped_at_3prime+Overlapped_at_5prime)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment