After some thought, I've decided to import the LargeDataClass as you've requested, but I have to say that some of your message doesn't make a lot of sense to me.

The class of your data object looks weird.  Is this really a valid class?

glmFit() doesn't have a method for the LargeDataObject class, so it's hard to see how the LargeDataObject class could make any difference.

In fact, glmFit() is an S3 generic, whereas LargeDataObject is an S4 virtual class, so glmFit() could never possibly "see" the LargeDataObject class anyway.

Finally, glmFit() does have a method for DGEList objects and also a default method, so it is hard to see how it could fail to dispatch whatever type of object you're giving it.

It seems to me that, if you want to use classes and functions defined by the limma package, then the onus is on you to load or import what you require into your own package. Why wouldn't your package depend on limma the same way that edgeR does?

Gordon


On Fri, 27 Jun 2014, Dario Strbenac wrote:

Thank you. I made that change to the edgeR source code and reinstalled it, but 
I get another error further in my function :

Error in UseMethod("glmFit") :
  no applicable method for 'glmFit' applied to an object of class "c('DGEList', 
'list', 'LargeDataObject', 'vector')"

This is because of LargeDataObject from limma is not imported into edgeR. Can 
you add that one, too ?


--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

________________________________________
From: Gordon K Smyth <sm...@wehi.edu.au>
Sent: Friday, 27 June 2014 9:32 AM
To: Dario Strbenac
Cc: bioc-devel@r-project.org
Subject: edgeR estimateGLMRobustDisp Fails when Called From A Package

Date: Thu, 26 Jun 2014 04:00:11 +0000
From: Dario Strbenac <dstr7...@uni.sydney.edu.au>
To: "bioc-devel@r-project.org" <bioc-devel@r-project.org>
Subject: [Bioc-devel] edgeR estimateGLMRobustDisp Fails when Called
      From A  Package

Hello,

I am writing a package that has a function that uses estimateGLMRobustDisp, 
leading to an error :

Error in dispBinTrend(y, design, offset = offset, method.trend = "loess",  :
 could not find function "loessFit"
Calls: edgeRselection ... estimateGLMTrendedDisp -> estimateGLMTrendedDisp.default 
-> dispBinTrend

I import estimateGLMRobustDisp from edgeR in my NAMESPACE file. This
error is because edgeR depends on limma, rather than importing from it.
I want to avoid using parent.env<- and .onLoad to get around the
problem. Is there any hope of modifying the edgeR description file to
have limma in the Imports field ?

Nope, because that is neither necessary nor good programming practice
(according to R core).

I will however add loessFit to importFrom() in edgeR's NAMESPACE, which I
think will solve your problem.

Best wishes
Gordon

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

------------------------------

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to