Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing new values for FILTER field #177

Open
LiterallyUniqueLogin opened this issue Nov 11, 2020 · 2 comments
Open

Writing new values for FILTER field #177

LiterallyUniqueLogin opened this issue Nov 11, 2020 · 2 comments

Comments

@LiterallyUniqueLogin
Copy link
Contributor

LiterallyUniqueLogin commented Nov 11, 2020

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!

@brentp
Copy link
Owner

brentp commented Nov 11, 2020

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

@LiterallyUniqueLogin
Copy link
Contributor Author

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants