cyvcf2 icon indicating copy to clipboard operation
cyvcf2 copied to clipboard

Writing new values for FILTER field

Open LiterallyUniqueLogin opened this issue 3 years ago • 2 comments

Hi there,

I'd like to be able to write new values to the filter field as part of writing out a new VCF. But I get the following issue:

> vcf = cyvcf2.VCF("...")
> var = next(vcf)
> var.FILTER
'SOMECONTENT'
> var.FILTER = 'foo'
> var.FILTER
Segmentation fault

Any easy fix for this?

If it matters, I'm on version 0.20.4 .

Thanks!

LiterallyUniqueLogin avatar Nov 11 '20 02:11 LiterallyUniqueLogin

did you add that filter to the header? (it still shouldn't segfault, but that might be a problem)

brentp avatar Nov 11 '20 17:11 brentp

Ah, yep, that's the issue. No longer seg faults after adding the filter to the header.

Just to be clear, is the proper way to overwrite the filter var.FILTER = "filter_name" and the proper way to add another filter var.FILTER += ";filter_name"?

LiterallyUniqueLogin avatar Nov 11 '20 22:11 LiterallyUniqueLogin