Bioconductor / AnnotationHub

Client for the Bioconductor AnnotationHub web resource
17 stars 13 forks source link

AH116860 - error file is not a database #54

Closed methornton closed 4 months ago

methornton commented 4 months ago

Hello! I am getting this error with AnnotationHub the ensembl entry for 111 works fine. Can you help me?

AnnotationHub with 1 record
# snapshotDate(): 2024-04-30
# names(): AH116860
# $dataprovider: Ensembl
# $species: Homo sapiens
# $rdataclass: EnsDb
# $rdatadateadded: 2024-04-30
# $title: Ensembl 112 EnsDb for Homo sapiens
# $description: Gene and protein annotations for Homo sapiens based on Ensem...
# $taxonomyid: 9606
# $genome: GRCh38
# $sourcetype: ensembl
# $sourceurl: http://www.ensembl.org
# $sourcesize: NA
# $tags: c("112", "Annotation", "AnnotationHubSoftware", "Coverage",
#   "DataImport", "EnsDb", "Ensembl", "Gene", "Protein", "Sequencing",
#   "Transcript") 
# retrieve record with 'object[["AH116860"]]' 
loading from cache
require(“ensembldb”)
Error: failed to load resource
  name: AH116860
  title: Ensembl 112 EnsDb for Homo sapiens
  reason: file is not a database
In addition: Warning message:
Couldn't set synchronous mode: file is not a database
Use `synchronous` = NULL to turn off this warning. 
Execution halted
lshep commented 4 months ago

It seems like there might have been an issue with the download and only partially downloaded the database. Can you try to force re-download the resource. This should only be done once

library(AnnotationHub)
ah = AnnotationHub()
temp = ah[["AH116860", force=TRUE]]
methornton commented 4 months ago

Hello! Thank you! So that worked.

> ah = AnnotationHub()
snapshotDate(): 2024-04-30
> temp = ah[["AH116860", force=TRUE]]
downloading 1 resources
retrieving 1 resource
  |======================================================================| 100%

loading from cache
require(“ensembldb”)

So when I am debugging and re-running the scripts over and over, is there a better way to access the AH that I've downloaded previously without having to redownload it evey time? Here is the code I've been using, which runs over and over.

library(AnnotationHub)

# This will get the proper version of the Ensembl for your data
hub <- AnnotationHub()
query(hub, c("ensdb","homo sapiens","112"))
ensdb <- hub[["AH116860"]]
lshep commented 4 months ago

Once its downloaded once it should not try to download again (unless you add force=TRUE). That code shown should grab the locally downloaded file and not download

methornton commented 4 months ago

Oh Cool! Thank you! I hope you have a nice day!