This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SnpSift Annotate replace ID column

Is it possible to use SnpSift Annotate function to replace values already existing in the ID column?

java -jar SnpSift.jar annotate -id 00-common_all.vcf.gz my_sample.vcf 

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT
22      16050435        22:16050435     T       C       .       PASS    AF=0.00029;MAF=0.00029;R2=0.00226       GT:DS:GP
22      16050783        22:16050783;rs587743568 A       G       .       PASS    AF=0.00023;MAF=0.00023;R2=0.00015;ASP;CAF=0.9922,0.007788;COMMON=1;KGPhase3;RS=587743568;RSPOS=16050783;SAO=0;SSR=0;VC=SNV;VP=0x050000000005000026000100;WGT=1;dbSNPBuildID=142    GT:DS:GP
22      16050822        22:16050822     G       A       .       PASS    AF=0.14691;MAF=0.14691;R2=0.05570       GT:DS:GP

But unfortunatly using the SNP files from here ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b151_GRCh37p13/VCF/ will add rsIDs only in a semicolon separated fashion. See line three for instance: 22:16050783;rs587743568

A further side effect is that the parameters -id or -info are not working. In both cases all information is added like when no parameter is specified. Perhaps the dbSnp files 151 are corrupt/not compatible with the recent release of SnpSift!?

snps snpsift snpeff annotation

I'm running into this exact problem right now. SnpSift seems like the only tool that is smart with respect to ALT/REF ordering and having it replace existing IDs would be a huge boon.

1 answer

I'm not sure that the original SnpSift can do it. However, I forked SnpSift and hacked the code to always replace if the ID is found in the annotation file. You can find the new code here: https://github.com/quattro/SnpSift

It does need to be rebuilt using maven following the instructions on the main SnpEff site to work.

Log in to answer this question.