changeset 4:df6f86eb057e draft

planemo upload commit 61448862dc9016969191967aeefb7f7acce1e1f9-dirty
author mingchen0919
date Tue, 01 May 2018 00:03:45 -0400
parents 85351cdd4f19
children fe7c4dbf5a82
files expose-outputs-to-galaxy-history.sh rmarkdown_report.Rmd rmarkdown_report.xml rmarkdown_report_render.R
diffstat 4 files changed, 33 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/expose-outputs-to-galaxy-history.sh	Mon Apr 30 16:40:21 2018 -0400
+++ b/expose-outputs-to-galaxy-history.sh	Tue May 01 00:03:45 2018 -0400
@@ -2,4 +2,10 @@
 cd ${REPORT_FILES_PATH}
 
 # copy outputs from tool outputs directory to corresponding galaxy output path
-cp fastqc.html ${REPORT}
\ No newline at end of file
+if [ -e "rmarkdown_report.html" ]; then
+  cp rmarkdown_report.html ${REPORT}
+fi
+
+if [ -e "index.html" ]; then
+  cp index.html ${REPORT}
+fi
--- a/rmarkdown_report.Rmd	Mon Apr 30 16:40:21 2018 -0400
+++ b/rmarkdown_report.Rmd	Tue May 01 00:03:45 2018 -0400
@@ -1,11 +1,16 @@
 ---
-title: 'Short reads evaluation with [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)'
+title: '[FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/) report'
 output:
     html_document:
       highlight: pygments
 ---
 
-```{css}
+
+```{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;
@@ -14,11 +19,6 @@
 }
 ```
 
-```{r setup, include=FALSE, warning=FALSE, message=FALSE}
-knitr::opts_knit$set(progress = FALSE)
-knitr::opts_chunk$set(error = TRUE, echo = FALSE)
-```
-
 ```{r, echo=FALSE}
 # to make the css theme to work, <link></link> tags cannot be added directly 
 # as <script></script> tags as below.
--- a/rmarkdown_report.xml	Mon Apr 30 16:40:21 2018 -0400
+++ b/rmarkdown_report.xml	Tue May 01 00:03:45 2018 -0400
@@ -35,8 +35,6 @@
         export REPORT='$report' &&
         export REPORT_FILES_PATH='$report.files_path' &&
 
-        ############ copy jstree directory cp -r ${__tool_directory__}/vakata-jstree-3.3.5 ./ &&
-
         ############ create a hidden file to store r markdown rendering log
         touch $report.files_path/.r_rendering.log.txt &&
 
--- a/rmarkdown_report_render.R	Mon Apr 30 16:40:21 2018 -0400
+++ b/rmarkdown_report_render.R	Tue May 01 00:03:45 2018 -0400
@@ -13,6 +13,12 @@
 library('getopt')
 library('rmarkdown')
 library('htmltools')
+library('plyr')
+library('dplyr')
+library('stringr')
+library('DT')
+library('reshape2')
+library('plotly')
 #------------------------------------------------------------------
 options(stringsAsFactors = FALSE)
 
@@ -104,7 +110,7 @@
 
 
 # import getopt specification matrix from a csv file
-opt = getopt(getopt_specification_matrix('command_line_arguments.csv',
+opt = getopt(getopt_specification_matrix('command-line-arguments.csv',
                                          tool_dir = Sys.getenv('TOOL_INSTALL_DIR')))
 # define environment variables for all input values. this is useful when we
 # want to use input values by other programming language in r markdown
@@ -131,28 +137,26 @@
   # render a single html
   system(command = 'cp -r ${TOOL_INSTALL_DIR}/rmarkdown_report.Rmd ${REPORT_FILES_PATH}')
   # add a few lines to 'rmarkdown_report.Rmd' to generate file tree outputs
-  jstree_lines = '
-
-  ## Outputs
+  jstree_lines = 
+'
+## Outputs
 
-  ```{r, echo=FALSE}
-  # create a div container to store the file tree interface
-  library(htmltools)
-  tags$div(
-    id="jstree",
-    file_tree(Sys.getenv(\'REPORT_FILES_PATH\'))
+```{r, echo=FALSE}
+tags$div(id="jstree", file_tree(Sys.getenv(\'REPORT_FILES_PATH\')))
+```
+'
+  write(
+    x = jstree_lines,
+    append = TRUE,
+    file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/rmarkdown_report.Rmd')
   )
-  ```
-  '
-  write(x = jstree_lines, append = TRUE,
-        file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/rmarkdown_report.Rmd'))
   render(input = paste0(Sys.getenv('REPORT_FILES_PATH'), '/rmarkdown_report.Rmd'))
 }
 #===============================================================
 
 
 #============== expose outputs to galaxy history ===============
-system(command = 'sh ${TOOL_INSTALL_DIR}/expose-outputs.sh')
+system(command = 'sh ${TOOL_INSTALL_DIR}/expose-outputs-to-galaxy-history.sh')
 #===============================================================