[Bioc-devel] Environment/RSqlite db interaction

Martin Morgan mtmorgan at fhcrc.org
Wed Sep 12 21:50:40 CEST 2007


John --

It's inherited from further up the search path

> library("hgu95av2.db")
> library("hgu95av2")
> exists("db_conn", as.environment("package:hgu95av2"))
[1] TRUE
> exists("db_conn", as.environment("package:hgu95av2"), inherits=FALSE)
[1] FALSE

This is probably a general issue when multiple packages with
near-identical variables can be loaded.

I think seth will chime in with the future of db_conn, relating to
issues like this.

Martin

"James W. MacDonald" <jmacdon at med.umich.edu> writes:

> Hi,
>
> I have stumbled upon a weird interaction between the SQlite-based 
> annotation packages and the old environment-based packages.
>
> The annaffy package has a function is_dbpackage() that is used to strip 
> off the .db at the end of the SQlite packages, using something like this:
>
> tmp <- as.environment(paste("package", chip, sep=":"))
> exists("db_conn", tmp)
>
> If a SQlite package is loaded first, this test fails:
>
>  > library(GO.db)
> Loading required package: AnnotationDbi
> Loading required package: Biobase
> Loading required package: tools
>
> Welcome to Bioconductor
>
>    Vignettes contain introductory material. To view, type
>    'openVignette()'. To cite Bioconductor, see
>    'citation("Biobase")' and for packages 'citation(pkgname)'.
>
> Loading required package: DBI
> Loading required package: RSQLite
>  > library(mouse4302)
>  > tmp <- as.environment("package:mouse4302")
>  > exists("db_conn", tmp)
> [1] TRUE
>
> But if the env-based package is loaded first, it works:
>
>  > library(mouse4302)
>  > library(GO.db)
> Loading required package: AnnotationDbi
> Loading required package: Biobase
> Loading required package: tools
>
> Welcome to Bioconductor
>
>    Vignettes contain introductory material. To view, type
>    'openVignette()'. To cite Bioconductor, see
>    'citation("Biobase")' and for packages 'citation(pkgname)'.
>
> Loading required package: DBI
> Loading required package: RSQLite
>  > tmp <- as.environment("package:mouse4302")
>  > exists("db_conn", tmp)
> [1] FALSE
>
> I can get around this behavior for now by remembering to load the envs I 
> need to use with annaffy first. However, for end users this won't 
> necessarily be an option, and annaffy fails miserably if you load things 
> in the 'wrong' order.
>
> Is this something that needs to be fixed in annaffy, or should this test 
> reliably detect the difference between an env or SQlite based package?
>
> Best,
>
> Jim
>
> Oh yeah, I almost forgot:
>
>  > sessionInfo()
> R version 2.6.0 alpha (2007-09-11 r42820)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
> States.1252;LC_MONETARY=English_United 
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] tools     stats     graphics  grDevices datasets  utils     methods
> [8] base
>
> other attached packages:
> [1] GO.db_1.17.1         AnnotationDbi_0.1.15 RSQLite_0.6-0
> [4] DBI_0.2-3            Biobase_1.15.33      mouse4302_1.17.0
> [7] rcompgen_0.1-15
>
> ---
> James W. MacDonald, M.S.
> Biostatistician
> Affymetrix and cDNA Microarray Core
> University of Michigan Cancer Center
> 1500 E. Medical Center Drive
> 7410 CCGC
> Ann Arbor MI 48109
> 734-647-5623
>
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org



More information about the Bioc-devel mailing list