-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from ndukler/lapierre_qc
Lapierre qc
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())) |