diff 01_htseq_count_analysis.Rmd @ 9:467a1895c718 draft

planemo upload commit bd7e129777e3ef6403f055251e17b541d222d7d0-dirty
author mingchen0919
date Fri, 30 Nov 2018 00:23:29 -0500
parents a40d5db8687e
children
line wrap: on
line diff
--- a/01_htseq_count_analysis.Rmd	Sat Jun 09 22:29:36 2018 -0400
+++ b/01_htseq_count_analysis.Rmd	Fri Nov 30 00:23:29 2018 -0500
@@ -19,13 +19,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))
+
 
 # modify column names
 count_data = data.frame(feature_id = rownames(count_data), count_data)
@@ -34,3 +34,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))
+```
+
+