cbmi/varify — pull request #137 by naegelyd (2014-02-27 19:10:28+00:00)
Title: Fix problems reading data from PyVCF call objects

Fix #132.

This was originally caused by my changes to the internal copy of Varify that removed explicit indexing like `call['GT']` in favor of(what I thought to be) safer retrieval. The problem was, PyVCF was overriding the `__getitem__` method so while I thought the actual data was on the `call` object, it was really on the `data` property of the `call` object. Since PyVCF, always assuming the key is valid when using indexing, we don't want to use that again since we don't want to wrap all our indexes in try/except blocks for `AttributeError`s. Instead, we use a safe version of `getattr()` on the `call.data` object itself where we specify the default value. [PyVCF does not do this](https://github.com/cbmi/PyVCF/blob/master/vcf/model.py#L90-L92) in `__getitem__` so any invalid attributes trigger an `AttributeError` and can cause loader problems.