def test_can_add(self): bedpe = [ '1', '200', '300', '2', '300', '400', '777_1', '57', '+', '-', 'BND', 'PASS', '.', '.', '.', '.', '.', '.', 'MISSING', 'SVTYPE=BND;AF=0.2' ] b = Bedpe(bedpe) c = Cluster() c.chrom_a = b.c1 c.chrom_b = b.c2 c.min_a = b.s1 c.max_a = b.e1 c.min_b = b.s2 c.max_b = b.e2 c.strand_a = b.o1 c.strand_b = b.o2 self.assertTrue(c.can_add(b, 1)) c.size = 1 c.sv_event = 'DEL' self.assertFalse(c.can_add(b, 1)) c.sv_event = 'BND' self.assertTrue(c.can_add(b, 1)) c.chrom_a = 'X' self.assertFalse(c.can_add(b, 1)) c.chrom_a = b.c1 c.chrom_b = 'X' self.assertFalse(c.can_add(b, 1)) c.chrom_b = b.c2 c.min_a = 305 self.assertFalse(c.can_add(b, 1)) c.min_a = b.s1 c.max_a = 150 self.assertFalse(c.can_add(b, 1)) c.max_a = b.e1 c.min_b = 405 self.assertFalse(c.can_add(b, 1)) c.min_b = b.s1 c.max_b = 150 self.assertFalse(c.can_add(b, 1))
def test_can_add(self): bedpe = [ '1', '200', '300', '2', '300', '400', '777_1', '57', '+', '-', 'BND', 'PASS', 'MISSING', 'SVTYPE=BND;AF=0.2' ] b = Bedpe(bedpe) c = Cluster() c.chrom_a = b.c1 c.chrom_b = b.c2 c.min_a = b.s1 c.max_a = b.e1 c.min_b = b.s2 c.max_b = b.e2 c.strand_a = b.o1 c.strand_b = b.o2 self.assertTrue(c.can_add(b, 1)) c.size = 1 c.sv_event = 'DEL' self.assertFalse(c.can_add(b, 1)) c.sv_event = 'BND' self.assertTrue(c.can_add(b, 1)) c.chrom_a = 'X' self.assertFalse(c.can_add(b, 1)) c.chrom_a = b.c1 c.chrom_b = 'X' self.assertFalse(c.can_add(b, 1)) c.chrom_b = b.c2 c.min_a = 305 self.assertFalse(c.can_add(b, 1)) c.min_a = b.s1 c.max_a = 150 self.assertFalse(c.can_add(b, 1)) c.max_a = b.e1 c.min_b = 405 self.assertFalse(c.can_add(b, 1)) c.min_b = b.s1 c.max_b = 150 self.assertFalse(c.can_add(b, 1))