Draw your own custom landscapes and watch as your species evolves across them! Evodoodle is a drawing game for learning how evolution plays out across landscapes. Evodoodle allows you to control population density, connectivity, and selection across space and then simulates evolution using Geonomics, a powerful landscape genomic simulation package.
First, clone or download this repository. Once inside the evodoodle directory, you can then use the evodoodle.yml file to set-up a conda environment and install the required packages
conda env create -f evodoodle.yml
conda activate evodoodle
You can also manually install the required packages:
pip install numpy
pip install matplotlib
pip install seaborn
pip install geonomics
pip install pygame
Or use the Docker image:
docker pull ghcr.io/anushapb/evodoodle:latest
If you are using Visual Studio Code and have Docker installed on your computer, this repository is set-up so that you can open it within a container with everything ready-to-go. First, clone or download this repository. Then, in VS Code:
- Install the
Dev Containers
extension - Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
). - Type
"Remote-Containers: Open Folder in Container..."
and select it - Navigate to and select the evodoodle folder
For more detail instructions see here.
To start evodoodle, simply run the following code. Whenever draw_landscape()
is run a pop-up will appear that allows you to draw on a landscape. Once you have drawn your landscape, click SAVE
and the code will continue:
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import geonomics as gnx
from evodoodle import init_mod, draw_landscape, edit_landscape, plot_popgen, plot_landscapes
from gnx_params import params
import geonomics as gnx
# Draw landscapes
population_size = draw_landscape(d = 10)
connectivity = draw_landscape(d = 10)
environment = draw_landscape(d = 10)
# Plot the landscapes
plot_landscapes(population_size, connectivity, environment)
# Start the model
mod = init_mod(params, population_size, connectivity, environment)
# Run the model for 200 steps
mod.walk(200)
# Plot the results
plot_popgen(mod)
# From here you can continue to run the model for more steps and plot the results
For a more in-depth walkthrough and some fun challenges, check out the evodoodle_notebook.ipynb jupyter notebook