Skip to main content

Numba-Accelerated Toolkit for Analysis of Lifecycle-based population genetic dynamics

Project description

⚡️ NATAL Core

Numba-Accelerated Toolkit for Analysis of Lifecycles.

GitHub PyPI Python NumPy Numba Docs License

NATAL logo

NATAL Core is a population genetics simulation engine focused on lifecycle-aware modeling. It supports age-structured and discrete-generation populations, sperm storage, gene drive presets, hook-based interventions, and high-performance Numba kernels.

NATAL Core is part of the NATAL project. The full project also includes NATAL Inferencer, a toolkit for parameter inference in population genetics models based on NATAL Core.

Key Features

  • 🪲 Lifecycle-aware population modeling (age-structured and discrete-generation).
  • 🧬 Genetic architecture definition with chromosomes, loci, and alleles.
  • 🚀 Numba-accelerated kernels for high performance.
  • 🧩 Built-in genetic presets (for example, homing drives and toxin-antidote drives).
  • 🪝 Hook system for custom interventions during simulation.
  • 🔍 Observation and filtering utilities for downstream analysis.
  • 🌐 Spatial simulation support across multiple demes.

Installation

pip install natal-core

For development:

git clone https://github.com/jyzhu-pointless/natal-core.git
cd natal-core
python -m venv .venv
source .venv/bin/activate
pip install -e .

Quick Start

import natal as nt

species = nt.Species.from_dict(
	name="DemoSpecies",
	structure={"chr1": {"A": ["WT", "Drive"]}},
)

pop = (
	nt.DiscreteGenerationPopulation
	.setup(species=species, stochastic=False)
	.initial_state(individual_count={"female": {"WT|WT": 100}, "male": {"WT|WT": 100}})
	.survival(female_age0_survival=1.0, male_age0_survival=1.0)
	.reproduction(eggs_per_female=10)
	.competition(low_density_growth_rate=2.0, carrying_capacity=1000)
	.build()
)

pop.run(n_steps=10, record_every=1)
print(nt.population_to_readable_dict(pop)["tick"])

Documentation and Links

Demos

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

natal_core-0.1.0rc1.tar.gz (837.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

natal_core-0.1.0rc1-py3-none-any.whl (276.0 kB view details)

Uploaded Python 3

File details

Details for the file natal_core-0.1.0rc1.tar.gz.

File metadata

  • Download URL: natal_core-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 837.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for natal_core-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 fda5cc61d6d05e200a78d5088be4e513f632f515ee02ee6728bc3130e4151924
MD5 2045aec502869b589eba76938c1bca2c
BLAKE2b-256 d806d9cbda36b7b70658e2f9af299ff196839e3058345c7ad9655c08124f857b

See more details on using hashes here.

File details

Details for the file natal_core-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: natal_core-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 276.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for natal_core-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 1534fe6081da4a7e04cd13aaa27f7273cfb523c80572cccbc4119f651ea46708
MD5 bba2c4a6e885ced72a2232bbde3544c4
BLAKE2b-256 ba554f14bab2ad3058e50d8a15ff1c6c936c8341a2e33d6d9309dfc26707b3ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page