Search
Question: Altering design following DESeqDataSetFromMatrix and DESeq
0
gravatar for rbronste
3 months ago by
rbronste50
rbronste50 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.

ADD COMMENTlink modified 3 months ago by Michael Love16k • written 3 months ago by rbronste50
2
gravatar for Michael Love
3 months ago by
Michael Love16k
United States
Michael Love16k 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.

ADD COMMENTlink written 3 months ago by Michael Love16k

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 REPLYlink written 3 months ago by rbronste50
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...”

ADD REPLYlink written 3 months ago by Michael Love16k

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 REPLYlink written 3 months ago by rbronste50
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).

ADD REPLYlink written 3 months ago by Michael Love16k

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 3 months ago • written 3 months ago by rbronste50

Any thoughts on this final question? Thanks so much! 

ADD REPLYlink written 3 months ago by rbronste50
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 2.2.0
Traffic: 171 users visited in the last hour