人类基因组注释包org.Hs.eg.db

org.Hs.eg.db包主要注释人类基因:不同数据库ID间的转化。

# if (!requireNamespace("BiocManager", quietly = TRUE))
#   install.packages("BiocManager")
# 
# BiocManager::install("org.Hs.eg.db")

library(org.Hs.eg.db)

ls("package:org.Hs.eg.db")  # 查看包的信息

keytypes(org.Hs.eg.db)  # 基因编号系统名称
columns(org.Hs.eg.db)

##columns shows which kinds of data can be returned for the AnnotationDb object.
##keytypes allows the user to discover which keytypes can be passed in to select or ##keys and the keytype argument.

keys(org.Hs.eg.db) # 默认为主键ENTREZID
keys(org.Hs.eg.db,keytype="UNIPROT")

class(org.Hs.eg.db) # AnnotationDb objects

# select 返回data.frame
##ENTREZIDz to 其他id
select(org.Hs.eg.db, keys=keys(org.Hs.eg.db), columns="GO")
select(org.Hs.eg.db, keys=keys(org.Hs.eg.db), columns="SYMBOL")
select(org.Hs.eg.db, keys=keys(org.Hs.eg.db), columns="UNIPROT") 

select(org.Hs.eg.db, keys=c("313","314","317"), columns="UNIPROT") 


uniport_id <- c("P28039","O75106","O14727")
select(org.Hs.eg.db, keys=uniport_id, columns=c("UNIPROT","SYMBOL"),
       keytype="UNIPROT")

select(org.Hs.eg.db, keys=uniport_id, columns=c("UNIPROT","ENTREZID"),
       keytype="UNIPROT")


goannot <- select(org.Hs.eg.db, keys=keys(org.Hs.eg.db), columns="GO")
head(goannot)
genesbygo <- split(goannot$ENTREZID, goannot$GO)
# split(x, f, drop = FALSE, ...)
# divides the data in the vector x into the groups defined by f

class(genesbygo) # "list" 可用于GO富集分析

length(genesbygo)
head(genesbygo)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值