Dear BioC-devel list, I have what I hope is a simple problem. Basically, a function in my package uses bumphunter::annotateNearest. This function in turn uses IRanges::distance.
I would expect that using the following roxygen2 info would work: #' @importMethodsFrom IRanges distance #' @importFrom bumphunter annotateNearest #' @importFrom IRanges distance Note that "distance" is a generic in IRanges with methods for "Ranges" https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/IRanges/R/nearest-methods.R When using devtools::check (or R CMD check) I end up with the following error: Error in withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning")) : could not find function "distance" Calls: analyzeChr -> annotateNearest -> .matchGenes -> nearestgene Execution halted Note that using library("bumphunter") before the annotateNearest call works. But we would like to have it work by using the correct namespace imports. Thank you for your help! Best, Leonardo PS Function in question is https://github.com/lcolladotor/derfinder/blob/master/R/analyzeChr.R > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-apple-darwin10.8.0 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] derfinder_0.0.34 RcppArmadillo_0.3.920.1 Rcpp_0.10.6 roxygen2_2.2.2 digest_0.6.3 devtools_1.3 loaded via a namespace (and not attached): [1] AnnotationDbi_1.24.0 Biobase_2.22.0 BiocGenerics_0.8.0 biomaRt_2.18.0 Biostrings_2.30.1 biovizBase_1.10.3 [7] bitops_1.0-6 brew_1.0-6 BSgenome_1.30.0 bumphunter_1.2.0 cluster_1.14.4 codetools_0.2-8 [13] colorspace_1.2-4 DBI_0.2-7 dichromat_2.0-0 doRNG_1.5.5 evaluate_0.5.1 foreach_1.4.1 [19] GenomicFeatures_1.14.0 GenomicRanges_1.14.3 ggbio_1.10.7 ggplot2_0.9.3.1 grid_3.0.2 gridExtra_0.9.1 [25] gtable_0.1.2 Hmisc_3.12-2 httr_0.2 IRanges_1.20.5 iterators_1.0.6 itertools_0.1-1 [31] labeling_0.2 lattice_0.20-24 locfit_1.5-9.1 MASS_7.3-29 matrixStats_0.8.12 memoise_0.1 [37] munsell_0.4.2 parallel_3.0.2 pkgmaker_0.17.4 plyr_1.8 proto_0.3-10 qvalue_1.36.0 [43] R.methodsS3_1.5.2 RColorBrewer_1.0-5 RCurl_1.95-4.1 registry_0.2 reshape2_1.2.2 rngtools_1.2.3 [49] rpart_4.1-3 Rsamtools_1.14.1 RSQLite_0.11.4 rtracklayer_1.22.0 scales_0.2.3 stats4_3.0.2 [55] stringr_0.6.2 tcltk_3.0.2 tools_3.0.2 VariantAnnotation_1.8.5 whisker_0.3-2 XML_3.95-0.2 [61] xtable_1.7-1 XVector_0.2.0 zlibbioc_1.8.0 Leonardo Collado Torres, PhD student Department of Biostatistics Johns Hopkins University Bloomberg School of Public Health Website: http://www.biostat.jhsph.edu/~lcollado/<http://bit.ly/LColladoTorres> Blog: http://lcolladotor.github.io/ <http://bit.ly/FellBit> [[alternative HTML version deleted]] _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel