Mercurial > repos > mingchen0919 > aurora_htseq
view htseq_count.Rmd @ 9:578a96df8690 draft
planemo upload commit 1cb2dd80dcb431563edbe1e763b3dde3a1adb2ae-dirty
author | mingchen0919 |
---|---|
date | Wed, 25 Apr 2018 14:22:32 -0400 |
parents | 1696f5ee0fe7 |
children | ec906e72784d |
line wrap: on
line source
--- title: 'htseq-count analysis' output: html_document: highlight: pygments --- ```{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. # 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> ----------------------------------------- ## Job script * htseq-count analysis: [htseq-count.sh](htseq-count.sh) ```{bash, echo=FALSE} sh ${TOOL_INSTALL_DIR}/shell-script-template.sh ``` ## Counts ```{r, echo=FALSE} count_data = read.table(paste0(opt$X_d, '/counts.txt'), row.names = 1) sample_names = trimws(strsplit(opt$X_B, ',')[[1]]) colnames(count_data) = rep(sample_names, length = ncol(count_data)) kable(head(count_data)) ``` ```{r, echo=FALSE} # save count data as an R object save(count_data, file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/counts.RData')) ``` ----------------------------------------- ## 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')) ) ```