diff DESeq.Rmd @ 6:2f8ddef8d545 draft

update deseq2
author mingchen0919
date Tue, 07 Nov 2017 13:50:32 -0500
parents 312e9bcc02f1
children
line wrap: on
line diff
--- a/DESeq.Rmd	Tue Aug 08 15:06:40 2017 -0400
+++ b/DESeq.Rmd	Tue Nov 07 13:50:32 2017 -0500
@@ -10,24 +10,22 @@
 
 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
 knitr::opts_chunk$set(
-  echo = ECHO
+  echo = ECHO,
+  error = TRUE
 )
-
-library(stringi)
-library(DESeq2)
-library(pheatmap)
-# library(PoiClaClu)
-library(RColorBrewer)
 ```
 
 # `DESeqDataSet` object
 
-```{r}
-count_files = strsplit(opt$count_files, ',')[[1]]
+```{r 'DESeqDataSet object'}
+count_file_paths = strsplit(opt$count_file_paths, ',')[[1]]
+count_file_names = strsplit(opt$count_file_names, ',')[[1]]
 sample_table = read.table(opt$sample_table, header = TRUE)
+row.names(sample_table) = sample_table[,2]
+sample_table = sample_table[count_file_names, ]
 
 ## copy count files into working directory
-file_copy = file.copy(count_files, sample_table$fileName, overwrite = TRUE)
+file_copy = file.copy(count_file_paths, count_file_names, overwrite = TRUE)
 
 ## DESeqDataSet object
 dds = DESeqDataSetFromHTSeqCount(sampleTable = sample_table,
@@ -55,14 +53,14 @@
 
 ## Count Data
 
-```{r}
+```{r 'count data'}
 datatable(head(counts(dds), 100), style="bootstrap", 
           class="table-condensed", options = list(dom = 'tp', scrollX = TRUE))
 ```
 
 ## Sample Table 
 
-```{r}
+```{r 'sample table'}
 datatable(sample_table, style="bootstrap",
           class="table-condensed", options = list(dom = 'tp', scrollX = TRUE))
 ```