This is a test version of Biostars. For the public version, visit https://www.biostars.org.
updating SNP names in VCF file

Hello How can I update SNP names from position (chr1:xxxxxx) to rs name in VCF file ? I have a reference VCF file with rs names and want to update my own data VCF file.

Thanks for your help

snp rs names vcf

intersect sample vcf with reference vcf with bedtools or annotate with bcftools

2 answers

dbSNP annotation can be added in the ID filed using the VariantAnnotator tool from GATK.

gatk  --java-options '-Xmx4G' \
   VariantAnnotator \
   -R /userdata/arup/hpcc_test/genome/hg38/hg38.fa \
   -V input.vcf.gz \
   -O output.vcf.gz \
   --dbsnp dbsnp.vcf.gz

Thank you very much

you can also use SnpSift from the SnpEff package http://snpeff.sourceforge.net/SnpSift.html#annotate

 java -jar SnpSift.jar annotate dbSnp132.vcf input.vcf > output_annotated.vcf

check ftp://ftp.ncbi.nih.gov/snp/organisms/ for other dbSNP builds

Thank you very much

Log in to answer this question.