Skip to main content

A python library for animal breeding simulation

Project description

pynrm

pynrm is a lightweight and extensible Python library for livestock breeding simulation.

Build Status PyPI codecov GitHub GitHub issues Docs

Overview

The numerator relationship matrix describes additive genetic relationships within a population. Numerous evaluation-selection systems have been devised to produce populations with favorable genetic responses while maintaining moderate to low rates of inbreeding. pynrm provides a simple yet powerful simulation tool to forecast the stochastic impacts of these systems. One major bottleneck to running these simulations is that as the number of animals bred increases, the size of the matrix grows exponentially. pynrm efficiently solves for the numerator relationship matrix values by tracing up the pedigree for only the relevant ancestors, thereby minimizing computational overhead.

Basic Usage

Installation

pynrm is available on PyPI:

$ pip install pynrm

Supported Features

  • Livestock reproduction simulations that provide fine-grained control
from pynrm import Pedigree, Simulator

# Create a simulator instance
simulator = Simulator(Pedigree(50, 50), 5, 20, 0.6, 0.0)

# Reproduce 4 generations
for i in range(4):
    simulator.reproduce()
  • Data visualization and analysis of simulation results
# Plot average inbreeding coefficients by generation
simulator.plot_inbreeding_by_gen()

# Plot average EBV by generation
simulator.plot_ebv_by_gen()

# Export generated pedigree data as csv
simulator.export_to_csv("pedigree.csv")

Documentation

Official documentation is available here.

Contribution

Contributions are welcome! There are many ways to contribute to this project. Get started here.

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

pynrm-0.1.2.tar.gz (22.6 kB view details)

Uploaded Source

File details

Details for the file pynrm-0.1.2.tar.gz.

File metadata

  • Download URL: pynrm-0.1.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for pynrm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5de4ae34300f9b006ec7abf9d986735cbc920543a48b2da5084c7139bfac8878
MD5 50c802a2317bf2c43ead303edfdf757b
BLAKE2b-256 02ab847e65ea2f1bcdea3a0fb9552dfdf9fc349a8dafcf26f9b6b56355d696f1

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