htslib icon indicating copy to clipboard operation
htslib copied to clipboard

Removing a symbolic allele from VCF header

Open dmckean opened this issue 6 years ago • 1 comments

I'm trying to remove the VCF header line for a symbolic alternate allele. Since ##ALT header lines belong to a specific BCF_HL_* type, it seems like my only options are removing all ##ALT= lines, or remove using the ID. Does this look right? Am I missing a more direct way?

bcf_hdr_append(hdr, "##ALT=<ID=DEL,Description=\"Deletion\">");

Remove all ##ALT= lines:

bcf_hdr_remove(hdr, BCF_HL_GEN, "ALT");

Remove by matching to the ID.

bcf_hdr_remove(hdr, BCF_HL_STR, "DEL");

Currently working in VCFv4.1

dmckean avatar Aug 25 '17 02:08 dmckean

Currently there is no other, more direct, API. The only other option would be to manipulate the hrec records directly.

pd3 avatar Aug 29 '17 11:08 pd3