Dear guRu's,
please help me escape dependency hell...
in my package foo, i'm trying to replace the 'sampleNames<-' method from package lumi. This works well, ie I can install foo, and execute the updated code.

However, if my package foo imports oligoClasses, (or as it turns out, a chain of dependencies which lead to oligoClasses), I get this error during INSTALL
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘foo’ ...
** R
** preparing package for lazy loading
Warning: replacing previous import ‘image’ when loading ‘graphics’
Warning: replacing previous import ‘density’ when loading ‘stats’
Warning: replacing previous import ‘residuals’ when loading ‘stats’
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning: replacing previous import ‘image’ when loading ‘graphics’
Warning: replacing previous import ‘density’ when loading ‘stats’
Warning: replacing previous import ‘residuals’ when loading ‘stats’
Error : package slot missing from signature for generic ‘sampleNames<-’
and classes LumiBatch, ANY
cannot use with duplicate class names (the package may need to be re-installed)
Error: loading failed
Execution halted
*** arch - x86_64
Warning: replacing previous import ‘image’ when loading ‘graphics’
Warning: replacing previous import ‘density’ when loading ‘stats’
Warning: replacing previous import ‘residuals’ when loading ‘stats’
Error : package slot missing from signature for generic ‘sampleNames<-’
and classes LumiBatch, ANY
cannot use with duplicate class names (the package may need to be re-installed)
Error: loading failed
Execution halted
ERROR: loading failed for ‘i386’, ‘x86_64’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/foo’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/foo’

The message tells me its a problem with my 'sampleNames<-' method, however it looks fine to me:
1) foo installs just fine when I don't import oligoClasses
2) My sampleNames<- code can be pasted into an R session just fine
3) the error appears as soon as I add a import(oligoClasses) or importFrom(oligoClasses,'sampleNames<-') to foo's NAMESPACE

I've had a look at oligoClasses, and it seems to be playing by the rules: it importMethodsFrom(Biobase, "sampleNames<-") and exportMethods("sampleNames<-") for a 'RangedDataCNV' class. It doesn't import lumi, nor does it know about sampleNames<-,LumiBatch,ANY-method

i've spent a few days trying to work this one out, so can anyone point me in the right direction?

cheers,
Mark

foo/R/LumiBatch-methods.R:
#' @name LumiBatch-methods
#' @title a collection of LumiBatch manipulators
#' @description \code{sampleNames<-}: set sampleNames in LumiBatch objects, 
#' including the QC, vstParameter, transformFun and controlData slots
#' 
#' @note code came from lumi_2.8.0 & modified by MJC to set the controlData slot
#'  properly
#' 
#' @param object an \code{LumiBatch} object
#' @param value a character vector of column names
#' @return a \code{LumiBatch} object
#' @rdname LumiBatch-methods
#' @aliases sampleNames<-,LumiBatch,ANY-method
#' @export
#' @importMethodsFrom Biobase "sampleNames<-"
#' @importMethodsFrom lumi "sampleNames<-"
#' @import oligoClasses
setMethod("sampleNames<-",
	signature=signature("LumiBatch", "ANY"),
	function(object, value) {
		object <- callNextMethod()
		ddim <- dim(object)
		if (!is.null(object@QC)) {
			QC <- object@QC
			if (!is.null(QC$sampleSummary)) 
				if (ncol(QC$sampleSummary) == ddim[2]) 
					colnames(QC$sampleSummary) <- value
			if (!is.null(QC$BeadStudioSummary)) 
				if (nrow(QC$BeadStudioSummary) == ddim[2]) 
					rownames(QC$BeadStudioSummary) <- value
			object@QC <- QC
		}
		if (!is.null(attr(object, "vstParameter"))) {
			vstParameter <- attr(object, "vstParameter")
			if (!is.null(nrow(vstParameter))) {
				if (nrow(vstParameter) == ddim[2]) {
					rownames(vstParameter) <- value
					transformFun <- attr(object, "transformFun")
					names(transformFun) <- value
					attr(object, "vstParameter") <- vstParameter
					attr(object, "transformFun") <- transformFun
				}
			}
		}
		if (nrow(object@controlData) > 0) {
			# modified by MJC
			colnames(controlData(object)) <- c("controlType", "ProbeID", value)
		}
		return(object)
	}
)


foo/NAMESPACE:
exportMethods("sampleNames<-")
import(oligoClasses)
importMethodsFrom(Biobase,"sampleNames<-")
importMethodsFrom(lumi,"sampleNames<-")


foo/DESCRIPTION:
Package: foo
Maintainer: Mark Cowley <m.cowley@garvan.org.au>
License: GPL-2
Title: Quicktest package for rapid development with testthat facilities
Author: Mark Cowley <m.cowley@garvan.org.au>
Description: A lightweight library for rapid iterative development of new
    code and test suites. Once code is confirmed to work, you should move it out
    to a dedicated package.
Version: 0.1
Date: 2012-08-01
Depends:
    R (>= 2.0),
    methods,
    Biobase,
    lumi
Suggests:
    roxygen2,
    testthat,
Imports:
    Biobase,
    lumi,
    oligoClasses
Collate:
    'LumiBatch-methods.R'


> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lumi_2.8.0         nleqslv_1.9.3      methylumi_2.2.0    ggplot2_0.9.1     
[5] reshape2_1.2.1     scales_0.2.1       Biobase_2.16.0     BiocGenerics_0.2.0

loaded via a namespace (and not attached):
 [1] affy_1.34.0           affyio_1.24.0         annotate_1.34.1      
 [4] AnnotationDbi_1.18.1  bigmemory_4.2.11      BiocInstaller_1.4.7  
 [7] Biostrings_2.24.1     bitops_1.0-4.1        BSgenome_1.24.0      
[10] colorspace_1.1-1      DBI_0.2-5             dichromat_1.2-4      
[13] digest_0.5.2          DNAcopy_1.30.0        GenomicRanges_1.8.9  
[16] genoset_1.6.0         grid_2.15.1           hdrcde_2.16          
[19] IRanges_1.14.4        KernSmooth_2.23-8     labeling_0.1         
[22] lattice_0.20-6        MASS_7.3-19           Matrix_1.0-6         
[25] memoise_0.1           mgcv_1.7-19           munsell_0.3          
[28] nlme_3.1-104          plyr_1.7.1            preprocessCore_1.18.0
[31] proto_0.3-9.2         RColorBrewer_1.0-5    RCurl_1.91-1         
[34] Rsamtools_1.8.5       RSQLite_0.11.1        rtracklayer_1.16.3   
[37] stats4_2.15.1         stringr_0.6.1         tools_2.15.1         
[40] XML_3.9-4             xtable_1.7-0          zlibbioc_1.2.0       



	[[alternative HTML version deleted]]

