def testMergedRecord_8_coInsDel(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "-"
     self.variant_1.alt = ["GTGTG"]
     # Variant 2
     self.variant_2.pos = 5
     self.variant_2.ref = "AA"
     self.variant_2.alt = ["-"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AA"
     self.expected_merge.alt = ["GTGTG"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=-/GTGTG", "chr1:5=AA/-"]
     }
     # Eval
     with IdxFastaIO(self.tmp_fasta_path) as FH_ref:
         observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                       self.variant_1.getName(),
                                       self.variant_2,
                                       self.variant_2.getName(), FH_ref)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))
 def testMergedRecord_3_largeCloseSubstit(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "AAAT"
     self.variant_1.alt = ["TGCA"]
     # Variant 2
     self.variant_2.pos = 9
     self.variant_2.ref = "CT"
     self.variant_2.alt = ["GG"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AAATCT"
     self.expected_merge.alt = ["TGCAGG"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=AAAT/TGCA", "chr1:9=CT/GG"]
     }
     # Eval
     with IdxFastaIO(self.tmp_fasta_path) as FH_ref:
         observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                       self.variant_1.getName(),
                                       self.variant_2,
                                       self.variant_2.getName(), FH_ref)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))
 def testMergedRecord_1_substit(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "A"
     self.variant_1.alt = ["T"]
     # Variant 2
     self.variant_2.pos = 20
     self.variant_2.ref = "G"
     self.variant_2.alt = ["C"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AAATCTCGGCATGCCG"
     self.expected_merge.alt = ["TAATCTCGGCATGCCC"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=A/T", "chr1:20=G/C"]
     }
     # Eval
     with IdxFastaIO(self.tmp_fasta_path) as FH_ref:
         observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                       self.variant_1.getName(),
                                       self.variant_2,
                                       self.variant_2.getName(), FH_ref)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))
 def testMergedRecord_7_closeInsDel(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "-"
     self.variant_1.alt = ["GTGTG"]
     # Variant 2
     self.variant_2.pos = 6
     self.variant_2.ref = "AA"
     self.variant_2.alt = ["-"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AAA"
     self.expected_merge.alt = ["GTGTGA"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=-/GTGTG", "chr1:6=AA/-"]
     }
     # Eval
     observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                   self.variant_1.getName(), self.variant_2,
                                   self.variant_2.getName(), self.ref_seq)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))
 def testMergedRecord_5_coDelIns(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "AAAT"
     self.variant_1.alt = ["-"]
     # Variant 2
     self.variant_2.pos = 9
     self.variant_2.ref = "-"
     self.variant_2.alt = ["AGG"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AAAT"
     self.expected_merge.alt = ["AGG"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=AAAT/-", "chr1:9=-/AGG"]
     }
     # Eval
     observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                   self.variant_1.getName(), self.variant_2,
                                   self.variant_2.getName(), self.ref_seq)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))
 def testMergedRecord_2_largeSubstit(self):
     # Variant 1
     self.variant_1.pos = 5
     self.variant_1.ref = "AAAT"
     self.variant_1.alt = ["TGCA"]
     # Variant 2
     self.variant_2.pos = 10
     self.variant_2.ref = "TC"
     self.variant_2.alt = ["GG"]
     # Expected merge
     self.expected_merge.pos = 5
     self.expected_merge.ref = "AAATCTC"
     self.expected_merge.alt = ["TGCACGG"]
     self.expected_merge.info = {
         "AF": [0.06],
         "MCO_QUAL": [10, 30],
         "MCO_VAR": ["chr1:5=AAAT/TGCA", "chr1:10=TC/GG"]
     }
     # Eval
     observed_merge = mergedRecord(self.vcfio, self.variant_1,
                                   self.variant_1.getName(), self.variant_2,
                                   self.variant_2.getName(), self.ref_seq)
     self.assertEqual(strVariant(observed_merge),
                      strVariant(self.expected_merge))