Skip to main content

@author: nzupp

Project description

SLiM-Gym

An early development Gymnasium wrapper for the SLiM 4 simulator enabling reinforcement learning for population genetics

Quick start guide

  1. Install via pip: pip install slim_gym
  2. Install SLiM 4 from the Messer Lab and ensure it's in your system PATH or working directory
  3. Run a basic, random agent:
import slim_gym
slim_gym.run_random_agent()

Users can also adjust the environment and pass it as a parameter to the random walk algorithm:

import slim_gym

# Redefine env
output_file='sim.slim'
init_mutation_rate=1e-7
num_sites=999
recomb_rate=1e-8
pop_size=10000
sampled_individuals=25
sfs_stack_size=8
bottleneck=0.99

env = slim_gym.make_env(output_file=output_file,
    init_mutation_rate=init_mutation_rate,
    num_sites=num_sites,
    recomb_rate=recomb_rate,
    pop_size=pop_size,
    sampled_individuals=sampled_individuals,
    sfs_stack_size=sfs_stack_size,
    bottleneck=bottleneck)

slim_gym.run_random_agent(env=env)

If these parameters are unfamiliar to you, our more detailed documentation (coming soon) is a great place to start. This environment functions as a Gymnasium environment, and can be used as such downstream. The code for making environments and the random walk algorithm can be found in the examples/ folder.

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

slim_gym-0.2.4.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

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

slim_gym-0.2.4-py2.py3-none-any.whl (24.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file slim_gym-0.2.4.tar.gz.

File metadata

  • Download URL: slim_gym-0.2.4.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for slim_gym-0.2.4.tar.gz
Algorithm Hash digest
SHA256 356e56b0b10916caee1c9997f2de6963a7806b6aee46d0d88c09e5c3f6be1fad
MD5 ebf88038592c7e340505636f5d4fa381
BLAKE2b-256 3efc468f8cf38d6b0a64e297cab42e70e114e7edc6ae4f747b6750619131826d

See more details on using hashes here.

File details

Details for the file slim_gym-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: slim_gym-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for slim_gym-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2d8ec16ee65276c74fe1713f4e104dce88fec8035448c38b5df7122cb753524c
MD5 4d53de6eaee65d4aa5bdd93614e65b7d
BLAKE2b-256 3c3e2e443e46f089b22c1c6cafd6f134487d967f5bb3d76a76d72e7e308a602b

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