diff htseq_count.Rmd @ 5:aacd5f53ac99 draft

v2.0.0
author mingchen0919
date Wed, 18 Apr 2018 13:17:28 -0400
parents 0fdb0d5f53ce
children 7c54fd452b8e
line wrap: on
line diff
--- a/htseq_count.Rmd	Wed Mar 07 01:37:59 2018 -0500
+++ b/htseq_count.Rmd	Wed Apr 18 13:17:28 2018 -0400
@@ -1,48 +1,54 @@
 ---
 title: 'htseq-count analysis'
-output: html_document
+output:
+    html_document:
+      highlight: pygments
 ---
 
 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
-knitr::opts_chunk$set(
-  echo = as.logical(opt$X_e), 
-  error = TRUE
-)
+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.
+# 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="https://code.jquery.com/jquery-3.3.1.min.js"></script>
+<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>
+  $(function () {
+    // create an instance when the DOM is ready
+    $('#jstree').jstree().bind("select_node.jstree", function (e, data) {
+     window.open( data.node.a_attr.href, data.node.a_attr.target )
+    });
+  });
+</script>
+-----------------------------------------
 
 
-## Run htseq-count
-
-```{bash}
-cd ${X_d}
-
-cat >htseq-count.sh <<EOF
-  htseq-count \\
-    $(echo ${X_A} | sed 's/,/ /g') \\
-    ${X_G} \\
-    -f ${X_f} \\
-    -r ${X_r} \\
-    -s ${X_S} \\
-    -a ${X_a} \\
-    -t ${X_T} \\
-    -i ${X_i} \\
-    -m ${X_m} > counts.txt
-    
-  grep -v '__no_feature\|__ambiguous\|__too_low_aQual\|__not_aligned\|__alignment_not_unique' counts.txt > ${X_c}
-EOF
+```{bash, echo=FALSE}
+sh ${TOOL_INSTALL_DIR}/run_htseq-count.sh
 ```
 
+## Job script
 
-```{r}
-# display htseq-count job script
-htseq_count_sh = paste0(opt$X_d, '/htseq-count.sh')
-tags$code(tags$pre(readChar(htseq_count_sh, file.info(htseq_count_sh)$size )))
-```
-
-```{bash}
-cd ${X_d}
-sh htseq-count.sh
-```
+* htseq-count analysis: [htseq-count.sh](htseq-count.sh)
 
 ## Counts
 
@@ -62,4 +68,13 @@
 cp ${X_d}/counts.RData ${X_O}
 ```
 
+-----------------------------------------
+## Output
 
+```{r, echo=FALSE}
+# create a div container to store the file tree interface
+tags$div(
+  id="jstree",
+  file_tree(Sys.getenv('REPORT_FILES_PATH'))
+)
+```