Question: Concatenation of Bimap
0
gravatar for Dario Strbenac
4.0 years ago by
Dario Strbenac1.5k
Australia
Dario Strbenac1.5k wrote:

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.

annotationdbi concatenate • 697 views
ADD COMMENTlink modified 4.0 years ago by James W. MacDonald51k • written 4.0 years ago by Dario Strbenac1.5k
Answer: Concatenation of Bimap
3
gravatar for James W. MacDonald
4.0 years ago by
United States
James W. MacDonald51k wrote:

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.

ADD COMMENTlink written 4.0 years ago by James W. MacDonald51k

The select interface is great! It's a shame that all of the help pages only show the as.list(databaseVariable) approach.
 

ADD REPLYlink written 4.0 years ago by Dario Strbenac1.5k

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

ADD REPLYlink written 4.0 years ago by Valerie Obenchain6.7k

That's actually AnnotationDbi, not AnnotationForge, correct?
 

ADD REPLYlink written 4.0 years ago by James W. MacDonald51k

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

ADD REPLYlink written 4.0 years ago by Valerie Obenchain6.7k

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.

ADD REPLYlink written 4.0 years ago by James W. MacDonald51k
Answer: Concatenation of Bimap
2
gravatar for Martin Morgan
4.0 years ago by
Martin Morgan ♦♦ 24k
United States
Martin Morgan ♦♦ 24k wrote:

All the SYMBOL keys are included in ALIAS

> all(keys(org.Hs.egSYMBOL2EG) %in% keys(org.Hs.egALIAS2EG))
[1] TRUE

so just use the ALIAS (via mapIds() or perhaps select()).

 

ADD COMMENTlink written 4.0 years ago by Martin Morgan ♦♦ 24k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 203 users visited in the last hour