[BioC] Error in .local(.Object, ...) : could not find function "checkClass"

Martin Morgan mtmorgan at fhcrc.org
Tue Dec 8 19:54:30 CET 2009


Hi Elmar --

Ext-Elmar.Bucher at vtt.fi wrote:
> Dear List, 
> 
> I'm writing on extension of the eSet class. 
> 
> getMethod("initialize","eSet") and getMethod("sampleNames<-","AssayData") from the Biobase package are particularly using functions like "checkClass", "assayDataEnvLock", "assayDataStorageMode". 
> 
> In my implementation I would like to use the same functions but I receive errors like: 
> Error in .local(.Object, ...) : could not find function "checkClass"
> 
> Why? 
> How can I enable my code to use this functions? Because the eSet initialize code seems to be able to use this functions, whit the very same packages loaded.
> I have the same problem on linux and windows machines. See sessionInfo below. 

These functions are defined in Biobase but not exported. They are
accessible with

  Biobase:::checkClass

and the like, but probably you do not want to do this. Perhaps you want
to use callNextMethod() or similar, or the functions that are actually
exported? What specifically do you want to accomplish? Maybe some hints
in, e.g.,

  library(oligoClasses)
  selectMethod(initialize, "SnpCallSetPlus")

If I'd written a class to do something special with 'sampleNames', say
force them to be upper case, then I might do something like

  setClass("A", contains="eSet")
  setReplaceMethod("sampleNames", c("A", "character"),
                   function(object, value)
  {
       callNextMethod(object=object, value=toupper(value))
  })

and then

> a = new("A", exprs=matrix(rnorm(200), 20))
> sampleNames(a)
 [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10"
> sampleNames(a) <- letters[1:10]
> sampleNames(a)
 [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J"
>



Martin

> 
> Grateful for help, Elmar 
>  
> 
> 
>> sessionInfo()
> R version 2.10.0 (2009-10-26)
> x86_64-pc-linux-gnu
> 
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> other attached packages:
> [1] RBioinf_1.6.0 graph_1.20.0  Biobase_2.6.0
> 
> loaded via a namespace (and not attached):
> [1] cluster_1.12.1 tools_2.10.0
> 
>> sessionInfo()
> R version 2.10.0 (2009-10-26) 
> i386-pc-mingw32 
> 
> locale:
> [1] LC_COLLATE=English_United Kingdom.1252 
> [2] LC_CTYPE=English_United Kingdom.1252   
> [3] LC_MONETARY=English_United Kingdom.1252
> [4] LC_NUMERIC=C                           
> [5] LC_TIME=English_United Kingdom.1252    
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> other attached packages:
> [1] RBioinf_1.6.0 graph_1.24.1  Biobase_2.6.0
> 
> loaded via a namespace (and not attached):
> [1] tools_2.10.0
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list