Question: DESeq2 group comparison
0
gravatar for rbronste
13 months ago by
rbronste60
rbronste60 wrote:

Quick question about running some 4-way comparisons, have the following set up:

table(sampleSex, sampleTreatment)

dds<-DESeqDataSet(se, design= ~batch + sex + treatment)

dds$group <- factor(paste0(dds$sex, dds$treatment))

design(dds) <- ~0 + group

dds <- dds[ rowSums(counts(dds)) > 1, ]

dds <- DESeq(dds, betaPrior = FALSE)

res1<-results(dds, format = c("GRanges"), contrast=c(1, -1/3, -1/3, -1/3)

res2 <- subset(res1, padj<.001)

res2_sorted = res2[order(res2$padj), ]

In doing it this way I get results that show the first member of the group contrast (1) as having the smallest number of counts in the matrix I am importing as the basis for DESeq2 - however I would like to have the opposite with the first member of the group having the most counts and the remaining members having the fewest. Not sure how to change the design to reflect that, thanks!

ADD COMMENTlink modified 13 months ago by Michael Love26k • written 13 months ago by rbronste60
Answer: DESeq2 group comparison
0
gravatar for Michael Love
13 months ago by
Michael Love26k
United States
Michael Love26k wrote:

Sorting by (adjusted) pvalue has no preference for the sign of the estimated coefficient.

The fact that you observe more or one sign or the other at the top of the list indicates that these just have smaller pvalue. 

If you want a one sided test, see lfcThreshold in the vignette or in ?results.

ADD COMMENTlink written 13 months ago by Michael Love26k

Thanks for the info. I am fine sorting by the (adjusted) pvalue, Im moreso interested in matching the way I do the 4-way analysis here to the following which is what I am doing for straightforward pairwise comparisons (where I don't do the onesided lfcThreshold):

table(sampleTreatment)

dds<-DESeqDataSet(se, design= ~batch + treatment)

dds$group <- factor(paste0(dds$treatment))

dds$treatment<-relevel(dds$treatment, ref="vehicle")

design(dds) <- ~batch + group

dds <- dds[ rowSums(counts(dds)) > "1", ]

dds <- DESeq(dds, betaPrior = FALSE)


Me_pw<-results(dds, format = c("GRanges"), contrast=c("group", "vehicle", "EB"))

Me_pw_padj.001 <- subset(Me_pw, padj<.001)

Me_pw_padj.001_sorted = Me_pw_padj.001[order(Me_pw_padj.001$padj), ]

Me_pw_padj.001_sorted
ADD REPLYlink modified 13 months ago • written 13 months ago by rbronste60

Is there a remaining question? I think I answered why you see one or the other sign of LFC at the top of the table sorting by pvalue. If you are only interested in one sign of coefficient, use a one sided test. If you want to look at the genes where the LFC is positive or negative, subset the table.

ADD REPLYlink written 13 months ago by Michael Love26k
Please log in to add an answer.

Help
Access

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