Altering design following DESeqDataSetFromMatrix and DESeq
1
0
Entering edit mode
rbronste ▴ 60
@rbronste-12189
Last seen 5.1 years ago

I was wondering if it was possible to augment design, flip lets say:

dds<-DESeqDataSetFromMatrix(countData = countData,
                            colData = colData,
                            design =  ~ treatment + sex)​

to

dds<-DESeqDataSetFromMatrix(countData = countData,
                            colData = colData,
                            design =  ~ sex + treatment)

And to do this following the differential analysis. I am assuming the answer is no, but wanted to ask given large binding matrices where the DE analysis is considerably longer than for gene lists. Thanks.

deseq2 differential binding analysis • 1.6k views
ADD COMMENT
2
Entering edit mode
@mikelove
Last seen 5 days ago
United States

There’s no need to flip those designs. Because addition is commutative they have the same coefficients which are both accessible with special calls to results()

If you have designs that aren’t equivalent you can use the design replacement function, you just need to rerun DESeq() afterward.

ADD COMMENT
0
Entering edit mode

Thanks for explanation Michael. 

I can see now that looking via the following will give me what I need:

plotCounts(dds, gene=which.min(res$padj), intgroup = "sex")

plotCounts(dds, gene=which.max(res$padj), intgroup = "sex")

At least on a site by site basis. What is an easy way to export such results with a specific adjusted p-val cutoff?

ADD REPLY
1
Entering edit mode

I can’t think of a valid use for max(adj pvalue). Large p values don’t have a meaningful interpretation. You may want to chat about what you’re looking to do with a local statistician. 

Exporting results tables is handled in the DESeq2 vignette. Please have a look there, in the section that starts “Exporting only the results which pass an adjusted pvalue threshold...”

ADD REPLY
0
Entering edit mode

Sorry pasted the wrong line. I def am not interested in the high p-value result for export, was moreso trying to a quick way to export for instance sites that are differential within sex (under some low cutoff, with treatment remaining steady) or conversely within treatment. I did not see a clear description of that given a single design, or may have missed it. Thanks!

ADD REPLY
1
Entering edit mode

Just saw this, there is no a way with a single design/results table to specify that you see DE wrt one covariate but not DE wrt another. We do have methods for testing "not DE", see the lfcThreshold and altHypothesis="lessAbs" in the vignette and the description in the DESeq2 paper. So you could test for DE, then test for not DE, then consider the intersection of those FDR sets (although that final set does not have an interpretable FDR bound, it's simply the intersection of two sets).

ADD REPLY
0
Entering edit mode

Great thanks thats what I was looking for! I guess then my original point holds true, that to test DE wrt one covariate or the reverse, you just need two independent designs and results tables? I probably did not make that too clear in my original question. 

ADD REPLY
0
Entering edit mode

Any thoughts on this final question? Thanks so much! 

ADD REPLY

Login before adding your answer.

Traffic: 466 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6