forked from popsim-consortium/stdpopsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_EscCol.py
45 lines (33 loc) · 1.39 KB
/
test_EscCol.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Tests for the EscCol data definitions.
"""
import stdpopsim
import pytest
from tests import test_species
class TestSpecies(test_species.SpeciesTestBase):
species = stdpopsim.get_species("EscCol")
def test_basic_attributes(self):
# From paper https://doi.org/10.1093/molbev/msw048
# Ne taken from Table 2
assert self.species.population_size == 1.8e8
# 20 minutes per generation
generation_time = 1.0 / (525600 / 20)
assert round(abs(self.species.generation_time - generation_time), 7) == 0
class TestGenome(test_species.GenomeTestBase):
"""
Tests for the EscCol genome.
"""
genome = stdpopsim.get_species("EscCol").genome
def test_basic_attributes(self):
assert len(self.genome.chromosomes) == 1
def test_mutation_rate(self):
assert self.genome.get_chromosome("Chromosome").mutation_rate == 8.9e-11
def test_recombination_rate(self):
assert self.genome.get_chromosome("Chromosome").recombination_rate == 8.9e-11
def test_gene_conversion_length(self):
assert self.genome.get_chromosome("Chromosome").gene_conversion_length == 542
def test_bacterial_recombination(self):
assert self.genome.bacterial_recombination is True
@pytest.mark.parametrize("chrom", [chrom for chrom in genome.chromosomes])
def test_chromosome_ploidy(self, chrom):
assert chrom.ploidy == 1