7
$\begingroup$

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

$\endgroup$

3 Answers 3

8
$\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
    Commented Oct 16, 2017 at 15:25
7
$\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
    Commented Oct 16, 2017 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 and acknowledge you have read our privacy policy.

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