Question: Error: 'exprs<-' is not an exported object from 'namespace:affy'
0
4 weeks ago by
abolfazl.nikakhtar0 wrote:

hello I was just doing my project everything was OK but i encounter an horrendous error

Error: 'exprs<-' is not an exported object from 'namespace:affy'


what shoud I do? my code is

data=loadMAdata(setup ="targets.txt",annotation = "Annotation.txt",normalization = "plier"
#normalization="plier","mas5'"RMA"


I don't know what is wrong with it ,

affy limma piano • 110 views
modified 4 weeks ago by James W. MacDonald51k • written 4 weeks ago by abolfazl.nikakhtar0
Answer: Error: 'exprs<-' is not an exported object from 'namespace:affy'
3
4 weeks ago by
United States
James W. MacDonald51k wrote:

The problem is in the piano package, which seems to want to do lots of fully qualified function calling, without trying to figure out where the functions come from. In loadMAdata there is this bit:

  if(nCelFiles > 0 & missing(dataNorm)) {
colnames(affy::exprs(dataRaw)) <- gsub("\\.CEL","",colnames(affy::exprs(dataRaw)), ignore.case=TRUE)
colnames(affy::exprs(dataRaw)) <- gsub("\\.gz","",colnames(affy::exprs(dataRaw)), ignore.case=TRUE)
if(sum(duplicated(colnames(affy::exprs(dataRaw)))) > 0) stop("found samples with identical names")
.verb("...done", verbose)


Where things like affy::exprs(dataRaw) are trying to use a function from the affy package that isn't a function in the affy package:

> affy::exprs(Dilution) <- exprs(Dilution)
Error: 'exprs<-' is not an exported object from 'namespace:affy'
> Biobase::exprs(Dilution) <- exprs(Dilution)


But instead is a function defined in the Biobase package. Ideally the maintainer of this package is subscribed to this support site and will see this thread and fix the function. Failing that you can contact him directly using the email address found by

packageDescription("piano")$Main  ADD COMMENTlink written 4 weeks ago by James W. MacDonald51k Or better still, follow packageDescription("piano")$BugReports which gives

https://github.com/varemo/piano/issues

It seems surprising to me that this error isn't picked up by R CMD check. I guess that's because the affy package does define methods for both exprs and exprs<-? I suspect the piano package needs to import exprs<- from Biobase in its NAMESPACE file, like it already imports exprs.

Thanks for the pointers, I will try to fix this as soon as possible. As I understand it exprs and exprs<- are methods in affy. Currently exprs is imported in the piano NAMESPACE from Biobase. I will add exprs<- there as well. But should the function code also be altered so that affy:: is replaced by Biobase:: in the examples above? I have difficulties understanding how to use packagename:: in connection to methods vs functions.

Leif, if you import the function in NAMESPACE, then you should not need a package qualifier at all when you use the function. So you shouldn't need affy:: or Biobase::.

I agree that R CMD check should pick this up. I reported this on R’s Bugzilla: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17613

Another issue maybe is that the affy package defines exprs and exprs<- methods but only exports the former. I changed this in affy 1.63.1.

Anyway, as far as the piano package is concerned, I also agree that it should call the exprs and exprs<- generics, which are both defined in the Biobase package. In my experience trying to call specific methods is not robust so calling the generic should be preferred.

H.

FYI this R CMD check bug has been fixed in R-devel: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17613

Thanks all for the clarifications! Will implement asap.