Search
Question: DESeq2 - test fold change below a threeshold
1
gravatar for samuel collombet
3.8 years ago by
France
samuel collombet130 wrote:

Hi,

 

I am comparing 2 conditions ; I would like to find all genes that show less than a 2fold increase in condition A vs B, wether the fold change is positive or negative. (and reciprocally genes that show not a 2fold decrease). Is that possible?

I tried results(dds, lfcThreshold=1, altHypothesis="less") and select padj<0.01, but in fact that select the genes for which lfc(A/B) < -1 is significant, whereas I would like  lfc(A/B) < 1 is significant (that is altHypothesis="less" and altHypothesis="lessAbs").

Does the 1-pValue of results(dds, lfcThreshold=1, altHypothesis="greater") would give me the pValue I am looking for? (sorry if this is a statistical nonsense, I cannot judge myself).

ADD COMMENTlink modified 3.8 years ago by Michael Love20k • written 3.8 years ago by samuel collombet130
1
gravatar for Michael Love
3.8 years ago by
Michael Love20k
United States
Michael Love20k wrote:

hi Samuel,

We don't have built-in functions for this, but it's easy to compute the p-values manually, e.g. here for beta < lfcThreshold:

res$pvalue <- pnorm(res$log2FoldChange, mean = lfcThreshold, sd = res$lfcSE, lower.tail = TRUE)

And you can directly compute adjusted p-values with p.adjust() or perform independent filtering using the genefilter package:

library(genefilter)
alpha <- 0.1
filter <- res$baseMean
theta <- seq(mean(filter == 0), 1, length=20)
filtPadj <- filtered_p(filter=filter, test=res$pvalue, theta=theta, method="BH")
numRej  <- colSums(filtPadj < alpha, na.rm = TRUE)
res$padj <- filtPadj[, which.max(numRej), drop=TRUE]

Also, for these tests where the alternative hypothesis includes 0, you should set betaPrior=FALSE, because you don't want the prior to support the alternative hypothesis.

ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by Michael Love20k
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: 309 users visited in the last hour