You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##FORMAT=<ID=EV,Number=1,Type=Integer,Description="Classes of evidence supporting final genotype">
I then update the header line by doing the following:
header = vcf_in.header.copy()
new_header = pysam.VariantHeader()
for line in header.records:
if line.type == 'FORMAT' and line.get('ID') == EV:
continue
new_header.add_line(str(line))
new_header.add_line('##FORMAT=<ID=EV,Number=1,Type=String,Description="Classes of evidence supporting final genotype">')
vcf_out = pysam.VariantFile(args.output_vcf, 'w', header=new_header)
If I now set record.samples[X]['EV'] for a given sample X to a String value, I still get the following error: TypeError: invalid value for Integer format. This essentially limits my ability to modify values in genotype fields for which I change the type of, though it seems to be a reasonable function to enable.
My thought here is that the evaluation about validity of a genotype field should occur at the time of writing to an output VCF file - which in this case, would be valid, since the output VCF file is built with new_header that has the updated ##FORMAT=<ID=EV tag.
The text was updated successfully, but these errors were encountered:
I have a VCF with a FORMAT field as follows:
I then update the header line by doing the following:
If I now set
record.samples[X]['EV']
for a given sampleX
to a String value, I still get the following error:TypeError: invalid value for Integer format
. This essentially limits my ability to modify values in genotype fields for which I change the type of, though it seems to be a reasonable function to enable.My thought here is that the evaluation about validity of a genotype field should occur at the time of writing to an output VCF file - which in this case, would be valid, since the output VCF file is built with
new_header
that has the updated##FORMAT=<ID=EV
tag.The text was updated successfully, but these errors were encountered: