Mercurial > repos > mingchen0919 > aurora_deseq2_site
view 01_deseq2_analysis.Rmd @ 2:ab8d558ea6e6 draft default tip
planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
author | mingchen0919 |
---|---|
date | Sun, 30 Dec 2018 13:57:07 -0500 |
parents | 32210899a3dd |
children |
line wrap: on
line source
--- title: 'DESeq2 analysis' output: html_document: highlight: pygments --- ```{r setup, include=FALSE, warning=FALSE, message=FALSE} knitr::opts_chunk$set(error = TRUE, echo = FALSE) ``` ```{r echo=FALSE} # import count data count_data = read.csv(opt$X_A, row.names = 1, header = TRUE) # import column data coldata = read.csv(opt$X_B, row.names = 1, header = TRUE)[colnames(count_data),,drop=FALSE] ``` ```{r echo=FALSE} dds = DESeqDataSetFromMatrix(countData = count_data, colData = coldata, design = formula(opt$X_C)) dds = DESeq(dds, test = opt$X_G, fitType = opt$X_H) ## Differential expression test results res = results(dds, contrast = c(opt$X_D, opt$X_E, opt$X_F), alpha = opt$X_I) res ``` ```{r echo=FALSE} # save all padj sorted res to tool output directory padj_sorted_res = res[order(res$padj), ] write.table(padj_sorted_res, file = paste0(opt$X_d, '/padj-sorted-genes.txt'), quote = FALSE) # save significant genes to a file in tool output directory sig_res = res[(res$padj < opt$X_I) & !is.na(res$padj), ] sig_res_sorted = sig_res[order(sig_res$padj), ] write.table(sig_res_sorted, file = paste0(opt$X_d, '/padj-sorted-significant-genes.txt'), quote = FALSE) ```