alpha in lfcshrink?
1
1
Entering edit mode
@andrebolerbarros-16788
Last seen 7 months ago

Hi everyone,

In DESeq2, we can optimize the independent filtering step in calculating the results by changing alpha. Is there a way to perform that as well for lfcshrink?

Thanks!

deseq2 • 859 views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 7 hours ago
United States

The way we wrote it, the extra arguments for lfcShrink() are passed to the shrinkage methods, but if you want to specify arguments to results(), you can just pass the results table yourself:

res <- results(dds, ...)
res <- lfcShrink(dds, res=res, ...)

This way you have controlled the generation of the results table.

ADD COMMENT
0
Entering edit mode

Hello Michael Love l! @mikelove I have 3 questions about filtering and lfcShrink.

1-what's the risk of turn off the filtering

res <- results(dds, independentFiltering = F)

2- If I have applied the independentFiltering = F to res, I should not have filtering when lfcShrink, as below,right?

res <- lfcShrink(dds, res=res, ...)

3- I have 2 conditions, and 2 groups per condition, now if I run first for the interaction of cond1 and cond2

res <- results(dds,independentFiltering=FALSE)

without any contrast, and then for the first condition cond1

res_g <- results(dds ,contrast = c("cond1","g1","g2" ),independentFiltering = F)

and I want to apply the lfcShrink function like

resLFC <- lfcShrink(dds, res =res ,coef="con1.cond2", type="apeglm")

I have no problem with the interaction, but then when running

resLFC_g <- lfcShrink(dds, res =res_g, coef =  "cond1_g1_vs_g2" ,type="apeglm")

I have an error, Error in lfcShrink(dds, res = res_g, coef = "cond1_g1_vs_g2" , type = "apeglm") : 'coef' should specify same coefficient as in results 'res',and as apeglm does not work with contrast, and neither I can use coef to generate res_g, I am stocked here, any suggestions how to specify the same coeficients? What I want is to have lfcShrink results for a contrast without filtering out any gene, and having all padj !=NA Thanks!

ADD REPLY
0
Entering edit mode

I solved question 3 using the shrink type="ashr" algorithm and giving only res and no coef or contrast

ADD REPLY
0
Entering edit mode

Without filtering, you are including genes with low power so the multiple testing burden is higher. See: Bourgon 2010 or Ignatiadis 2016.

This is fine, you can do your own filtering at the top of the script with e.g. a common rule is:

keep <- rowSums(counts(dds) >= 10) >= X

Where you choose X to be the minimum number of samples with a count of 10 or more.

lfcShrink does not have a filtering argument. It does not perform this operation.

ADD REPLY
0
Entering edit mode

Sorry Michael, I rephrase. Which option passed to lfcShrink function, allow me to not have ANY padj=NA in the shrunken results? using the apeglm algorithm

I apply a filter to keep genes that are present in 80% of the samples of at least one experimental group (n per group =10), no matter number of counts, what do you think? I should apply something similar to what you suggest in addition to mine?

Thanks

ADD REPLY
0
Entering edit mode

At least one of the 3 options you give in the below post works for me, Thanks Dealing with genes that have Padj=NA

ADD REPLY
0
Entering edit mode

Are the cases where the padj is NA also where the pvalue is NA? In that case see the vignette section that explains the NA values.

ADD REPLY
0
Entering edit mode

Only padj is NA, I don't have any p value=NA, so I solved adjusting manually as res$padj <- p.adjust(res$pvalue, method="BH")

Thanks Michael, problem solved!

ADD REPLY

Login before adding your answer.

Traffic: 341 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