Skip to content

Instantly share code, notes, and snippets.

@kdaily
Created April 3, 2014 17:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdaily/9959237 to your computer and use it in GitHub Desktop.
Save kdaily/9959237 to your computer and use it in GitHub Desktop.
Get the chromosomal location and cytoband for list of HGNC gene symbols using biomaRt
# Code snippet to get chromosomal position and cytoband from gene symbols using
# biomaRt
# Kenneth Daily, 2014
library(biomaRt)
ensembl <- useMart("ensembl", dataset = "hsapiens_gene_ensembl")
# Only use standard human chromosomes
normal.chroms <- c(1:22, "X", "Y", "M")
# Filter on HGNC symbol and chromosome, retrieve genomic location and band
my.symbols <- c("RB1", "TP53", "AKT3")
my.regions <- getBM(c("hgnc_symbol", "chromosome_name", "start_position", "end_position", "band"),
filters = c("hgnc_symbol", "chromosome_name"),
values = list(hgnc_symbol=my.symbols, chromosome_name=normal.chroms),
mart = ensembl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment