def test_get_int_field(self, value, is_single_field, expected): key = 'field' field_map = _set_protomap_from_dict({}) struct_utils.set_int_field(field_map, key, value) actual = struct_utils.get_int_field(field_map, key, is_single_field) self.assertEqual(actual, expected) # Test long handling in Python 2 if sys.version_info.major < 3: field_map = _set_protomap_from_dict({}) struct_utils.set_int_field(field_map, key, [long(v) for v in value]) actual = struct_utils.get_int_field(field_map, key, is_single_field) self.assertEqual(actual, expected)
def get_min_dp(variant_call): """Gets the 'MIN_DP' field of the VariantCall.""" return struct_utils.get_int_field(variant_call.info, 'MIN_DP', is_single_field=True)
def test_get_int_field(self, value, is_single_field, expected): key = 'field' field_map = _set_protomap_from_dict({}) struct_utils.set_int_field(field_map, key, value) actual = struct_utils.get_int_field(field_map, key, is_single_field) self.assertEqual(actual, expected)