Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Aedes aegypti #871

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stdpopsim/catalog/AedAeg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""
Catalog definitions for AedAeg (Ensembl ID='aedes_aegypti_lvpagwg')
"""
from . import species # noqa: F401
11 changes: 11 additions & 0 deletions stdpopsim/catalog/AedAeg/genome_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File autogenerated from Ensembl REST API. Do not edit.
data = {
"assembly_accession": "GCA_002204515.1",
"assembly_name": "AaegL5",
"chromosomes": {
"1": {"length": 310827022, "synonyms": []},
"2": {"length": 474425716, "synonyms": []},
"3": {"length": 409777670, "synonyms": []},
"MT": {"length": 16790, "synonyms": []},
},
}
69 changes: 69 additions & 0 deletions stdpopsim/catalog/AedAeg/species.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import stdpopsim

from . import genome_data

petrelharp marked this conversation as resolved.
Show resolved Hide resolved
# These are in Table 1 of Juneja et al:
_recombination_rate = {"1": 0.306, "2": 0.249, "3": 0.291, "MT": 0}

_JunejaEtAl = stdpopsim.Citation(
doi="https://doi: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
_mutation_rate = {
"1": _overall_rate,
"2": _overall_rate,
"3": _overall_rate,
"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,
author="Nene et al.",
reasons={stdpopsim.CiteReason.ASSEMBLY},
)


_genome = stdpopsim.Genome.from_data(
genome_data.data,
recombination_rate=_recombination_rate,
mutation_rate=_mutation_rate,
citations=[
_NeneEtAl,
_Ag1000G,
_JunejaEtAl,
],
)


_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)",
genome=_genome,
generation_time=1 / 10,
population_size=1e6,
citations=[_CrawfordEtAl],
)

stdpopsim.register_species(_species)
49 changes: 49 additions & 0 deletions tests/test_AedAeg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import pytest

import stdpopsim
from tests import test_species


class TestSpeciesData(test_species.SpeciesTestBase):

species = stdpopsim.get_species("AedAeg")

def test_ensembl_id(self):
assert self.species.ensembl_id == "aedes_aegypti_lvpagwg"

def test_name(self):
assert self.species.name == "Aedes aegypti"

def test_common_name(self):
assert self.species.common_name == "Aedes aegypti (LVP_AGWG)"

# 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

@pytest.mark.skip("Generation time QC not done yet")
def test_qc_generation_time(self):
assert self.species.generation_time == -1


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()
)
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()
)
def test_mutation_rate(self, name, rate):
assert pytest.approx(rate, self.genome.get_chromosome(name).mutation_rate)