[BioC] plotMeanVar and coxreid method in edgeR

Davis McCarthy davis.mccarthy at balliol.ox.ac.uk
Thu Dec 15 17:50:45 CET 2011


Hi Gordon and others

I've just committed changes to Bioc-devel fixing the problem that Wade
described. Essentially I just removed the "dispersion.method"
(redundant now, I agree) and altered the rest of the function to adapt
to that. I haven't used plotMeanVar() for a long time, which explains
why we missed the obvious problems of using it with the new dispersion
estimation methods. But glad to hear that it's useful for people and
it should work properly now (I did a small amount of testing). I also
updated the documentation to reflect the changes and bumped the
version number.

Let me know if there are any more issues and I'll get on it.

I also agree that it would be good for the data object to 'remember'
which dispersion method was used.

Best wishes
Davis


On 13 December 2011 22:44, Gordon K Smyth <smyth at wehi.edu.au> wrote:
> Dear Wade,
>
> You are right on both fronts.  plotMeanVar() needs to be updated to reflect
> the changes in the dispersion estimation functions.  Thanks for the heads-up
> on this.  Actually, I think plotMeanVar() will correctly use whatever
> dispersion estimates you have previously estimated, so its
> dispersion.method argument is actually redundant -- you can just leave it at
> the default value.  I will confer with Davis McCarthy, the author of the
> function, to come to a complete solution.
>
> I agree with you that it would be desirable for the data object to
> 'remember' which dispersion estimation method was used.  We have been
> thinking along the same lines, and plan to introduce a component called
> "dispersion.method" or similar into the data object.
>
> Best wishes
> Gordon
>
> ---------------------------------------------
> Professor Gordon K Smyth,
> Bioinformatics Division,
> Walter and Eliza Hall Institute of Medical Research,
> 1G Royal Parade, Parkville, Vic 3052, Australia.
> Tel: (03) 9345 2326, Fax (03) 9347 0852,
> smyth at wehi.edu.au
> http://www.wehi.edu.au
> http://www.statsci.org/smyth
>
> On Tue, 13 Dec 2011, Davis, Wade wrote:
>
>> Dear Mark and Gordon:
>>
>> I have a few questions and suggestions for the plotMeanVar function (which
>> I think is very handy) in edgeR.
>>
>> I receive the following message when trying to use
>> dispersion.method="coxreid" in plotMeanVar:
>>
>> plotMeanVar(dge.ctl.filt, meanvar=ctl.filt.meanvar,
>> show.tagwise.vars=TRUE, NBline=TRUE, dispersion.method="coxreid")
>> Error in plotMeanVar(dge.ctl.filt, meanvar = ctl.filt.meanvar,
>> show.tagwise.vars = TRUE,  :
>>  Could not extract Cox-Reid common dispersion. Try running CRDisp on the
>> DGEList object before plotMeanVar.
>>
>> I had run
>> estimateGLMCommonDisp/estimateGLMTrendedDisp/estimateGLMTagwiseDisp prior to
>> this call, knowing that they have superseded CRDisp / estimateCRDisp / etc.
>>
>> names(dge.ctl.filt)
>> [1] "samples"            "counts"             "all.zeros"
>>  "common.dispersion"  "trended.dispersion" "abundance"
>> [7] "bin.dispersion"     "bin.abundance"      "tagwise.dispersion"
>>
>>
>> NOTE: Everything runs without complaint with:
>> plotMeanVar(dge.ctl.filt, meanvar=ctl.filt.meanvar,
>> show.tagwise.vars=TRUE, NBline=TRUE, dispersion.method="qcml")
>>
>>
>> Looking into the plotMeanVar source, it seems that the function is looking
>> for elements object$CR.common.dispersion or object$CR.tagwise.dispersion.
>>
>>
>> Snippet from plotMeanVar:
>> -------------------------------------------
>>  if (NBline | show.tagwise.vars) {
>>       if (dispersion.method == "coxreid") {
>>           common.dispersion <- object$CR.common.dispersion
>>           tagwise.dispersion <- object$CR.tagwise.dispersion
>>       }
>>       else {
>>           common.dispersion <- object$common.dispersion
>>           tagwise.dispersion <- object$tagwise.dispersion
>>       }
>>       if (is.null(common.dispersion)) {
>>           if (dispersion.method == "coxreid")
>>               stop("Could not extract Cox-Reid common dispersion. Try
>> running CRDisp on the DGEList object before plotMeanVar.\n")
>>           else stop("Could not extract qCML common dispersion. Try running
>> estimateCommonDisp on the DGEList object before plotMeanVar.\n")
>>       }
>>   }
>> -------------------------------------------
>>
>> It is my understanding that the names CR.* are not being used anymore for
>> DGEList objects. I personally like the CR.* convention because as it stands
>> now, I can't examine an DGEList object and tell by what dispersion method
>> object$common.dispersion or estimateTagwiseDisp was obtained (i.e.,
>> estimateCommonDisp or estimateGLMCommonDisp).
>>
>> So would you politely consider modifying the DGEList-class to address
>> this? Or I have I misdiagnosed the problem entirely?
>>
>> Thanks for your insight on the matter and your time.
>>
>> My session info is below.
>> Wade
>>
>>
>>> sessionInfo()
>>
>> R version 2.14.0 (2011-10-31)
>> Platform: x86_64-pc-mingw32/x64 (64-bit)
>>
>> locale:
>> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>> States.1252    LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C                           LC_TIME=English_United
>> States.1252
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] limma_3.10.0 edgeR_2.4.1
>>
>
> ______________________________________________________________________
> The information in this email is confidential and intended solely for the
> addressee.
> You must not disclose, forward, print or use it without the permission of
> the sender.
> ______________________________________________________________________



-- 
===================================================
Davis McCarthy  |  PRS in Statistics
Dept of Statistics & Wellcome Trust Centre for Human Genetics
University of Oxford
E: davis.mccarthy at balliol.ox.ac.uk
W: sites.google.com/site/davismcc
P: +44 7847 470810
===================================================



More information about the Bioconductor mailing list