def test_liftover_no_alignment_genomic_deletions_neg(self):
    """
    test lifting regions when there is an unknown net deletion in the genomic
    region (i.e. genomic region is shorter than match to consensus) and the
    match is to the reverse complement of the consensus sequence

    rto3  chrX   11505  11675  -->  5452 5648  -
    [170 to 196; genomic region is smaller by 26bp -- gap interval is 7]
    """

    # intersecting region is fully contained in match, covers some gaps
    in1 = GenomicInterval("chrX", 11508, 11520, "AA", 50, '+')
    lf1 = self.rto3.liftover(in1)
    expc1 = [GenomicInterval("LINE/L1#L1MC5a", 5641, 5645, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5633, 5640, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5631, 5632, "AA", 50, '+')]
    self.assertEqual(lf1, expc1)

    # intersecting region fully covers the match
    in2 = GenomicInterval("chrX", 11500, 11700, "AA", 50, '+')
    lf2 = self.rto3.liftover(in2)
    expc2 = [GenomicInterval("LINE/L1#L1MC5a", 5641, 5648, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5633, 5640, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5625, 5632, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5617, 5624, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5609, 5616, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5601, 5608, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5593, 5600, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5585, 5592, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5577, 5584, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5569, 5576, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5561, 5568, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5553, 5560, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5545, 5552, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5537, 5544, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5529, 5536, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5521, 5528, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5513, 5520, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5505, 5512, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5497, 5504, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5489, 5496, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5481, 5488, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5473, 5480, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5465, 5472, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5457, 5464, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5454, 5456, "AA", 50, '+')]
    self.assertEqual(lf2, expc2)

    # intersecting region overlaps start and some gaps; finished partway
    # through a link
    in3 = GenomicInterval("chrX", 11500, 11515, "AA", 50, '+')
    lf3 = self.rto3.liftover(in3)
    expc3 = [GenomicInterval("LINE/L1#L1MC5a", 5641, 5648, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5637, 5640, "AA", 50, '+')]
    self.assertEqual(lf3, expc3)

    # intersecting region overlaps end and some gaps
    in4 = GenomicInterval("chrX", 11665, 11700, "AA", 50, '+')
    lf4 = self.rto3.liftover(in4)
    expc4 = [GenomicInterval("LINE/L1#L1MC5a", 5465, 5466, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5457, 5464, "AA", 50, '+'),
             GenomicInterval("LINE/L1#L1MC5a", 5454, 5456, "AA", 50, '+')]
    self.assertEqual(lf4, expc4)
def test_liftover_no_alignment_genomic_deletions_neg ( self ) : in1 = GenomicInterval ( "chrX" , 11508 , 11520 , "AA" , 50 , '+' ) lf1 = self . rto3 . liftover ( in1 ) expc1 = [ GenomicInterval ( "LINE/L1#L1MC5a" , 5641 , 5645 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5633 , 5640 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5631 , 5632 , "AA" , 50 , '+' ) ] self . assertEqual ( lf1 , expc1 ) in2 = GenomicInterval ( "chrX" , 11500 , 11700 , "AA" , 50 , '+' ) lf2 = self . rto3 . liftover ( in2 ) expc2 = [ GenomicInterval ( "LINE/L1#L1MC5a" , 5641 , 5648 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5633 , 5640 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5625 , 5632 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5617 , 5624 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5609 , 5616 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5601 , 5608 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5593 , 5600 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5585 , 5592 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5577 , 5584 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5569 , 5576 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5561 , 5568 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5553 , 5560 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5545 , 5552 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5537 , 5544 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5529 , 5536 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5521 , 5528 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5513 , 5520 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5505 , 5512 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5497 , 5504 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5489 , 5496 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5481 , 5488 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5473 , 5480 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5465 , 5472 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5457 , 5464 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5454 , 5456 , "AA" , 50 , '+' ) ] self . assertEqual ( lf2 , expc2 ) in3 = GenomicInterval ( "chrX" , 11500 , 11515 , "AA" , 50 , '+' ) lf3 = self . rto3 . liftover ( in3 ) expc3 = [ GenomicInterval ( "LINE/L1#L1MC5a" , 5641 , 5648 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5637 , 5640 , "AA" , 50 , '+' ) ] self . assertEqual ( lf3 , expc3 ) in4 = GenomicInterval ( "chrX" , 11665 , 11700 , "AA" , 50 , '+' ) lf4 = self . rto3 . liftover ( in4 ) expc4 = [ GenomicInterval ( "LINE/L1#L1MC5a" , 5465 , 5466 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5457 , 5464 , "AA" , 50 , '+' ) , GenomicInterval ( "LINE/L1#L1MC5a" , 5454 , 5456 , "AA" , 50 , '+' ) ] self . assertEqual ( lf4 , expc4 )
test lifting regions when there is an unknown net deletion in the genomic
    region (i.e. genomic region is shorter than match to consensus) and the
    match is to the reverse complement of the consensus sequence

    rto3  chrX   11505  11675  -->  5452 5648  -
    [170 to 196; genomic region is smaller by 26bp -- gap interval is 7]