Skip to main content

A package for landscape genomic simulation

Project description

./img/gnx_mini_350dpi.png

A Python package for simulation of genomic evolution on complex and dynamic landscapes

Geonomics allows users to build and run arbitrarily complex, forward-time, agent-based, and spatially explicit simulations for landscape genomics. It is designed to allow even novice Python users to create sophisticated simulations with minimal code, while also allowing advanced users a high level of extensibility and customizability.

We will continue to expand and add functionality in future versions. Please contact us with questions, suggestions, or requests!

Main Features

The following is a short list of highlights. For the full monty, please see the homepage, the docs, and the original methods paper.

  • a model object, which serves as the primary user interface and which contains all other model components

  • a landscape object consisting of an arbitrary number of environmental raster layers

  • a community object consisting of an arbitrary number of species objects, each consisting of an arbitrary number of individuals

  • an optional genomic-architecture object, upon which individuals’ genomes are based

  • spatialized logistic growth regulating local population densities

  • the capability to model realistic movement and offspring dispersal across conductance surfaces

  • neutral and non-neutral evolution capabilities, with spatially contingent selection

  • demographic- and environmental-change capabilities

  • the capability to run an arbitrary number of iterations of a model

  • the capability to sample data and a variety of statistics at any desired timesteps during a model run

  • numerous visualization methods to aid in model design, exploration, analysis, and presentation

Installation

Geonomics can be installed with pip:

pip install geonomics

Quickstart

For impatient beginners, the following code will run Geonomics’ default model:

>>> import geonomics as gnx
>>> mod = gnx.run_default_model(delete_params_file=False)

This will build and run geonomics’ default model, return its Model object as mod, and leave its parameters file in your current working directory under the name ‘GNX_default_model_params.py’.

For patient folks, the following diagrams should provide more insight, and the documentation provides full details.

Details

Procedural Diagram

./img/procedural_diagram.jpg

Users can run Geonomics models in as few as three steps.

  1. Create and edit a parameters file: After importing geonomics as gnx, users can run the function gnx.make_parameters_file() function, feeding in a series of arguments to indicate the desired number and type of landscape layers, number and parameterization of species, data and statistics to be recorded, and parameters file name. Users can then edit the default parameter values in the resulting file to parameterize their model. Within the parameters file, they have the option of referencing external files to be used by their model, including static raster files or directories of raster time series, as well as a CSV file defining a custom genomic architecture.

  2. Use the parameters file to create a model: After setting up their parameters file, users can call the gnx.make_model() function, providing their parameters file’s name as an argument. This will create a new gnx.Model object, containing a gnx.Landscape with the defined number of layers, and a gnx.Community with the defined number of species composed of starting individuals. The landscape, species, and individuals will all be described by a number of characteristics, in accordance with the values defined in the parameters file.

  3. Run the model: Users can then call the model’s mod.run or mod.walk methods, to either run their model to completion or run it manually for some number of time steps. Each time step will include, as applicable, movement, mating, mortality, environmental and demographic change, and data-writing operations. For more detail on these operations, see the conceptual diagram that follows.

Conceptual Diagram

./img/conceptual_diagram.jpg

Operations during the main phase of a Geonomics model run. In the center is a species on a multi-layer landscape that includes a selection layer (above) and a movement and carrying capacity layer (below). Surrounding the landscape is a flow-diagram of the major operations during a time step. Operations in dashed boxes are optional.

  • movement: During the movement stages (top-left), individuals move along movement vectors drawn from various distribution options.

  • mating: During the mating stage (top-right), an individual (purple outline) randomly chooses a mate (green outline) from all potential mates within its mating radius (dashed circle). The resulting offspring (dashed outline) disperses from its parents’ midpoint along a randomly drawn dispersal vector.

  • mortality: During the mortality stage (bottom-right), deaths are modeled as a Bernoulli process, with the probability of mortality being a product of density-dependence and selection on all traits.

  • changes: During the changes stage (bottom-left), demographic change events (not pictured) and environmental change events (represented as a series of change rasters corresponding to scheduled time steps, t1, t2, …, tn), take place.


Attribution

This package was written by Drew Ellison Terasaki Hart, as part of his PhD work. It is available to freely distribute and modify, with proper attribution, under the MIT License. Should you have any questons or concerns, please feel free to get in touch! (drew <dot> hart <at> berkeley <dot> edu)

Should you use Geonomics for research, education, or any other purpose, please cite as:

Terasaki Hart, D.E., Bishop, A.P., Wang, I.J. 2021. Geonomics: forward-time, spatially explicit, and arbitrarily complex landscape genomic simulations. Manuscript submitted for publication.

      .                  .   ::::::          :::    :: :::::::::::.           .
                   .::::::    ::::   :::      ::    :: :: ::::::::::: ::.                 .
   .      .     .:::::::::     ::            ::   :::::::::::::::::::::::::.        .
              .::::::::::                      :::::::::: :::::: ::::::::  ::.
        .   .  : ::::  ::                    ::::  : ::    :::::::: : ::  :    .      .
           . 55555 :3333: 00000   44   44   00000   44   44 111111  66666 55555 .
          . 55     33    00   00  444  44  00   00  44   44   11   66     55     .         .
.         . 55     33   00     00 44 4 44 00     00 444 444   11   66     555555 .
          . 55 555 3333 00     00 44  444 00     00 44 4 44   11   66         55 .
          . 55   5 33    00   00  44   44  00   00  44   44   11   66        555 .     .
           . 55555 :3333: 00000   44   44   00000   44   44 111111  66666 55555 .         .
     .      .    : ::::::::               :::::::::: ::              ::  :   : .
    .         .:    :::::                    :::::: :::             :::::::  .      .
 .              .    :::                      :::::  ::              ::::: .              .
          .        .  ::                      ::::                      .
                         . ::                                     .                .

Disclaimer

Geonomics claims no affiliation with the philosophy and economic ideology Georgism, sometimes referred to as ‘geonomics’.

Rather, it is a portmanteau of geography and genomics. We thought it sounded neat, and found it delightfully confusing.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

geonomics-1.4.9.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

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

geonomics-1.4.9-py2.py3-none-any.whl (3.5 MB view details)

Uploaded Python 2Python 3

File details

Details for the file geonomics-1.4.9.tar.gz.

File metadata

  • Download URL: geonomics-1.4.9.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.9.12

File hashes

Hashes for geonomics-1.4.9.tar.gz
Algorithm Hash digest
SHA256 7f5a6aa3dd69789905a8eb49c9099dd3f0815cdb78b3f437fa3ed7d40f0c7c14
MD5 a335cc03cd23c76e11c97d7142ee3403
BLAKE2b-256 9b4d0f06a0a34406c015672fc471eedbb0a7aea05697b6f643e444c131dbf8b6

See more details on using hashes here.

File details

Details for the file geonomics-1.4.9-py2.py3-none-any.whl.

File metadata

  • Download URL: geonomics-1.4.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.9.12

File hashes

Hashes for geonomics-1.4.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9b1a7e831818e3c1908e3329bc23a76596e7791a53ebd656723dc9bcc7817857
MD5 ed2f637f1cbbe2cbfd43a4830f410a44
BLAKE2b-256 90180bbda127a274ca1e97a54af1ceb55daaabc6f32865cfa36feec99a3ba5b5

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