Mercurial > repos > mingchen0919 > aurora_skewer
diff rmarkdown_report.Rmd @ 0:0358f6f78adf draft
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
author | mingchen0919 |
---|---|
date | Fri, 14 Dec 2018 00:40:15 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rmarkdown_report.Rmd Fri Dec 14 00:40:15 2018 -0500 @@ -0,0 +1,111 @@ +--- +title: 'Aurora Skewer Report' +output: + html_document: + highlight: pygments +--- + +```{r setup, include=FALSE, warning=FALSE, message=FALSE} +knitr::opts_chunk$set(error = TRUE, echo = FALSE) +``` + +```{css, echo=FALSE} +pre code, pre, code { + white-space: pre !important; + overflow-x: scroll !important; + word-break: keep-all !important; + word-wrap: initial !important; +} +``` + +```{r, echo=FALSE} +# to make the css theme to work, <link></link> tags cannot be added directly +# as <script></script> tags as below. +# it has to be added using a code chunk with the htmltool functions!!! +css_link = tags$link() +css_link$attribs = list(rel="stylesheet", href="vakata-jstree-3.3.5/dist/themes/default/style.min.css") +css_link +``` + +```{r, eval=FALSE, echo=FALSE} +# this code chunk is purely for adding comments +# below is to add jQuery and jstree javascripts +``` + +<script src="vakata-jstree-3.3.5/dist/jstree.min.js"></script> + + +```{r, eval=FALSE, echo=FALSE} +# this code chunk is purely for adding comments +# javascript code below is to build the file tree interface +# see this for how to implement opening hyperlink: https://stackoverflow.com/questions/18611317/how-to-get-i-get-leaf-nodes-in-jstree-to-open-their-hyperlink-when-clicked-when +``` +<script> + jQuery(function () { + // create an instance when the DOM is ready + jQuery('#jstree').jstree().bind("select_node.jstree", function (e, data) { + window.open( data.node.a_attr.href, data.node.a_attr.target ) + }); + }); +</script> + + +```{r, eval=FALSE, echo=FALSE} +--- +# ADD YOUR DATA ANALYSIS CODE AND MARKUP TEXT BELOW TO EXTEND THIS R MARKDOWN FILE +--- +``` + +## Job script + +```{bash echo=FALSE} +sh ${TOOL_INSTALL_DIR}/build-and-run-job-scripts.sh +``` + +```{r echo=FALSE,warning=FALSE,results='asis'} +# display content of the job-script.sh file. +cat('```bash\n') +cat(readLines(paste0(Sys.getenv('REPORT_FILES_PATH'), '/job-1-script.sh')), sep = '\n') +cat('\n```') +``` + +# 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) +``` +