annotate DESeq_01.Rmd @ 0:6f94b4b9de44 draft

planemo upload
author mingchen0919
date Tue, 27 Feb 2018 23:57:53 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
1 ---
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
2 output: html_document
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
3 ---
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
4
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
5 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
6 knitr::opts_chunk$set(
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
7 echo = as.logical(opt$X_e),
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
8 error = TRUE
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
9 )
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
10 ```
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
11
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
12 # `DESeqDataSet` object
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
13
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
14 ```{r 'DESeqDataSet object'}
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
15 count_file_paths = strsplit(opt$X_P, ',')[[1]]
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
16 count_file_names = strsplit(opt$X_N, ',')[[1]]
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
17 sample_table = read.table(opt$X_S, header = TRUE)
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
18 row.names(sample_table) = sample_table[,2]
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
19 sample_table = sample_table[count_file_names, ]
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
20
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
21 ## copy count files into OUTPUT_DIR/counts
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
22 dir.create(paste0(OUTPUT_DIR, '/counts'), recursive = TRUE)
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
23 file_copy = file.copy(count_file_paths, paste0(OUTPUT_DIR, '/counts/', count_file_names), overwrite = TRUE)
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
24
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
25 ## DESeqDataSet object
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
26 dds = DESeqDataSetFromHTSeqCount(sampleTable = sample_table,
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
27 directory = paste0(OUTPUT_DIR, '/counts'),
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
28 design = formula(opt$X_p))
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
29 dds
6f94b4b9de44 planemo upload
mingchen0919
parents:
diff changeset
30 ```