Repository: popsim-consortium/stdpopsim (language: python)

Issue:
QC for Aedes aegypti (AedAeg)
**PR for new species:** [Aedes aegypti](https://github.com/popsim-consortium/stdpopsim/pull/871)

If you volunteer to QC this species, please use the checklist below.
While this list is intended to be comprehensive, it may not be exhaustive.
Where relevant, the QC reviewer should identify that parameter values match
those given in the linked citation(s).

The QC reviewer should start a pull request that fills out the test stubs
with independently obtained values. The reviewer may look at the python code
for rationale provided in comments, but should ignore the actual code
as much as possible - comments in the code should give enough information
that it's obvious how to get the correct value from the provided references.
(In particular, we shouldn't copy-paste the value from the code into the test!)

- [x] Recombination rate.
  - This might be genome-wide, or per-chromosome. Both are fine.
  - Check there's a comment describing where it came from, and/or how calculated.
  - From a publication? Check the value(s) match the publication.
  - Calculated somehow? Average over a recombination map? Redo the calculation.
- [x] Mutation rate.
  - This might be genome-wide, or per-chromosome. Both are fine.
  - Check there's a comment describing where it came from, and/or how calculated.
  - From a publication? Check the value(s) match the publication.
  - Calculated somehow? Redo the calculation.
- [x] Population size.
- [x] Generation time.

For each citation, check:
- Doi link.
- Is publication a preprint? Is there a peer-reviewed publication instead?
- Is the year correct.
- Is the author correct (spelling, accents/ligatures/etc.)

Citations are required for:
- [x] Mutation rate.
- [x] Recombination rate.
- [x] Population size.
- [x] Generation time.

The final PR should:
- [x] fill out the test stubs
- [x] delete the `pytest.mark.skip` lines that make the tests not run
- [x] make sure they pass, talking to the original author to figure out discrepancies



Discussion / hints:

Fix patch:
diff --git a/stdpopsim/catalog/AedAeg/species.py b/stdpopsim/catalog/AedAeg/species.py
index a2991cc30..e9c7c7bb9 100644
--- a/stdpopsim/catalog/AedAeg/species.py
+++ b/stdpopsim/catalog/AedAeg/species.py
@@ -6,14 +6,37 @@
 _recombination_rate = {"1": 0.306, "2": 0.249, "3": 0.291, "MT": 0}
 
 _JunejaEtAl = stdpopsim.Citation(
-    doi="https://doi:10.1371/journal.pntd.0002652",
+    doi="https://doi.org/10.1371/journal.pntd.0002652",
     year=2014,
     author="Juneja et al.",
     reasons={stdpopsim.CiteReason.REC_RATE},
 )
 
-# This rate is for Drosophila (same as used in the A. gambiae tutorial).
-_overall_rate = 5.49e-9
+
+_CrawfordEtAl = stdpopsim.Citation(
+    doi="https://doi.org/10.1186/s12915-017-0351-0",
+    year=2017,
+    author="Crawford et al.",
+    reasons={
+        stdpopsim.CiteReason.GEN_TIME,
+        stdpopsim.CiteReason.POP_SIZE,
+        stdpopsim.CiteReason.MUT_RATE,
+    },
+)
+
+_KeightleyEtAl = stdpopsim.Citation(
+    doi="https://doi.org/10.1101/gr.091231.109",
+    year=2009,
+    author="Keightley et al.",
+    reasons={
+        stdpopsim.CiteReason.MUT_RATE,
+    },
+)
+
+
+# This rate is for DroMel, as used in Crawford
+# TODO: mt should probably be lower
+_overall_rate = 3.5e-9  # per generation, from Keightley et al 2009
 _mutation_rate = {
     "1": _overall_rate,
     "2": _overall_rate,
@@ -21,13 +44,6 @@
     "MT": _overall_rate,
 }
 
-_Ag1000G = stdpopsim.Citation(
-    doi="https://doi.org/10.1038/nature24995",
-    year=2017,
-    author="Ag1000G Consortium",
-    reasons={stdpopsim.CiteReason.MUT_RATE},
-)
-
 _NeneEtAl = stdpopsim.Citation(
     doi="https://doi.org/10.1126/science.1138878",
     year=2007,
@@ -42,26 +58,21 @@
     mutation_rate=_mutation_rate,
     citations=[
         _NeneEtAl,
-        _Ag1000G,
         _JunejaEtAl,
+        _CrawfordEtAl,
+        _KeightleyEtAl,
     ],
 )
 
 
-_CrawfordEtAl = stdpopsim.Citation(
-    doi="https://doi.org/10.1186/s12915-017-0351-0",
-    year=2017,
-    author="Crawford et al.",
-    reasons={stdpopsim.CiteReason.GEN_TIME, stdpopsim.CiteReason.POP_SIZE},
-)
-
 _species = stdpopsim.Species(
     id="AedAeg",
     ensembl_id="aedes_aegypti_lvpagwg",
     name="Aedes aegypti",
-    common_name="Aedes aegypti (LVP_AGWG)",
+    common_name="Yellow fever mosquito",
     genome=_genome,
-    generation_time=1 / 10,
+    generation_time=1 / 15,
+    # the estimated population size today the modern Senegal forest population
     population_size=1e6,
     citations=[_CrawfordEtAl],
 )


Test patch:
diff --git a/tests/test_AedAeg.py b/tests/test_AedAeg.py
index 12638ad41..ac43ae8d3 100644
--- a/tests/test_AedAeg.py
+++ b/tests/test_AedAeg.py
@@ -15,35 +15,28 @@ def test_name(self):
         assert self.species.name == "Aedes aegypti"
 
     def test_common_name(self):
-        assert self.species.common_name == "Aedes aegypti (LVP_AGWG)"
+        assert self.species.common_name == "Yellow fever mosquito"
 
-    # QC Tests. These tests are performed by another contributor
-    # independently referring to the citations provided in the
-    # species definition, filling in the appropriate values
-    # and deleting the pytest "skip" annotations.
-    @pytest.mark.skip("Population size QC not done yet")
     def test_qc_population_size(self):
-        assert self.species.population_size == -1
+        assert self.species.population_size == 1000000
 
-    @pytest.mark.skip("Generation time QC not done yet")
     def test_qc_generation_time(self):
-        assert self.species.generation_time == -1
+        assert self.species.generation_time == 1 / 15
 
 
 class TestGenomeData(test_species.GenomeTestBase):
 
     genome = stdpopsim.get_species("AedAeg").genome
 
-    @pytest.mark.skip("Recombination rate QC not done yet")
     @pytest.mark.parametrize(
-        ["name", "rate"], {"1": -1, "2": -1, "3": -1, "MT": -1}.items()
+        ["name", "rate"],
+        {"1": 0.306e-8, "2": 0.249e-8, "3": 0.291e-8, "MT": 0.0}.items(),
     )
     def test_recombination_rate(self, name, rate):
         assert pytest.approx(rate, self.genome.get_chromosome(name).recombination_rate)
 
-    @pytest.mark.skip("Mutation rate QC not done yet")
     @pytest.mark.parametrize(
-        ["name", "rate"], {"1": -1, "2": -1, "3": -1, "MT": -1}.items()
+        ["name", "rate"], {"1": 3.5e-9, "2": 3.5e-9, "3": 3.5e-9, "MT": 3.5e-9}.items()
     )
     def test_mutation_rate(self, name, rate):
         assert pytest.approx(rate, self.genome.get_chromosome(name).mutation_rate)