_CampbellEtAl.because(stdpopsim.CiteReason.REC_RATE), _LindbladTohEtAl.because(stdpopsim.CiteReason.ASSEMBLY), ], ) _species = stdpopsim.Species( id="CanFam", ensembl_id="canis_familiaris", name="Canis familiaris", common_name="Dog", genome=_genome, population_size=13000, # ancestral dog size generation_time=3, citations=[ # Everyone uses 3 years for generation time because everyone else uses it. # It's likely higher, at least in wolves: # https://academic.oup.com/mbe/article/35/6/1366/4990884 # Reasoning behind a generation time of 3 years: # Consider two use cases for CanFam simulations: # (1) for domestic dog simulations, and (2) for wolf+dog simulations # (or ancestral dogs). # In case (1), maybe 3 year generations are more appropriate because of human # intervention in breeding. In case (2), you might want to match what other # studies have done (thus using 3 year generations), or you might want to # consider what is known about modern wolves. _LindbladTohEtAl.because(stdpopsim.CiteReason.POP_SIZE) ], ) stdpopsim.register_species(_species)
def test_add_duplicate_species(self): species = stdpopsim.get_species("HomSap") with self.assertRaises(ValueError): stdpopsim.register_species(species)
import shutil import string import pathlib import logging import click import black import daiquiri import stdpopsim from . import ensembl logger = logging.getLogger("maint") species_template = string.Template( """ import stdpopsim from . import genome_data # [The following are notes for implementers and should be deleted # once the recombination rates have been inserted] # This is the per-chromosome recombination rate, typically the mean # rate along the chromosome. # Values in this dictionary are set to -1 by default, so you have # to update each one. These should be derived from the most reliable # data and how they were obtained should be documented here. # The appropriate citation must be added to the list of # recombination_rate_citations in the Genome object. _recombination_rate = $chromosome_rate_dict
Command line interface for managing routine maintenance tasks. This interface is for stdpopsim developers only. """ import contextlib import shutil import string import pathlib import click import black import stdpopsim from . import ensembl species_template = string.Template(""" import stdpopsim from . import genome_data _chromosomes = [] for name, data in genome_data.data["chromosomes"].items(): _chromosomes.append( stdpopsim.Chromosome( id=name, length=data["length"], synonyms=data["synonyms"], mutation_rate=0, # FILL ME IN recombination_rate=0, # FILL ME IN ) )