This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Assigning gene identifiers to SNPs with bcftools annotate

Hello,

I have a VCF file with SNPs. It contains the chromosome and the position of the SNPs, but the ID column is empty (.). I want to fill the ID column with gene identifiers which i have in a tab-deliminated file with four columns: Chromosome, start position, end position, identifier. Let's call it coordinates.gff.

I used

bcftools annotate -a coordinates.gff.bgz -c CHROM,FROM,TO,ID -o variants_annotated.vcf -Ov --threads 2 variants.bcf

A tabix index exists for the coordinates file and there are no error messages. Still, the ID column of the output file is empty. I'm struggling with this for a while now and I have the feeling that I'm missing something very obvious. Do I have to specifiy that I want the IDs to be replaced in some way?

Any help would be highly appreciated!

snp

same chromosome notation ? no +1 problem with the positions ?

1 answer

I found the solution in another post here.

It seems to me that the link you posted provides information on adding gene annotation information to the INFO column of the vcf, not the ID column. Is there a way you found to add it to the ID column?

Log in to answer this question.