In edgeR, one usually estimates a common, trended and tag wise dispersion in order to estimate the mean-variance trend over all genes.
I have noisy data with large BCVs. It is actually single-cell RNA-seq, and just for comparison, I would like to analyse it with edgeR. However, the common, trended and tag wise dispersion estimates are bounded. One can fix the bounded common dispersion with the 'interval' argument, but not the other two.
The estimateDisp function does not have these bounded estimates, but does not allow the inclusion of weights, which the other three functions above do.
Thus I am interested in an edgeR workflow which
(a) is not bounded in its dispersion estimates, and
(b) allows the inclusion of weights.
Is there any way I can relatively easy tweak the code to do this?
Thanks
Dear Aaron, thank you for the answer. What I meant by bounded is that the trended dispersion trend cannot exceed a BCV of 2 in the estimateGLMTrendedDisp function, at which it will asymptote when it actually should be higher.
Would the only modification for a weighted estimateDisp function be to add it in the `adjustedPRofileLik` and `glmFit` function? I will give this a try. Thank you for the recommendations!
There's no theoretical or computational reason for why the BCV should asymptote at 2. The main difference between the methods concern the trend fitting algorithm, so any differences in behaviour are probably attributable to greater accuracy of the loess-based method in
estimateDisp
compared to the bin-spline method inestimateGLMTrendedDisp
. Besides, unless you have oracular knowledge, how do you know the BCV should "actually" be higher?P.S. I was thinking of asking Andy to add support for weights in the function directly, rather than you having to manually do it. Less chance of mistakes that way, but still, you need to be careful with what the weights actually represent.
Dear Aaron
I have uploaded an example just to make things clear. You can find it at https://www.dropbox.com/s/7kl3e9fsjbwn1wl/bcvExample.pdf?dl=0 .
Please let me know if the function will be updated in order to cope with the weights. Thank you in advance.