R で、(複数の) GO.ID から、Term を得るの方法

TopGO (https://bioconductor.org/packages/release/bioc/html/topGO.html) で、gene ontology 解析をすると、長い GO term が "..." と略されてしまいます。

Google 先生に GO.ID を1つずつ入れると、QuickGO または、AmiGO2 あたりで GO term が得られますので、解決できます。でも、たくさんあったら死んでしまう、一括自動で欲しい。そんな時の呪文です。

ls(GOBPTerm) で表示させて、任意に得らんだ、"GO:0070131", "GO:2001060", "GO:2001211","GO:1901197", "GO:0003004" という5つの GO term を入手しましょう。

go_ids <- c("GO:0070131", "GO:2001060", "GO:2001211","GO:1901197", "GO:0003004")

library(GO.db)
select(GO.db, keys=go_ids, columns="TERM")

結果は下記のようになります。

> go_ids <- c("GO:0070131", "GO:2001060", "GO:2001211","GO:1901197", "GO:0003004")
> library(GO.db)
> select(GO.db, keys=go_ids, columns="TERM")
'select()' returned 1:1 mapping between keys and columns
        GOID                                                                                           TERM
1 GO:0070131                                               positive regulation of mitochondrial translation
2 GO:2001060                                        D-glycero-D-manno-heptose 7-phosphate metabolic process
3 GO:2001211        negative regulation of isopentenyl diphosphate biosynthetic process, mevalonate pathway
4 GO:1901197 positive regulation of calcium-mediated signaling involved in cellular response to calcium ion
5 GO:0003004 follicular fluid formation in ovarian follicle antrum involved in distinct antral spaces stage

B! LINE