@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
- Install via pip:
pip install slim_gym - Install SLiM 4 from the Messer Lab and ensure it's in your system PATH or working directory
- 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slim_gym-0.2.2.tar.gz.
File metadata
- Download URL: slim_gym-0.2.2.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4edc67735e0d248092f0fa031ac78e130db27eb5fd26d4397b8b6ebcaf2b6db1
|
|
| MD5 |
bf721a570a178d6abc0c9ecfe28abb06
|
|
| BLAKE2b-256 |
fc55bf537698ed6ec986757b3c0025b57f698ccfaa46274429bfaeddeb0e6105
|
File details
Details for the file slim_gym-0.2.2-py2.py3-none-any.whl.
File metadata
- Download URL: slim_gym-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4fb96fbbe74802b825ee9dc6eafcb81e58b193e494a28b14ceaee4e2e491576
|
|
| MD5 |
99d254844098b195218ca548709ed3d3
|
|
| BLAKE2b-256 |
837f4684d3009ce10699071dd43ebfbdcd2bf3fec2c4f2f840b223ab9077ee4d
|