diff rmarkdown_deseq2_count_matrix.Rmd @ 1:4a7131658ca6 draft

update tool
author mingchen0919
date Sat, 30 Dec 2017 12:35:31 -0500
parents 867a77a7a380
children 18e3fc69da76
line wrap: on
line diff
--- a/rmarkdown_deseq2_count_matrix.Rmd	Fri Dec 29 23:37:30 2017 -0500
+++ b/rmarkdown_deseq2_count_matrix.Rmd	Sat Dec 30 12:35:31 2017 -0500
@@ -16,15 +16,41 @@
 ```
 
 
-## Count Matrix
+# User input
 
-```{r 'count matrix'}
-count_matrix = read.table(opt$count_matrix)
-count_matrix
-```
-
-```{r 'ste[ 2'}
-
+```{r 'user input'}
+df = data.frame(name = names(opt)[-1],
+                value = unlist(opt))
+datatable(df, rownames = FALSE)
 ```
 
 
+# Count Matrix
+
+Display the first 100 rows of count data matrix.
+
+```{r 'count matrix'}
+count_data = read.table(opt$count_data)
+col_names = trimws(strsplit(opt$count_matrix_column_names, ',')[[1]])[1:ncol(count_data)]
+col_names = col_names[!is.na(col_names)]
+colnames(count_data)[1:length(col_names)] = col_names
+datatable(head(count_data, 100))
+```
+
+# Column Data
+
+```{r 'column data'}
+col_data = read.table(opt$col_data, 
+                      stringsAsFactors = FALSE, sep=',', header = TRUE, row.names = 1)
+datatable(col_data)
+```
+
+# Match sample names
+
+The goal of this step is to rearrange the rows of the column data matrix so that the samples rows in the count data matrix and the sample columns in the count data matrix are in the same order.
+
+```{r 'match sample names'}
+col_data = col_data[col_names, ]
+datatable(col_data)
+```
+