bioinformaticsbcftoolsvcf-variant-call-format

vcf files modification before converting to BCF


I am adding new vcf files to a previously made bcf file in which the ID field in the VCF had been set to CHR:POS:POS:REF:ALT ?

How do I set the ID field in the VCF to CHR:POS:POS:REF:ALT ?


Solution

  • I believe you're looking for the --set-id option. From the documentation at http://www.htslib.org/doc/bcftools.html:

    To assign the ID:

    bcftools annotate --set-id +'%CHROM\_%POS\_%REF\_%FIRST_ALT' file.vcf