Restoring TranscriptDb object crashes R-session
1
0
Entering edit mode
@halian-vilela-4954
Last seen 9.6 years ago
Hi guys, this week I've managed to construct a TranscripDb object from the gene database I was using for analysis, and for my surprise every time I try to use the saved txdb data my Rsession crashes! When I generate a fresh object using the makeTranscriptDb() function everything works flawlessly, but whenever I save the object (with save() or when the object is within a saved workspace) and try to reload it then R crashes. I'm using the Rstudio IDE, so it realy crashes and exit the program. If I try to use it in the command line interface, then I get the following traceback: ##################################### TRACEBACK ######################################### > txdb TranscriptDb object: Traceback: 1: .Call("RS_SQLite_exec", conId, statement, bind.data, PACKAGE = .SQLitePkgName) 2: sqliteExecStatement(con, statement, bind.data) 3: sqliteQuickSQL(conn, statement, ...) 4: dbGetQuery(con, paste("SELECT * from", name)) 5: dbGetQuery(con, paste("SELECT * from", name)) 6: doTryCatch(return(expr), name, parentenv, handler) 7: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 8: tryCatchList(expr, classes, parentenv, handlers) 9: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L msg <- conditionMessage(e) sm <- strsplit(msg, "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if is.na(w)) w <- 14L + nchar(dcall, type = "b") + nch ar(sm[1L], type = "b") if (w > LONG) prefix <- paste(prefix, "\n ", sep = "") } else prefix <- "Error : " msg <- paste(prefix, conditionMessage(e), "\n", sep = "") .Internal(seterrmessage(msg[1L])) i f (!silent && identical(getOption("show.error.messages"), TRUE)) { cat(msg, file = stderr()) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 10: try(dbGetQuery(con, paste("SELECT * from", name))) 11: sqliteReadTable(conn, name, ...) 12: is(object, Cl) 13: is(object, Cl) 14: .valueClassTest(standardGeneric("dbReadTable"), "data.frame", "dbReadTable") 15: dbReadTable(dbConn(x), "metadata") 16: .local(x, ...) 17: metadata(object) 18: metadata(object) 19: function (object) standardGeneric("show")(<s4 object="" of="" class="" "transcriptdb"="">) 20: function (object) standardGeneric("show")(<s4 object="" of="" class="" "transcriptdb"="">) Error in sqliteExecStatement(con, statement, bind.data) : caught access violation - continue with care Error in sqliteReadTable(conn, name, ...) : could not find table metadata ######################################## TRACEBACK END ############################################ So what's may be going on ? I've already checked my versions, all Bioconductor packages are up to date, and as I said, it works without any errors if I just recreate the object. But this approach is very clumbersome because I'm using multiple machines so I have to share data constantly between them, the ideal approach would be being able to save the object and use it. Oh, it alse works if I use saveFeatures() to dump and then use loadFeatures() to recover, but I still thinks it's not as practical because I'll never get a totally functional workspace I one of the objects crashes my session and I have to reload it every time I want to use it. Thanks a lot, Halian > sessionInfo() R version 2.14.0 (2011-10-31) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] GenomicFeatures_1.6.4 AnnotationDbi_1.16.5 Biobase_2.14.0 [4] GenomicRanges_1.6.4 IRanges_1.12.3 loaded via a namespace (and not attached): [1] biomaRt_2.10.0 Biostrings_2.22.0 BSgenome_1.22.0 DBI_0.2-5 [5] RCurl_1.7-0.1 RSQLite_0.10.0 rtracklayer_1.14.4 tools_2.14.0 [9] XML_3.4-2.2 zlibbioc_1.0.0 [[alternative HTML version deleted]]
• 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 2 days ago
United States
On 12/03/2011 07:44 AM, Halian Vilela wrote: > Hi guys, this week I've managed to construct a TranscripDb object from the > gene database I was using for analysis, and for my surprise every time I > try to use the saved txdb data my Rsession crashes! > > When I generate a fresh object using the makeTranscriptDb() function > everything works flawlessly, but whenever I save the object (with save() or > when the object is within a saved workspace) and try to reload it then R Hi Halian -- As you've discovered the right thing to do is to use saveFeatures / loadFeatures. The problem is that the object contains a connection to the SQLite data base, and that connection is not being saved and restored correctly. In some ways it can't always be saved and restored, e.g., if between R sessions you were to change the location where the data base were stored. So I think the base expectation is 'it won't work to save() / load()'. At the same time it shouldn't crash your R session. I think the problem is lower in the hierarchy, e.g., library(RSQLite) m <- dbDriver("SQLite") con <- dbConnect(m, dbname = tempfile()) data(USArrests) dbWriteTable(con, "USArrests", USArrests) ## read on an expired connection segfaults dbDisconnect(con) dbReadTable(con, "USArrests") I'll bring this to the attention of the RSQLite maintainer. Thanks for the report. Martin > crashes. I'm using the Rstudio IDE, so it realy crashes and exit the > program. If I try to use it in the command line interface, then I get the > following traceback: > > ##################################### TRACEBACK > ######################################### >> txdb > TranscriptDb object: > > Traceback: > 1: .Call("RS_SQLite_exec", conId, statement, bind.data, PACKAGE = > .SQLitePkgName) > 2: sqliteExecStatement(con, statement, bind.data) > 3: sqliteQuickSQL(conn, statement, ...) > 4: dbGetQuery(con, paste("SELECT * from", name)) > 5: dbGetQuery(con, paste("SELECT * from", name)) > 6: doTryCatch(return(expr), name, parentenv, handler) > 7: tryCatchOne(expr, names, parentenv, handlers[[1L]]) > 8: tryCatchList(expr, classes, parentenv, handlers) > 9: tryCatch(expr, error = function(e) { call<- conditionCall(e) if > (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) > call<- sys.call(-4L) dcall<- deparse(call)[1L] > prefix<- paste("Error in", > dcall, ": ") LONG<- 75L msg<- conditionMessage(e) sm > <- strsplit(msg, "\n")[[1L]] w<- 14L + nchar(dcall, type = "w") + > nchar(sm[1L], type = "w") if is.na(w)) w<- 14L + > nchar(dcall, type = "b") + nch > ar(sm[1L], type = "b") if (w> LONG) > prefix<- paste(prefix, "\n ", sep = "") } else prefix<- "Error : " > msg<- paste(prefix, conditionMessage(e), "\n", sep = "") > .Internal(seterrmessage(msg[1L])) i > f (!silent&& identical(getOption("show.error.messages"), TRUE)) { > cat(msg, file = stderr()) .Internal(printDeferredWarnings()) > } invisible(structure(msg, class = "try-error", condition = e))}) > 10: try(dbGetQuery(con, paste("SELECT * from", name))) > 11: sqliteReadTable(conn, name, ...) > 12: is(object, Cl) > 13: is(object, Cl) > 14: .valueClassTest(standardGeneric("dbReadTable"), "data.frame", > "dbReadTable") > 15: dbReadTable(dbConn(x), "metadata") > 16: .local(x, ...) > 17: metadata(object) > 18: metadata(object) > 19: function (object) standardGeneric("show")(<s4 object="" of="" class=""> "TranscriptDb">) > 20: function (object) standardGeneric("show")(<s4 object="" of="" class=""> "TranscriptDb">) > Error in sqliteExecStatement(con, statement, bind.data) : > caught access violation - continue with care > Error in sqliteReadTable(conn, name, ...) : could not find table metadata > ######################################## TRACEBACK END > ############################################ > > So what's may be going on ? I've already checked my versions, all > Bioconductor packages are up to date, and as I said, it works without any > errors if I just recreate the object. But this approach is very clumbersome > because I'm using multiple machines so I have to share data constantly > between them, the ideal approach would be being able to save the object and > use it. > > Oh, it alse works if I use saveFeatures() to dump and then use > loadFeatures() to recover, but I still thinks it's not as practical because > I'll never get a totally functional workspace I one of the objects crashes > my session and I have to reload it every time I want to use it. > > Thanks a lot, > Halian > >> sessionInfo() > R version 2.14.0 (2011-10-31) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 > [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C > [5] LC_TIME=Portuguese_Brazil.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] GenomicFeatures_1.6.4 AnnotationDbi_1.16.5 Biobase_2.14.0 > [4] GenomicRanges_1.6.4 IRanges_1.12.3 > > loaded via a namespace (and not attached): > [1] biomaRt_2.10.0 Biostrings_2.22.0 BSgenome_1.22.0 DBI_0.2-5 > [5] RCurl_1.7-0.1 RSQLite_0.10.0 rtracklayer_1.14.4 tools_2.14.0 > [9] XML_3.4-2.2 zlibbioc_1.0.0 > > [[alternative HTML version deleted]] > > _______________________________________________ > 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 -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD COMMENT
0
Entering edit mode
Hey Martin, Thanks for the answer. I've tested your example and indeed it crashes RStudio when I try to read the expired connection. Maybe it's a flaw from both sides, the first because of the RSQLite throwing a very violent error and RStudio not being able to deal with that! As I said, if I try it directly from the command line interface, it just shows me the traceback and the session continues with no problem. But I'm pleased to know that at least the problem isn't with my configurarion or anything like that. Thanks again, Halian [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 621 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6