Question: How does my DESeq2 code handle more than two conditions?
gravatar for a.rex
12 months ago by
a.rex0 wrote:



I am completely new to using R and DeSeq2 for RNA-seq analysis. My experimental set up is such that I have 3 biological conditions and 2 replicates per condition. I used featurescount to count transcript per genomic interval. I then plugged this into the following script: 

countdata <- read.table("featurescountmatrix.txt", header=TRUE, row.names=1)
countdata <- countdata[ ,6:ncol(countdata)]
colnames(countdata) <- gsub(".[sb]am$", "", colnames(countdata))
countdata <- as.matrix(countdata)
(condition <- factor(c(rep("cond1", 2), rep("cond2", 2),rep("cond3", 2))))
(coldata <- data.frame(row.names=colnames(countdata), condition))
dds <- DESeqDataSetFromMatrix(countData=countdata, colData=coldata, design=~condition)
dds <- DESeq(dds)
res <- results(dds,contrast=c("cond1","cond2","cond3"))
res <- res[order(res$padj), ]
resdata <- merge(,, normalized=TRUE)), by="row.names", sort=FALSE)
names(resdata)[1] <- "Gene"
write.csv(resdata, file="cond123diffexpr-results.csv")

I do not understand, whether from the code above, the p-value is calculated based on the statistical difference between cond1 and cond3 or all three conditions?? 




deseq2 • 134 views
ADD COMMENTlink modified 12 months ago by Michael Love25k • written 12 months ago by a.rex0
Answer: How does my DESeq2 code handle more than two conditions?
gravatar for Michael Love
12 months ago by
Michael Love25k
United States
Michael Love25k wrote:

A good place to start is our workflow which explains what DESeq2 is testing:

You can also read over the DESeq2 publication which helps out a lot understanding what is happening when you run the software:

For specific functions you can look up what happens and how the different arguments work by typing ? and the function name. 

If you want to know how contrasts work in the results function type:


And read about the contrast argument.

ADD COMMENTlink written 12 months ago by Michael Love25k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 221 users visited in the last hour