[BioC] AnnotationDbi weirdness

Marc Carlson mcarlson at fhcrc.org
Wed Oct 24 01:13:34 CEST 2012


Also,

I forgot to mention this helper (which saves time on the dbConnect call).

mogene10sttranscriptcluster_dbfile()

So you could also write it like this:

phew <- dbConnect(SQLite(), mogene10sttranscriptcluster_dbfile())


   Marc



On 10/23/2012 03:55 PM, Marc Carlson wrote:
> Hi Jim,
>
> What you have discovered is that the "_dbconn()" function returns the 
> database connection to the DB for the package that is used by all the 
> bimaps.  If you call dbDisconnect on it, you will destroy the 
> connection and break all the objects that depend on it.  :(
>
> If you want to make a connection that you can subsequently disconnect 
> from (somewhat curious about why you want that), then you should 
> probably point to the DB itself using system.file.  That should be 
> straightforward for all our standard packages since we always observe 
> the convention of placing the DB in the extdata dir and naming it 
> after the package.  So in this case:
>
> phew <- dbConnect(SQLite(), 
> system.file("extdata","mogene10sttranscriptcluster.sqlite", 
> package="mogene10sttranscriptcluster.db"))
>
>
>   Marc
>
>
>
> On 10/23/2012 01:54 PM, James W. MacDonald wrote:
>> I am having the following problem:
>>
>> > aargh <- mogene10sttranscriptcluster_dbconn()
>> > dbDisconnect(aargh)
>> [1] TRUE
>> > get("10338001", mogene10sttranscriptclusterENTREZID)
>> Error in sqliteExecStatement(con, statement, bind.data) :
>>   RS-DBI driver: (expired SQLiteConnection)
>>
>> Any suggestions?
>>
>> Best,
>>
>> Jim
>>
>> > sessionInfo()
>> R version 2.15.1 (2012-06-22)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>>  [3] 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
>>  [7] LC_PAPER=C                 LC_NAME=C
>>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] mogene10sttranscriptcluster.db_8.0.1 org.Mm.eg.db_2.8.0
>> [3] RSQLite_0.11.2                       DBI_0.2-5
>> [5] AnnotationDbi_1.20.2                 Biobase_2.18.0
>> [7] BiocGenerics_0.4.0
>>
>> loaded via a namespace (and not attached):
>> [1] IRanges_1.16.3  parallel_2.15.1 stats4_2.15.1
>>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: 
> http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list