[Bioc-devel] importing packages without a name space
Laurent Gatto
L.Gatto at dnavision.be
Tue Apr 17 09:16:04 CEST 2007
Hello,
> If your package has a NAMESPACE file then the package initialization
> function that will be run is .onLoad and .First.lib will be ignored.
> So I'm pretty sure all of the code in .First.lib is not getting run.
Yes indeed, I also tried to R CMD check the package without .Fist.Lib
and it had no impact on the error message. I now moved
.createYAQCEnvironment() in .onLoad.
> But are you sure you need all of that code anyhow? It looks to me
> like you have copy/pasted from another package (I'd like to know which
> one because perhaps it is not needed there either). There was a time
> long ago when S4 using packages needed such an arrangement, but in
> general they no longer do (there are a few cases, but I doubt your
> package is among them).
You are right. I started to write the code using simpleaffy as an
example, as it does similar things. Everything worked fine (and still
does) without the NAMESPACE file.
> So I'm guessing that .initClassesAndMethods() contains all of your
> setClass and setMethod calls. Can you try just putting those at the
> package level in your R code?
All the setClass and SetMethods are in the main R file.
> What does .createYAQCEnvironment do?
The function creates a new environment and loads some data that is
stored in a file in the data directory of the package:
.createYAQCEnvironment <- function() {
if(!exists(".yaqcEnv")) {
.yaqcEnv <- new.env()
data(morespikes,envir =.yaqcEnv )
assign(".yaqcEnv",.yaqcEnv,envir=globalenv())
}
}
> Have you exported all classes and methods in your NAMESPACE file?
Yes, I export the class with 'exportClasses("YAQCStats")', the formal
methods with exportMethods() and the other function with export().
> Perhaps you want to post your DESCRIPTION file as well, R is fairly
> picky about the syntax and I'd like to rule that out.
Package: yaqcaffy
Title: Affymetrix expression data quality control and reproducibility
analysis
Version: 0.0.12
Author: Laurent Gatto
Description: Quality control of Affymetrix GeneChip expression data
and reproducibility analysis of human whole genome chips
with the MAQC reference datasets.
Maintainer: Laurent Gatto <l.gatto at dnavision.be>
Depends: R (>= 2.0), simpleaffy, methods
Imports: geneplotter
biocViews: Microarray,OneChannel,QualityControl
License: The Artistic License, Version 2.0
URL: http://www.bioconductor.org
Thank you,
Laurent
--
Laurent Gatto
www.dnavision.be
More information about the Bioc-devel
mailing list