The `GO.db` package comes with an sqlite database file. It looks like there is an issue calling the sqlite database from MonetDB.

On Thu, May 12, 2016 at 9:38 AM, Willem Ligtenberg <willem.ligtenberg@openanalytics.eu> wrote:
Hi,

I am trying to run some R code in database.
Most of it is going pretty well, but I seem to have stumbled on a bug.
I cannot load the following package, which is a dependency for some of my code.
WGCNA

I have been chasing it down, and it seems to be due to an error when trying to load GO.db.
I get the following error:
Error in .local(conn, statement, ...) :
  Unable to execute statement 'SELECT * FROM tmp_test();'.
Server says '!Error running R expression. Error message: Error in as.data.frame((function() { : '.

Digging a bit further it seems to be due to the following statement:
dbconn <- dbFileConnect(dbfile)

Error can be reproduced using:
functionDef <- paste(
    "CREATE FUNCTION tmp_test() ",
    "RETURNS TABLE(output STRING)",
    "LANGUAGE R ",
    "{",
    "library(AnnotationDbi)",
    "datacache <- new.env(hash=TRUE, parent=emptyenv())",
    "pkgname <- 'GO.db'",
    "libname <- .libPaths()[1]",
    "dbfile <- system.file('extdata', 'GO.sqlite', package=pkgname, lib.loc=libname)",
    "assign('dbfile', dbfile, envir=datacache)",
    "dbconn <- dbFileConnect(dbfile)",
    "};", sep = "\n")

dbGetQuery(conn, functionDef)

dbGetQuery(conn, "SELECT * FROM tmp_test();")

By the way, installing GO.db from within MonetDB works just fine.
And can be done using the following R code:
source("https://bioconductor.org/biocLite.R")
biocLite("GO.db")

Hints on how to resolve this are greatly appreciated.

Kind regards,

Willem
_______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list