Installing annotation package in locally
1
0
Entering edit mode
KABILAN • 0
@e750450e
Last seen 6 hours ago
India

I have an annotation package, and I am not able to install the package locally. Since the package publishing takes more time, I want to use the package in locally. The annotation files were uploaded to cloud storage already. I am getting the below error,

error details

and this is the R script of the package

datacache <- new.env(hash=TRUE, parent=emptyenv())

org.Hbacteriophora.eg <- function() showQCData("org.Hbacteriophora.eg", datacache)
org.Hbacteriophora.eg_dbconn <- function() dbconn(datacache)
org.Hbacteriophora.eg_dbfile <- function() dbfile(datacache)
org.Hbacteriophora.eg_dbschema <- function(file="", show.indices=FALSE) dbschema(datacache, file=file, show.indices=show.indices)
org.Hbacteriophora.eg_dbInfo <- function() dbInfo(datacache)

org.Hbacteriophora.egORGANISM <- "Heterorhabditis bacteriophora"

.onLoad <- function(libname, pkgname) {
    ## Load AnnotationHub
    hub <- AnnotationHub:::AnnotationHub()

    ## Query for the specific database (organism & sqlite)
    query_result <- AnnotationHub:::query(hub, c("Heterorhabditis", "bacteriophora", "sqlite"))

    ## Assuming the SQLite file is the first query result
    sqliteFile <- query_result[[1]]

    ## Assign the database file path and connection
    dbfile <- sqliteFile$path
    assign("dbfile", dbfile, envir=datacache)
    dbconn <- dbFileConnect(dbfile)
    assign("dbconn", dbconn, envir=datacache)

    ## Create the OrgDb object from the AnnotationHub resource
    sPkgname <- sub(".db$", "", pkgname)
    db <- loadDb(dbfile, packageName = pkgname)
    dbNewname <- AnnotationDbi:::dbObjectName(pkgname, "OrgDb")
    ns <- asNamespace(pkgname)
    assign(dbNewname, db, envir=ns)
    namespaceExport(ns, dbNewname)

    packageStartupMessage(AnnotationDbi:::annoStartupMessages("org.Hbacteriophora.eg.db"))
}

.onUnload <- function(libpath) {
    dbFileDisconnect(org.Hbacteriophora.eg_dbconn())
}

Please help me to solve this error.

AnnotationDbi AnnotationHub Annotation AnnotationForge • 227 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 5 hours ago
United States

That's not how to save an OrgDb you got from AnnotationHub. The usual way of doing that is to download it the one time, and then it will be cached and you can just reload it later. Something like

hub <- AnnotationHub()
z <- hub[["AH119196"]]

And then later doing that again will just load the cached version. But if you really think you need to save it, you can just use saveDb

saveDb(z, "afilename.sqlite")

And then later you can do

library(AnnotationDbi)
z <- loadDb("afilename.sqlite")

And now you can use it as usual.

0
Entering edit mode

Thank you for your suggestion. But I am getting the same error message while running this script.

enter image description here

ADD REPLY
0
Entering edit mode

OK, that appears to be a busted resource. Lori will have to look into it.

ADD REPLY
0
Entering edit mode

If that's the case the resource came from@KABILAN so they'll have to regenerate.

ADD REPLY

Login before adding your answer.

Traffic: 563 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