Skip to content

[Bioc-devel] Problems with imported ShortRead pkg

6 messages · Hahne, Florian, Martin Morgan, Anita Lerch

#
Hi,

I have two problems when I import ShortRead into my packages.
1. I get the following warning, when I load my package
   Warning message:
   "replacing previous import ?show? when loading ?ShortRead?"
   --> It looks to me like a conflict between BiocGenerics and
       ShortRead. How can I get rid of this message?

2. I need a require(ShortRead) in my function even when I import 
   ShortRead entirely.
   --> Put ShortRead to Depends would solve this issue, but this is 
       not a solution for me.
   At the moment a have a require in the function and ShortRead in
   the Suggests field to pass the checks. This is working, but is a
   hack.

Greetings,
Anita

Here a mini package which shows the same behaviour:

*********
NAMESPACE
*********
import(methods)
import(BiocGenerics)
import(ShortRead)
export(funA, funB)

******
fun.R
******
funA <- function(){
	message("Step A.1")
	filters <- c(nFilter(2), dustyFilter(0.5))
    message("Step A.2")
	active(filters) <- TRUE
}

funB <- function(){
    message("Step B.1")
    require(ShortRead)
    filters <- c(nFilter(2), dustyFilter(0.5))
    message("Step B.2")
    active(filters) <- TRUE
}

***********
DESCRIPTION
***********
Package: anRpackage
Type: Package
Title: What the package does (short line)
Version: 1.0
Date: 2012-11-16
Author: Who wrote it
Maintainer: Who to complain to <yourfault at somewhere.net>
Depends: R (>= 2.15.0)
Imports: methods, BiocGenerics, ShortRead
Description: More about what it does (maybe more than one line)
License: What license is it under?
Warning message:
replacing previous import ?show? when loading ?ShortRead?
Step A.1
Error in asMethod(object) : could not find function "FilterRules"
Step B.1
Loading required package: ShortRead
Loading required package: BiocGenerics
Attaching package: ?BiocGenerics?
The following object(s) are masked from ?package:stats?:
    xtabs
The following object(s) are masked from ?package:base?:
    anyDuplicated, cbind, colnames, duplicated, eval, Filter, Find, get, intersect, lapply, Map, mapply, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rbind, Reduce, rep.int, rownames, sapply, setdiff,
    table, tapply, union, unique
Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: lattice
Loading required package: Rsamtools
Loading required package: latticeExtra
Loading required package: RColorBrewer
Step B.2
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] ShortRead_1.16.2     latticeExtra_0.6-24  RColorBrewer_1.0-5   Rsamtools_1.10.2     lattice_0.20-6      
 [6] Biostrings_2.26.2    GenomicRanges_1.10.5 IRanges_1.16.4       BiocGenerics_0.4.0   anRpackage_1.0      

loaded via a namespace (and not attached):
[1] Biobase_2.18.0  bitops_1.0-5    grid_2.15.1     hwriter_1.3     parallel_2.15.1 stats4_2.15.1   tools_2.15.1   
[8] zlibbioc_1.4.0
#
Hi Anita,
it seems that FilterRules is defined in the IRanges package. If you want
to use it you will have to explicitly import it. Can't quite see how this
is related to importing or not importing ShortRead. The only reason why
this works when you require ShortRead is because it depends on IRanges and
will automatically attach it. This does not happen when you just import
from it.
Florian
On 11/16/12 12:40 PM, "Anita Lerch" <anita.lerch at fmi.ch> wrote:

            
#
Oh wait, correction. Not your fault. I thought you call FilterRules
directly. So ShortRead is using it internally in methods-SRFilter.R and
never imports it from IRanges. Looks like a simple fix in there.
Florian
2 days later
#
Hi,
even if I import IRanges, the error persist.
Anita
On Fri, 2012-11-16 at 13:42 +0000, Hahne, Florian wrote:

  
    
#
On 11/19/2012 02:15 AM, Anita Lerch wrote:
I've updated ShortRead (in devel, which requires using R-devel) to 1.17.5, 
addressing the import problem. This is available via svn now or biocLite 
tomorrow (Tuesday) after 10am Seattle time.

I think the 'show' problem has also been addressed, but would appreciate hearing 
otherwise.

Martin

  
    
2 days later
#
Great!
Both problem are solved.
Thanks a lot.
On Mon, 2012-11-19 at 07:08 -0800, Martin Morgan wrote: