Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Map SNP IDs to genome coordinates

I have several SNP IDs (i.e., rs16828074, rs17232800, etc...), I want to their coordinates in a Hg19 genome from UCSC genome website.

I would prefer using R to accomplish this goal. How to do that?

like image 875
user1938809 Avatar asked Nov 27 '13 19:11

user1938809


People also ask

Are SNPs used for mapping?

Single-nucleotide polymorphism (SNP) mapping is the easiest and most reliable way to map genes in Caenorhabditis elegans. SNPs are extremely dense and usually have no associated phenotype, making them ideal markers for mapping.

How are SNPs used in genetic maps?

SNP markers that can be identified through affordable sequencing processes, without the need for prior genome reduction or a reference genome to assemble sequencing data would allow the discovery and genetic mapping of thousands of molecular markers.


1 Answers

Here is a solution using the Bioconductor package biomaRt. It is a slightly corrected and reformatted version of the previously posted code.

library(biomaRt) # biomaRt_2.30.0

snp_mart = useMart("ENSEMBL_MART_SNP", dataset="hsapiens_snp")

snp_ids = c("rs16828074", "rs17232800")
snp_attributes = c("refsnp_id", "chr_name", "chrom_start")

snp_locations = getBM(attributes=snp_attributes, filters="snp_filter", 
                      values=snp_ids, mart=snp_mart)

snp_locations
#    refsnp_id chr_name chrom_start
# 1 rs16828074        2   232318754
# 2 rs17232800       18    66292259

Users are encouraged to read the comprehensive biomaRt vignette and experiment with the following biomaRt functions:

listFilters(snp_mart)
listAttributes(snp_mart)
attributePages(snp_mart)
listDatasets(snp_mart)
listMarts()
like image 119
bdemarest Avatar answered Sep 18 '22 15:09

bdemarest