The function you are using is intended to make an OrganismDb
package, which is distinct from an OrgDb
package. The former being a meta-package that combines a TxDb
, an OrgDb
and the GO.db
package so you can make queries that span information in those packages, and the latter being a package that contains functional annotations about an organism (as compared to the genomic information in a TxDb
package).
Anyway, you don't have to make anything yourself. You can just get what you need from the AnnotationHub
:
> library(AnnotationHub)
> hub <- AnnotationHub()
snapshotDate(): 2020-04-27
> query(hub, "Pongo abelii")
AnnotationHub with 166 records
# snapshotDate(): 2020-04-27
# $dataprovider: Ensembl, UCSC, ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/, Inpar...
# $species: Pongo abelii
# $rdataclass: TwoBitFile, GRanges, EnsDb, OrgDb, Inparanoid8Db
# additional mcols(): taxonomyid, genome, description,
# coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
# rdatapath, sourceurl, sourcetype
# retrieve records with, e.g., 'object[["AH6283"]]'
title
AH6283 | Assembly
AH6284 | RefSeq Genes
AH6285 | Ensembl Genes
AH6286 | Genscan Genes
AH6287 | Orangutan mRNAs
... ...
AH80673 | org.Pongo_abelii.eg.sqlite <-- That is what we want
AH82835 | Pongo_abelii.PPYG2.cdna.all.2bit
AH82836 | Pongo_abelii.PPYG2.dna_rm.toplevel.2bit
AH82837 | Pongo_abelii.PPYG2.dna_sm.toplevel.2bit
AH82838 | Pongo_abelii.PPYG2.ncrna.2bit
> orgdb <- hub[["AH80673"]]
downloading 1 resources
retrieving 1 resource
|======================================================================| 100%
loading from cache
> orgdb
OrgDb object:
| DBSCHEMAVERSION: 2.1
| DBSCHEMA: NOSCHEMA_DB
| ORGANISM: Pongo abelii
| SPECIES: Pongo abelii
| CENTRALID: GID
| Taxonomy ID: 9601
| Db type: OrgDb
| Supporting package: AnnotationDbi
Please see: help('select') for usage information
## do something random to show functionality
> select(orgdb, head(keys(orgdb)), "SYMBOL")
'select()' returned 1:1 mapping between keys and columns
GID SYMBOL
1 808473 ND1
2 808474 ATP8
3 808475 COX2
4 808476 ND6
5 808477 ND4L
6 808478 ND2
Thank you, that works perfectly! That is an even better solution than I was hoping for.
Hello,
I wanted to check some information about the annotation file I retrieved from the package. But suddenly when I use the query(hub, "Pongo abelii") command, I get an error message I don´t understand:
What happened from one day to the other, that suddenly this command does not work like before?
Kind regards!
autosocket()
is defined in the seqinr package, and my guess is that you have selectedseqinr::query()
. Be explicit about the function that you are using,AnnotationHub::query(hub, "pongo abelii')
.