brentp / hts-nim

nim wrapper for htslib for parsing genomics data files

Home Page:https://brentp.github.io/hts-nim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VCF: Clear all INFO field

cvlvxi opened this issue · comments

Hi Brent,

I'm trying to use hts nim to read a VCF and then write out a new VCF.
I was just wondering if there's a better way to clear the entire INFO field for a variant other than iterating through each field and calling v.info.delete(keyName) on all keys that you know of? (feel like this could get pretty expensive for large vcf files like gnomad)

For context, I'd like to clear the INFO field and then add my own stuff to it and write out the VCF.

Cheers!

Hi,
iteration and delete is the best way I know of. I don't think htslib has anything to help with this. But should just be ~2 lines of code.

Thanks for confirming that.