Hello,
I'm using DESeq2 on a non-standard dataset where I wish to supply my own normalisation factors. I'm getting an error message from varianceStabilizingTransformation()
which made me question the workflow I'm using:
# This works as expected, no warnings or errors dds <- DESeqDataSetFromMatrix(countData = cnts, colData = smpls, design = ~ Batch + Condition_Treatment_Time) normalizationFactors(dds) <- normfacs dds <- DESeq(dds, test="Wald", parallel=TRUE) using pre-existing normalization factors estimating dispersions gene-wise dispersion estimates: 16 workers mean-dispersion relationship final dispersion estimates, MLE betas: 16 workers fitting model and testing: 16 workers # However I get an error here vsd <- varianceStabilizingTransformation(dds) -- note: fitType='parametric', but the dispersion trend was not well captured by the function: y = a/x + b, and a local regression fit was automatically substituted. specify fitType='local' or 'mean' to avoid this message next time. Error in getVarianceStabilizedData(object) : call estimateSizeFactors before calling getVarianceStabilizedData if using local dispersion fit # same error using fitType="local" > vsd <- vst(dds, fitType="local") Error in getVarianceStabilizedData(object) : call estimateSizeFactors before calling getVarianceStabilizedData if using local dispersion fit # but it works fine with fitType="mean" vsd <- varianceStabilizingTransformation(dds, fitType="mean")
The error is about not having called estimateSizeFactors(), which I don't want to do because I supplied my own normalisation factors. fitType="mean" solves the issue but I'm wondering if I should also pass the same argument when building the dds object in the first place (even though I don't get any warnings or error at that stage).
I.e., change this:
dds <- DESeq(dds, test="Wald", parallel=TRUE)
to this:
dds <- DESeq(dds, test="Wald", fitType="mean", parallel=TRUE)
Thanks
Enrico
Great, thanks Michael.
So you're saying that
varianceStabilizingTransformation()
should not give that error message and hence I don't need to specifyfitType="mean"
anywhere?Can you give me a shout once you've pushed the fix to release?
Thanks!
Correct. The problem is solely the test (that generates the error message).
Yes, I'll post to this thread when I've pushed a fix.
I just pushed the fix to release. thanks for the bug report.