I have used dbSNP build 138 to tag 'rs' ID in my VCF file. But later I came to know that now dbSNP build 150 has been released. I want to update the rs IDs in my VCF file.

I tried but I found a problem for which I need suggestion. With dbSNP build 138, I am getting 450076 total variants, 248236 as known variants and the rest as novel. But when I use the latest dbSNP file, All_20170710.vcf.gz, I am getting same total variants but 0 as known and all as novel which is definitely wrong.

When I checked the reason for this, I found that in the All_20170710.vcf.gz VCF file, all chromosomes are written as numbers like 1, 2, instead of chr1, chr2 while in my vcf file, all chromosomes are written as chr1, chr2. The dbSNP build 138 file also has the chromosome names with the chr prefix, and that's why 138th build was giving good results.

One solution would be add the chr word before chromosome number. Is that an efficient way? How do I do that? If not, what is the correct way to use the latest dbSNP All_20170710.vcf.gz to tag rs IDs in a vcf file which contains ~32 Billion SNPs instead of dbsnp_138.vcf which contains only ~6 Billion SNPs? Any suggestions??



1 Answer 1


It sounds like you downloaded the dbSNP release for the GRCh38 or GRCh37 genome releases from the Genome Reference Consortium (GRC) which name the chromosomes without the chr prefix and you were previously using a file that had been built using either hg19 or hg38 which use the chr.

As far as I know, dbSNP only offers vcf files built against the GRC genome builds, so you (or someone else) had probably already modified the old file you were using and changed the chromosome names.

Also note that if you want the latest version, you should download ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/VCF/All_20180418.vcf.gz.

Anyway, yes, you can simply change the VCF to use chrN instead of N. Note, however, that you will also need to change the name of the mitochondrial chromosome from MT to chrM

You can do all this very easily with sed:

zcat All_20170710.vcf.gz | 
    sed -E '/^[^#]/{s/^([^#]+)/chr\1/; s/^chrMT/chrM/}' > All_20170710.fixed.vcf

The command above will work on most sed implementations, including Linux (GNU sed) and also macOS (BSD sed).

  • $\begingroup$ @heathobrien, @terdon : A little clarification here. I have downloded dbsnp_138.hg19.vcf.gz which use chr prefix and in file All_20170710 from GRC contains number only. $\endgroup$ May 10, 2018 at 11:53
  • $\begingroup$ @Lot_to_learn whoops, yes sorry. GRC uses numbers only, it's the hg19 and hg38 that use chr. Answer edited. Also, where are you downloading these files from? $\endgroup$
    – terdon
    May 10, 2018 at 12:00
  • 1
    $\begingroup$ @Lot_to_learn please see the updated answer. The first version would not have corrected the names for chrX and chrY. $\endgroup$
    – terdon
    May 10, 2018 at 12:06
  • $\begingroup$ I have found more rs IDs from new dbSNP as comparison to old one. For one patient I got 3200 approx new rs IDs. Although I was expecting more new rs IDs. Thanks. This is working well. $\endgroup$ May 12, 2018 at 9:26
  • $\begingroup$ @Lot_to_learn did you use the very latest edited version of my answer? The first had a couple of problems. To check, make sure that you have chrMT, chrY and chrX in the file. $\endgroup$
    – terdon
    May 12, 2018 at 12:29

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.