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

Issue:
QC for Chlamydomonas reinhardtii
**PR for new species:** #863

IMPLEMENTER'S NOTE: The recombination rates are from Hasan and Ness 2020, but the raw values were not published as part of the manuscript - per @jeromekelleher's advice I'll be uploading them to figshare and updating the doi.

The per-chromosome mutation rates will also hopefully be added in as a separate PR (I was just sent the data late yesterday) and I'll be asking about whether I can make those public as well - though it's not my data, so TBD! 

---

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!)

- [ ] 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.
- [ ] 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.
- [ ] Recombination map (if present).
  - Does it match the assembly? Liftover is fine, if clearly stated.
  - Is the description/long_description a good summary of how the map was created?
- [ ] Population size.
- [ ] 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:
- [ ] Genome reference assembly.
- [ ] Mutation rate.
- [ ] Recombination rate.
- [ ] Recombination map(s) (if relevant).
- [ ] Population size.
- [ ] Generation time.

The final PR should:
- [ ] fill out the test stubs
- [ ] delete the `pytest.mark.skip` lines that make the tests not run
- [ ] make sure they pass, talking to the original author to figure out discrepancies



Discussion / hints:
Hi @aays, thanks for contributing to stdpopsim. I will be QCing your species. Do you have an update on the publication of the raw recombination data? 
> **PR for new species:** #863
> 
> IMPLEMENTER'S NOTE: The recombination rates are from Hasan and Ness 2020, but the raw values were not published as part of the manuscript - per @jeromekelleher's advice I'll be uploading them to figshare and updating the doi.
> 
> The per-chromosome mutation rates will also hopefully be added in as a separate PR (I was just sent the data late yesterday) and I'll be asking about whether I can make those public as well - though it's not my data, so TBD!
> 
> 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.
It has a publication, but I can't find the raw values, so maybe  can you add those raw values to figshare?
>   
>   * 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.
It matches with Ness et al 2015
>   
>   * 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]  Recombination map (if present).
>   
>   * Does it match the assembly? Liftover is fine, if clearly stated.
>   * Is the description/long_description a good summary of how the map was created?
> * [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]  Genome reference assembly.
> * [X]  Mutation rate.
> * [X]  Recombination rate.
> * [X]  Recombination map(s) (if relevant).
> * [X]  Population size 
> * [X]  Generation time. 
I see that the generation is cited, but it is not explicitly written, maybe you calculated it @aays from the article?
> 

I will create the PR once I get the raw recombination map. 
> The final PR should:
> 
> * [ ]  fill out the test stubs
> * [ ]  delete the `pytest.mark.skip` lines that make the tests not run
> * [ ]  make sure they pass, talking to the original author to figure out discrepancies


> Hi @aays, thanks for contributing to stdpopsim. I will be QCing your PR. Do you have an update on the publication of the raw recombination data?

Hi @izabelcavassim, thanks for the QC! I did indeed upload the raw recombination data to figshare in #950 (the specific link can be found [here](https://doi.org/10.6084/m9.figshare.14608239.v1)). Please let me know if anything else is missing! 
Great @aays I will be looking at the figshare files and updating the values in the test scripts! Will let you know once I am done so you can have a look at that PR! Thanks! 

Fix patch:
diff --git a/stdpopsim/catalog/ChlRei/species.py b/stdpopsim/catalog/ChlRei/species.py
index 7c9da0f40..70e2d124a 100644
--- a/stdpopsim/catalog/ChlRei/species.py
+++ b/stdpopsim/catalog/ChlRei/species.py
@@ -93,7 +93,7 @@
             reasons={stdpopsim.CiteReason.POP_SIZE},  # Quebec population
         ),
         stdpopsim.Citation(
-            author="Vitova et al.",
+            author="Vítová et al",
             year=2011,
             doi="https://doi.org/10.1007/s00425-011-1427-7",
             reasons={stdpopsim.CiteReason.GEN_TIME},


Test patch:
diff --git a/tests/test_ChlRei.py b/tests/test_ChlRei.py
index 2e4cec0bb..3b4efb9fb 100644
--- a/tests/test_ChlRei.py
+++ b/tests/test_ChlRei.py
@@ -21,40 +21,37 @@ def test_common_name(self):
     # 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 == 1.4 * 1e-7
 
-    @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 / 876
 
 
 class TestGenomeData(test_species.GenomeTestBase):
 
     genome = stdpopsim.get_species("ChlRei").genome
 
-    @pytest.mark.skip("Recombination rate QC not done yet")
     @pytest.mark.parametrize(
         ["name", "rate"],
         {
-            "1": -1,
-            "2": -1,
-            "3": -1,
-            "4": -1,
-            "5": -1,
-            "6": -1,
-            "7": -1,
-            "8": -1,
-            "9": -1,
-            "10": -1,
-            "11": -1,
-            "12": -1,
-            "13": -1,
-            "14": -1,
-            "15": -1,
-            "16": -1,
-            "17": -1,
+            "1": 1.21e-10,
+            "2": 1.49e-10,
+            "3": 1.52e-10,
+            "4": 1.47e-10,
+            "5": 1.70e-10,
+            "6": 1.17e-10,
+            "7": 8.66e-11,
+            "8": 1.39e-10,
+            "9": 1.12e-10,
+            "10": 1.97e-10,
+            "11": 1.63e-10,
+            "12": 9.15e-11,
+            "13": 1.43e-10,
+            "14": 1.90e-10,
+            "15": 3.93e-10,
+            "16": 1.71e-10,
+            "17": 1.83e-10,
         }.items(),
     )
     def test_recombination_rate(self, name, rate):
@@ -62,27 +59,26 @@ def test_recombination_rate(self, name, 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,
-            "4": -1,
-            "5": -1,
-            "6": -1,
-            "7": -1,
-            "8": -1,
-            "9": -1,
-            "10": -1,
-            "11": -1,
-            "12": -1,
-            "13": -1,
-            "14": -1,
-            "15": -1,
-            "16": -1,
-            "17": -1,
+            "1": 9.74e-10,
+            "2": 8.62e-10,
+            "3": 9.50e-10,
+            "4": 9.66e-10,
+            "5": 1.17e-09,
+            "6": 9.12e-10,
+            "7": 9.14e-10,
+            "8": 8.98e-10,
+            "9": 9.17e-10,
+            "10": 9.27e-10,
+            "11": 1.03e-09,
+            "12": 9.55e-10,
+            "13": 7.56e-10,
+            "14": 8.96e-10,
+            "15": 6.91e-10,
+            "16": 9.59e-10,
+            "17": 1.05e-09,
         }.items(),
     )
     def test_mutation_rate(self, name, rate):