7
$\begingroup$

Given a list of gene IDs, how do you retrieve the gene description, summary and other detailed information in R?

$\endgroup$
7
$\begingroup$

Description of how to use biomaRt here. Filter by your list of gene IDs. Get the descriptions etc as attributes. Eg:

> library(biomaRt)
> ensembl = useEnsembl(biomart="ensembl", dataset="hsapiens_gene_ensembl")
> IDs <- c("BRCA2","BRAF")
genedesc <- getBM(attributes=c('external_gene_name','description'), filters = 'external_gene_name', values = IDs, mart =ensembl)
> genedesc
  external_gene_name                                                                      description
1               BRAF B-Raf proto-oncogene, serine/threonine kinase [Source:HGNC Symbol;Acc:HGNC:1097]
2              BRCA2                  BRCA2, DNA repair associated [Source:HGNC Symbol;Acc:HGNC:1101]
$\endgroup$
1
  • 1
    $\begingroup$ Thank you for the answer. I did not find a way to return detailed information using biomaRt. The description fields are just extended gene names. $\endgroup$
    – Peter
    Oct 16 '17 at 15:25
6
$\begingroup$

MyGene.info

Using the R package for the MyGene.info database:

source("https://bioconductor.org/biocLite.R")
biocLite("mygene")

library(mygene)
gene <- getGene("1017", fields="all")
gene$summary

Multiple genes:

gene <- getGenes(c(1347:1350), fields="summary")

Entrez database

library(devtools)
install_github("ropensci/rentrez")

library(rentrez)
genes <- entrez_summary(db="gene", id=c(718,720))
genes$`720`$summary
$\endgroup$
1
  • $\begingroup$ Nice question (and answer, I didn't know about MyGene), if you know what you are looking for maybe it is worth to mention biomaRt $\endgroup$
    – llrs
    Oct 16 '17 at 6:56
2
$\begingroup$

The easiest and fastest method (which also doesn’t require internet access) is to use annotation packages, e.g. org.Mm.eg.db:

library(AnnotationDbi)
library(org.Mm.eg.db)


# 1:1 mapping symbol→entrez
entrez_ids <- mapIds(org.Mm.eg.db, gene_symbols, 'ENTREZ', 'SYMBOL')

# 1:n mapping symbol→…
print(columns(org.Mm.eg.db))  # check what you can query
df <- select(org.Mm.eg.db, gene_symbols, c(...), 'SYMBOL')
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.