Пример #1
0
 def setUp(self):
     self.mutations = fwdpy11.MutationVector()
     self.fixations = fwdpy11.MutationVector()
     self.haploid_genomes = fwdpy11.HaploidGenomeVector()
     self.diploids = fwdpy11.DiploidVector()
     self.mutations.append(fwdpy11.Mutation(0.1, -0.01, 1.0, 0, 0))
     self.fixations.append(fwdpy11.Mutation(0.1, -0.01, 1.0, 0, 0))
     self.haploid_genomes.append(fwdpy11.HaploidGenome(
         (2, [], [0])))
     self.diploids.append(fwdpy11.DiploidGenotype(0, 0))
Пример #2
0
 def setUp(self):
     mutations = fwdpy11.MutationVector()
     fixations = fwdpy11.MutationVector()
     gametes = fwdpy11.HaploidGenomeVector()
     diploids = fwdpy11.DiploidVector()
     mutations.append(fwdpy11.Mutation(0.1, -0.01, 1.0, 0, 0))
     mutations.append(fwdpy11.Mutation(0.2, 0.0, 1.0, 0, 0))
     gametes.append(fwdpy11.HaploidGenome((4, [1], [0])))
     diploids.append(fwdpy11.DiploidGenotype(0, 0))
     diploids.append(fwdpy11.DiploidGenotype(0, 0))
     self.pop = fwdpy11.DiploidPopulation(diploids, gametes, mutations)
Пример #3
0
 def setUp(self):
     mutations = fwdpy11.MutationVector()
     fixations = fwdpy11.MutationVector()
     gametes = fwdpy11.HaploidGenomeVector()
     diploids = fwdpy11.DiploidVector()
     mutations.append(
         fwdpy11.Mutation(0.1, -0.01, 1.0, 0, [-1., 2.], [5., 4.], 0))
     fixations.append(
         fwdpy11.Mutation(0.1, -0.01, 1.0, 0, [-1., 2.], [5., 4.], 0))
     gametes.append(fwdpy11.HaploidGenome((2, [], [0])))
     diploids.append(fwdpy11.DiploidGenotype(0, 0))
     ftimes = [1]
     self.pop = fwdpy11.DiploidPopulation.create(diploids, gametes,
                                                 mutations, fixations,
                                                 ftimes, 2)
Пример #4
0
    def testMutations(self):
        self.assertTrue(isinstance(self.muts, np.ndarray))
        self.assertEqual(self.muts.shape[0], len(self.pop.mutations))
        for i, j in zip(self.muts, self.pop.mutations):
            self.assertEqual(i['neutral'], j.neutral)
            self.assertEqual(i['h'], j.h)
            self.assertEqual(i['pos'], j.pos)
            self.assertEqual(i['g'], j.g)
            self.assertEqual(i['s'], j.s)

            m = fwdpy11.Mutation(tuple(i)[:-1])
            self.assertEqual(m.pos, j.pos)
            self.assertEqual(m.s, j.s)
            self.assertEqual(m.h, j.h)
            self.assertEqual(m.g, j.g)
            self.assertEqual(m.label, j.label)
            self.assertEqual(m.neutral, j.neutral)
Пример #5
0
 def setUp(self):
     self.m = fwdpy11.Mutation(1.0, -1.0, 0.25, 0, [1., 2.],
                               [-1.0, 1. / 3.], 13)
Пример #6
0
 def setUp(self):
     self.m = fwdpy11.Mutation((1.0, -1.0, 0.25, 0, 13))
Пример #7
0
 def setUp(self):
     import fwdpy11
     self.m = fwdpy11.Mutation(0.1, -0.2, 1.0, 10, 3)
Пример #8
0
 def setUp(self):
     self.pop = fwdpy11.DiploidPopulation(1000)
     self.mvec = fwdpy11.MutationVector()
     self.nmut = fwdpy11.Mutation(0.1, 0.0, 0.0, 0, 0)
     self.smut = fwdpy11.Mutation(1.2, -0.01, 0.0, 0, 0)
     self.smut_vec = fwdpy11.Mutation(1.3, 0., 0., 0, [-1., 0], [1, 1], 0)