This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Update ID (rsid) column in VCF file with annotation file

Hi,

I have a vcf file with the following fields:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  SampleX

The issue is that the ID column has '.' and no rsids. I have an annotation file in gtf format as follows:

1      AUGUSTUS        CDS     106955274       106955412       0.89    +       0       transcript_id "g53770.t1"; gene_id "g53770";
1      AUGUSTUS        intron  106955413       107007218       0.89    +       .       transcript_id "g53770.t1"; gene_id "g53770";

Does anyone know how I can use the annotation file to add rsids to my vcf file?

Thanks

snp vcf annotation

1 answer

you need a dbsnp-like vcf file, not a gtf

bcftools annotate -a dbsnp vcf.gz -c ID in.gz  -O z -o output.vcf.gz

Thanks @Pierre Lindenbaum Any idea how I can obtain the dbsnp-like vcf?

Problem solved. Thanks @Pierre Lindenbaum and @Istvan Albert

Log in to answer this question.