首先肯定是需要自行搜索了解
entrez gene ID, HUGO symbol, refseq ID, ensembl ID
这些专有名词咯。
然后直接把下面的代码运行一下,把输出的all_gene_bioconductor.html文件好好看看, 就明白了。
代码语言:javascript复制rm(list=ls())
library(org.Hs.eg.db)
eg2symbol=toTable(org.Hs.egSYMBOL)
eg2name=toTable(org.Hs.egGENENAME)
eg2alias=toTable(org.Hs.egALIAS2EG)
eg2alis_list=lapply(split(eg2alias,eg2alias$gene_id),function(x){paste0(x[,2],collapse = ";")})
GeneList=mappedLkeys(org.Hs.egSYMBOL)
if( GeneList[1] %in% eg2symbol$symbol ){
symbols=GeneList
geneIds=eg2symbol[match(symbols,eg2symbol$symbol),'gene_id']
}else{
geneIds=GeneList
symbols=eg2symbol[match(geneIds,eg2symbol$gene_id),'symbol']
}
geneNames=eg2name[match(geneIds,eg2name$gene_id),'gene_name']
geneAlias=sapply(geneIds,function(x){ifelse(is.null(eg2alis_list[[x]]),"no_alias",eg2alis_list[[x]])})
createLink <- function(base,val) {
sprintf('<a href="%s" class="btn btn-link" target="_blank" >%s</a>',base,val)
## target="_blank"
}
gene_info=data.frame( symbols=symbols,
geneIds=createLink(paste0("http://www.ncbi.nlm.nih.gov/gene/",geneIds),geneIds),
geneNames=geneNames,
geneAlias=geneAlias,
stringsAsFactors = F
)
#library("xtable")
#print(xtable(gene_info), type="html",include.rownames=F, file='all_gene.anno',sanitize.text.function = force)
file='all_gene_bioconductor.html'
y <- DT::datatable(gene_info,escape = F,rownames=F)
DT::saveWidget(y,file)
在输出的文件里面可以搜索:
可以看到,有趣的是 ERBB1家族的 ERBB1的正式名字就是大名鼎鼎的EGFR, 而 大名鼎鼎的HER-2 正式名字却是ERBB2
搞笑 !
其实基因名总是让我困惑,可能是我生物学基础知识不够扎实,比如
- SMARCA4 (BRG1; Santa Cruz Biotechnology, sc-17796, 1:300 dilution)
- SMARCC2 (BAF170; Bethyl Laboratories, A301-039A, 1:1,000 dilution)
- SMARCD1 (BAF60A; Bethyl Laboratories, A301-595A, 1:3,000 dilution), SMARCE1 (BAF57; Bethyl Laboratories, A300-810A, 1:3,000 dilution), SMARCB1 (SNF5; Bethyl Laboratories, A301-087A, 1:5,000 dilution), ACTL6A (BAF53A; Bethyl Laboratories, A301-391A, 1:3,000 dilution)
都是 SWI/SNF Related, Matrix Associated, Actin Dependent Regulator Of Chromatin,我是在genecard里面 检查 SMARC发现的
http://www.genecards.org/Search/Keyword?queryString=SMARC
但是大部分文章里面却总是使用它们的别名。
当然了,本文的重点应该是上述代码输出的all_gene_bioconductor.html文件,理解了这个文件如何输出的,你的R语言就过关了!