[Bioc-devel] calling the function from the wrong package: union from IRanges and graph
mattia.pelizzola at gmail.com
Tue Jul 27 22:46:47 CEST 2010
I am building a package and I have a strange issue that is even
difficult to provide an example for.
I have a method 'Join' in this package that I am working on that uses
the union function from the IRanges library.
Now, on a clean R startup, if I load my library and I use this method
Join I get an error. I think that the union function from the library
graph is called in place of the one from IRanges ..
> Join(gel1, gel2, method='union')
Error in as.vector(x) : no method for coercing this S4 class to a vector
4: unique(c(as.vector(x), as.vector(y)))
3: union(IR1, IR2)
2: Join(gel1, gel2, method = "union")
1: Join(gel1, gel2, method = "union")
At the same time, if I execute on the console:
> union(IRanges(), IRanges())
IRanges of length 0
it works perfectly.
Finally, if I manually source the code containing my Join method, even
the union function within this method now is working ..
> a=Join(gel1, gel2, method='union')
This is the same code of the library that is installed and running ..
I know that now the method is on my GlobalEnv but I can't understand
how this would change the result.
standardGeneric for "union" defined from package "base"
function (x, y)
Methods may be defined for arguments: x, y
Use showMethods("union") for currently available ones.
Function: union (package base)
I am quite confused and sorry that I can't provide any more meaningful example,
R version 2.11.0 (2010-04-22)
 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
 LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
 LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
 LC_PAPER=en_US.UTF-8 LC_NAME=C
 LC_ADDRESS=C LC_TELEPHONE=C
 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
 grid stats graphics grDevices utils datasets methods
other attached packages:
 methylPipe_1.0.0 RMySQL_0.7-4 BSgenome_1.16.1
 Biostrings_2.16.0 GenomicRanges_1.0.1 IRanges_1.6.1
 GOstats_2.14.0 RSQLite_0.9-0 DBI_0.2-5
 graph_1.26.0 Category_2.14.0 AnnotationDbi_1.10.1
 Biobase_2.8.0 rtracklayer_1.8.1 RCurl_1.4-2
 nlme_3.1-96 snow_0.3-3 marray_1.26.0
 limma_3.4.0 gplots_2.7.4 caTools_1.10
 bitops_1.0-4.1 gdata_2.8.0 gtools_2.6.2
loaded via a namespace (and not attached):
 annotate_1.26.0 genefilter_1.30.0 GO.db_2.4.1 GSEABase_1.10.0
 lattice_0.18-5 RBGL_1.24.0 splines_2.11.0 survival_2.35-8
 tools_2.11.0 XML_3.1-0 xtable_1.5-6
More information about the Bioc-devel