Search
Question: Altering design following DESeqDataSetFromMatrix and DESeq
0
7 months ago by
rbronste60
rbronste60 wrote:

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.

modified 7 months ago by Michael Love18k • written 7 months ago by rbronste60
2
7 months ago by
Michael Love18k
United States
Michael Love18k wrote:

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.

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?

1

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...”

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!

1

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).

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 REPLYlink modified 7 months ago • written 7 months ago by rbronste60

Any thoughts on this final question? Thanks so much!