December 28, 2013

Automatic mapping (or conversion) among different biological databases

biomaRt is an R package to map among different biological databases. Here is a simple code-snippet to convert human gene id to gene symbol.


library(biomaRt)
ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl")
symbols = getBM(attributes=c('entrezgene','hgnc_symbol'), filters='entrezgene', values=c("7157","5601"), mart=ensembl) 
 
Installation note:
  • In Ubuntu, you may need to install 'libxml2-dev' and 'libcurl4-openssl-dev'.

No comments:

Post a Comment