Skip to content

Commit

Permalink
Merge pull request #78 from ndukler/lapierre_qc
Browse files Browse the repository at this point in the history
Lapierre qc
  • Loading branch information
jeromekelleher committed May 21, 2019
2 parents 681c1ca + 982d695 commit eb42eae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions qc/e_coli_qc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import msprime
import numpy as np
import math
import stdpopsim.models as models

class LapierreConstant(models.Model):
def __init__(self):
super().__init__()
# From paper https://doi.org/10.1093/molbev/msw048
# Ne taken from Table 2
Ne = 1.8e8

# Single pop with initial size Ne
self.population_configurations = [
msprime.PopulationConfiguration(initial_size=Ne),
]
# No migration
self.migration_matrix = [[0]]
# No demographic events
self.demographic_events = []
24 changes: 24 additions & 0 deletions tests/test_e_coli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Tests for the e. coli data definitions.
"""
import unittest
import io

from stdpopsim import e_coli
from qc import e_coli_qc


class TestLapierreConstant(unittest.TestCase):
"""
Basic tests for the LapierreConstant model.
"""
def test_debug_runs(self):
model = e_coli.LapierreConstant()
output = io.StringIO()
model.debug(output)
s = output.getvalue()
self.assertGreater(len(s), 0)

def test_qc_model_equal(self):
model = e_coli.LapierreConstant()
self.assertTrue(model.equals(e_coli_qc.LapierreConstant()))

0 comments on commit eb42eae

Please sign in to comment.