def test_infer_mismatched_info_field_no_mismatches(self): variant = self._get_sample_variant_info_ia_float_2_0_in_list() infos = { 'IS': createInfo('IS', 1, 'String', ''), 'ISI': createInfo('ISI', 1, 'Integer', ''), 'ISF': createInfo('ISF', 1, 'Float', ''), 'IF': createInfo('IF', 1, 'Float', ''), 'IB': createInfo('IB', 0, 'Flag', ''), 'IA': createInfo('IA', 'A', 'Integer', '') } corrected_info = infer_headers_util._infer_mismatched_info_field( 'IA', variant.info.get('IA'), vcf_header_io.VcfHeader(infos=infos).infos.get('IA'), len(variant.alternate_bases)) self.assertEqual(None, corrected_info)
def test_infer_mismatched_info_field_correct_type(self): variant = self._get_sample_variant_info_ia_cardinality_mismatch() infos = { 'IS': createInfo('IS', 1, 'String', ''), 'ISI': createInfo('ISI', 1, 'Integer', ''), 'ISF': createInfo('ISF', 1, 'Float', ''), 'IF': createInfo('IF', 1, 'Float', ''), 'IB': createInfo('IB', 0, 'Flag', ''), 'IA': createInfo('IA', '.', 'Integer', '') } corrected_info = infer_headers_util._infer_mismatched_info_field( 'IA', variant.info.get('IA'), vcf_header_io.VcfHeader(infos=infos).infos.get('IA'), len(variant.alternate_bases)) expected = createInfo('IA', '.', 'Float', '') self.assertEqual(expected, corrected_info)