Is it possible to concatenate two AnnDbBimaps without lots of coercions ? I would like to put org.Hs.egSYMBOL2EG and org.Hs.egALIAS2EG into a single AnnDbBimap object, so I could do lookups for a list of differentially expressed genes that are a mix of official symbols and aliases. c does not work as expected.
BiMaps are like old and stuff. If you want to do that, use select(). The SYMBOL column is for the current HUGO symbol, and ALIAS is for the current HUGO symbol, and all preceding ones.
> select(org.Hs.eg.db, c("A1B","ABG","GAB","HYST2477","A1BG"), "ENTREZID","SYMBOL")
'select()' returned 1:1 mapping between keys and columns
SYMBOL ENTREZID
1 A1B <NA>
2 ABG <NA>
3 GAB <NA>
4 HYST2477 <NA>
5 A1BG 1
> select(org.Hs.eg.db, c("A1B","ABG","GAB","HYST2477","A1BG"), "ENTREZID","ALIAS")
'select()' returned 1:many mapping between keys and columns
ALIAS ENTREZID
1 A1B 1
2 A1B 6641
3 ABG 1
4 GAB 1
5 HYST2477 1
6 A1BG 1
And here you see why you cannot really rely on symbols - there is no guarantee that they are unique.
We've documented select() in the AnnotationForge man pages in devel. The next release of packages made with AnnotationForge (including the OrgDb family) will have these new man pages.
The changes I made were to the man pages in AnnotationForge/inst/AnnDbPkg-templates. Looking in AnnotationDbi, several man pages already mention select() - AnnotationDb-class, Bimap-keys etc. Were there specific pages in AnnotationDbi you thought could use a refresh?
The
select
interface is great! It's a shame that all of the help pages only show theas.list(databaseVariable)
approach.We've documented select() in the AnnotationForge man pages in devel. The next release of packages made with AnnotationForge (including the OrgDb family) will have these new man pages.
Valerie
That's actually AnnotationDbi, not AnnotationForge, correct?
The changes I made were to the man pages in AnnotationForge/inst/AnnDbPkg-templates. Looking in AnnotationDbi, several man pages already mention select() - AnnotationDb-class, Bimap-keys etc. Were there specific pages in AnnotationDbi you thought could use a refresh?
Valerie
No, that was a mixup on my part. I thought you were talking about the man pages in AnnotationDbi, and had written AnnotationForge by mistake.