Entering edit mode
4.5 years ago
curious
▴
820
so for info content of a vcf I know I can set key value pairs like this:
vcf_in = VariantFile("chr22.vcf")
for counter, rec in enumerate(vcf_in.fetch('chr22', 10510227, 10540227)):
rec.info["MAF"] = whatever
But I want to add something at Type=Flag
, the flag IMPUTED
to be more specific.
so going from and info field like this:
AF=2.33333e-05;MAF=2.33333e-05
to this:
IMPUTED;AF=2.33333e-05;MAF=2.33333e-05
Every example of setting the info attribute of the rec object seems to use key value pairs. Is setting flags possible?
I figured it out: