[Bioc-devel] Environment/RSqlite db interaction
James W. MacDonald
jmacdon at med.umich.edu
Wed Sep 12 21:36:59 CEST 2007
OK, that looks like it was written by a crackhead ;-D
What I meant to say is annaffy uses a function to test if a package is
an env or a .db using is_dbpackage(), which fails if a .db package is
loaded first.
The question here is whether the function is_dbpackage() is doing the
correct test, or if something weird is going on that causes a perfectly
good test to go awry.
Best,
Jim
James W. MacDonald wrote:
> 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
--
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
More information about the Bioc-devel
mailing list