def test_dcj_circular_excision(self): a = Genome(Chromosome("ab"), Chromosome(".cd.")) b = Genome(Chromosome(".abcd.")) self.assertEquals(calculate_distance(a, b, method="dcj"), 1)
def test_dcj_default_example(self): a = Genome(Chromosome("ab"), Chromosome(".cd."), Chromosome(".e."), Chromosome("fg")) b = Genome(Chromosome(".acD."), Chromosome("be"), Chromosome(".fg.")) self.assertEquals(calculate_distance(a, b, method="dcj"), 5)
def test_dcj_single_split(self): a = Genome(Chromosome(".ab.")) b = Genome(Chromosome("ab")) self.assertEquals(calculate_distance(a, b, method="dcj"), 1)
def test_dcj_backwards(self): a = Genome(Chromosome("abc")) b = Genome(Chromosome("cba")) self.assertEquals(calculate_distance(a, b, method="dcj"), 2)
def test_dcj_intermediate_2_dcj(self): a = Genome(Chromosome(".aBdCE.")) b = Genome(Chromosome(".abcde.")) self.assertEquals(calculate_distance(a, b, method="dcj"), 4)
def test_dcj_single_swap_dcj(self): a = Genome(Chromosome(".acb.")) b = Genome(Chromosome(".abc.")) self.assertEquals(calculate_distance(a, b, method="dcj"), 2)
def test_dcj_single_a_indel(self): a = Genome(Chromosome(".ac.")) b = Genome(Chromosome(".abc.")) self.assertEquals(calculate_distance(a, b, method="indel"), 1)