changeset 21:69157062629f draft

planemo upload commit e37a78252b05a1a274a750e55a1a74693b7abc18-dirty
author mingchen0919
date Thu, 29 Nov 2018 22:18:47 -0500
parents 11994267638a
children ad2ceb05d152
files rmarkdown_report.Rmd
diffstat 1 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rmarkdown_report.Rmd	Thu Nov 29 16:15:37 2018 -0500
+++ b/rmarkdown_report.Rmd	Thu Nov 29 22:18:47 2018 -0500
@@ -36,6 +36,24 @@
 <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}
+# The script below is used to avoid conflicts between different javascript labraries
+```
+
+<script>
+jQuery.noConflict();
+ 
+jQuery( document ).ready(function( $ ) {
+    // You can use the locally-scoped $ in here as an alias to jQuery.
+    $( "jstree" ).hide();
+});
+
+// The $ variable in the global scope has the prototype.js meaning.
+window.onload = function(){
+    var mainDiv = $( "main" );
+}
+</script>
+
 ---
 # 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
@@ -67,13 +85,13 @@
 
 ## Counts
 
-Only the first few rows are displayed. 
+Write data into a CSV file.
 
-```{r, echo=FALSE}
+```{r, echo=TRUE}
 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))
+# kable(head(count_data))
 
 # modify column names
 count_data = data.frame(feature_id = rownames(count_data), count_data)
@@ -82,3 +100,14 @@
           quote = FALSE, row.names = FALSE)
 ```
 
+Display the top 1000 rows with largest average counts.
+
+```{r echo=TRUE}
+# Sort count table by count average
+rownames(count_data) = count_data$feature_id
+count_data = count_data[, -1]
+sorted_ct_table = count_data[order(rowMeans(count_data), decreasing = TRUE), ]
+DT::datatable(head(sorted_ct_table, 1000))
+```
+
+