def format(table_variant): formatted = OrderedDict() formatted[cfg.F_LOCATION] = table_variant[cfg.V_REFPOS] formatted[cfg.F_VARIANT] = VariantFormat.FormatVariant( table_variant.file_info, table_variant[cfg.V_TYPE], table_variant[cfg.V_REF], table_variant[cfg.V_ALLELE], table_variant[cfg.V_CRC]) formatted[cfg.F_CODONPOS] = VariantFormat.CodonPos( formatted[cfg.F_VARIANT]) formatted[cfg.F_AAC] = "" # TODO: first change the AminoAcidChange() formatted[cfg.F_OA] = table_variant[cfg.V_ANOT] formatted[cfg.F_FREQ] = table_variant[cfg.V_FREQ] return formatted
def test_CodonPos_none(self): val = "A>C" self.assertEqual(VariantFormat.CodonPos(val), "")
def test_CodonPos_one(self): val = "A286C" self.assertEqual(VariantFormat.CodonPos(val), "1")
def test_CodonPos_two(self): val = "A287C" self.assertEqual(VariantFormat.CodonPos(val), "2")
def test_CodonPos_three(self): val = "A288C" self.assertEqual(VariantFormat.CodonPos(val), "3")