I have variations from different humans (next gen sequence). Some of these variations are known SNPs in the dbSNP database. I want to get more information on those SNPs. My options are UCSC mysql database, download tables from UCSC, query dbSNP using e-utils, dowload from dbSNP ftp. The number of SNPs that I will check is in the hundreds. Which way do you think is best? I can query dbSNP with python but I am not sure how to parse the output or if this is the best way to achieve my goal. Any input is appreciated. Thanks
I know people in my lab interested in this kind of information they look into SNPper, so you may too want to give it a go (registration required). but when looking into dbSNP with a SNP list it always comes to my mind Ensembl, as the only "appropriate" way I see to do so with dbSNP is in fact downloading the whole database and to process it yourself as mentioned here. consider using it, as the BioMart query interface is really powerful, and allows retrieving plenty of information from lists as the one you may have.
it could sound self-interested, but we have indeed developed a variation browser called SPSmart that has all major human variation repositories to date: HapMap, Perlegen, and the CEPH genotyping efforts from the universities of Stanford and Michigan. our main aim is for population genetics, so all the statistics there are things like allele frequencies or Fst values. we are about to release (currently waiting for its paper acceptance) the latest version, which has already the 1000 Genomes Pilot 1 data, and is our intention to mirror in the future all 1000 Genomes variation data. you may also want to have a look to it. (I know it's not exacly like looking into dbSNP, but if you think that the tool would work for you, we may be able to allow you to access the 1000 Genomes Pilot 1 data)
I would recommend UCSC mysql database to gather information around a SNP than dbSNP. For example, check SQL queries by Pierre in related questions. Depending up on your requirement you could also check other tools like SCANDB, Haploview etc. Various tools and approaches related to SNP analysis are discussed in BioStar: Please check the related questions.
library(biomaRt) # biomaRt_2.30.0, R version 3.3.2 (2016-10-31) snp.db <- useMart("ENSEMBL_MART_SNP", dataset="hsapiens_snp") nt.biomart <- getBM(c("refsnp_id","allele","chr_name","chrom_start", "chrom_strand","associated_gene", "ensembl_gene_stable_id"), filters="refsnp", values=the.snps, mart=snp.db)
the.snps refers to rsid.
It can be used in conjunction with the
org.Hs.eg.db if you want more precise annotation informations, e.g. with ENSEMBL.
The most complete source of information for dbSNP is the dump of the NCBI database: ftp://ftp.ncbi.nih.gov/snp/database/organism_data/human_9606 . BUT it would require to understand the schema and re-building the database .
The second best source , IMHO, are the XML dumps for dbSNP: ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/XML/ . If you want to learn about parsing this kind of file, you'll have to learn about SAX , or StAx . DOM parsing would not a be a good option here.
I guess most languages handle those XML technologies.
If you just want a subset of information, you can query the UCSC (see Khader's references) or download the UCSC mysql tables on your mysql/localhost.
You can now get variant annotation data from dbSNP AND 13 other variant data sources using MyVariant.info. There's a python client so you can integrate it into your workflow, and there's also an R client in the latest release of bioconductor (if you prefer R).