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

INFO property for Variant class #192

Open
hammer opened this issue Feb 14, 2021 · 4 comments
Open

INFO property for Variant class #192

hammer opened this issue Feb 14, 2021 · 4 comments

Comments

@hammer
Copy link

hammer commented Feb 14, 2021

For a variant v it's nice to be able to say v.FORMAT and to see the available fields names. Would it be difficult to do the same for v.INFO?

@hammer
Copy link
Author

hammer commented Feb 14, 2021

Of course [k for k, _ in v.INFO] is an easy workaround for now. It would be nice if v.INFO and v.FORMAT were a bit more consistent though.

@brentp
Copy link
Owner

brentp commented Feb 14, 2021

I think there's a v.INFO.keys() as well. the difference is that INFO behaves like a dict, but FORMAT does not. probably would have been better to make them behave similarly, but this instead matches the underlying format more closely.

@hammer
Copy link
Author

hammer commented Feb 14, 2021

Ah I should have mentioned that I tried v.INFO.keys() and got AttributeError: 'cyvcf2.cyvcf2.INFO' object has no attribute 'keys', which was relatively surprising to me given its dict-like interface.

@brentp
Copy link
Owner

brentp commented Feb 14, 2021

In that case, I'd accept a PR that implements INFO.keys()

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