cyvcf2
cyvcf2 copied to clipboard
INFO property for Variant class
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
?
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.
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.
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.
In that case, I'd accept a PR that implements INFO.keys()