Issue with bcftools annotate
I am trying to use bcftools annotate to rename all positions in a vcf (basically, they all need to be smaller numbers to enable the vcf to be .tbi-indexed).
I have a tab-delimited file key.txt.gz formatted like this: CM022211.1 2329174 1 CM022211.1 2329175 2 CM022211.1 2329176 3 CM022211.1 2329177 4 …
And I have tried the command bcftools annotate -a key.txt.gz -c CHROM,POS,~POS in.vcf.gz after reading this thread https://github.com/samtools/bcftools/issues/1545. However, the positions remain unchanged in the output file. Please could you advise what I’m doing wrong as after a lot of searching and trying various syntaxes, I cannot figure this out?
Which version of bcftools are you running? The notation ~POS was deprecated in favor of -POS in the latest version 1.21.