changeset 5:a9b160a97a5e draft default tip

planemo upload commit bd7e129777e3ef6403f055251e17b541d222d7d0-dirty
author mingchen0919
date Fri, 30 Nov 2018 00:12:56 -0500
parents 3fc7079a1f06
children
files 01_skewer_analysis.Rmd rmarkdown_report.xml
diffstat 2 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/01_skewer_analysis.Rmd	Sat Jun 09 22:32:27 2018 -0400
+++ b/01_skewer_analysis.Rmd	Fri Nov 30 00:12:56 2018 -0500
@@ -24,3 +24,42 @@
 ```
 
 
+# Results summary
+
+## Reads processing summary
+
+```{r echo=TRUE}
+log = readLines(paste0(Sys.getenv('REPORT_FILES_PATH'), '/trim-trimmed.log'))
+start_line = grep('read.+processed; of these:', log)
+end_line = grep('untrimmed.+available after processing', log)
+processing_summary = gsub('(\\d+) ', '\\1\t', log[start_line:end_line])
+processing_summary_df = do.call(rbind, strsplit(processing_summary, '\t'))
+colnames(processing_summary_df) = c('Total reads:', processing_summary_df[1,1])
+knitr::kable(processing_summary_df[-1, ])
+```
+
+## Length distribution of reads after trimming
+
+```{r echo=TRUE, message=FALSE, warning=FALSE}
+start_line = grep('length	count	percentage', log)
+len_dist = log[(start_line):length(log)]
+len_dist = do.call(rbind, strsplit(len_dist, '\t'))
+columns = len_dist[1, ]
+len_dist = as.data.frame(len_dist[-1, ])
+colnames(len_dist) = columns
+
+library(plotly)
+library(ggplot2)
+len_dist$count = as.numeric(len_dist$count)
+labels = as.character(len_dist$length)
+len_dist$length = 1:nrow(len_dist)
+pp = ggplot(data = len_dist, aes(length, count)) +
+  geom_line(color='red') +
+  scale_x_continuous(name = 'Length',
+                   breaks = 1:nrow(len_dist),
+                   labels = labels) +
+  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
+  ylab('Count') +
+  ggtitle('Length distribution')
+ggplotly(pp)
+```
\ No newline at end of file
--- a/rmarkdown_report.xml	Sat Jun 09 22:32:27 2018 -0400
+++ b/rmarkdown_report.xml	Fri Nov 30 00:12:56 2018 -0500
@@ -6,6 +6,7 @@
         <requirement type="package" version="1.20.0">r-getopt</requirement>
         <requirement type="package" version="1.6">r-rmarkdown</requirement>
         <requirement type="package" version="0.2.2">skewer</requirement>
+        <requirement type="package" version="4.5.6">r-plotly</requirement>
     </requirements>
     <command><![CDATA[