This repository contains code for the data generation and visualization for Stochastic modelling of PKS recombination in Streptomyces conducted at UZH at the Department of Evolutionary Biology and Environmental Studies under the supervision of Dr. Aleks Nivina and Prof. Dr. Wagner.
The code for running the stochastic models and their visualization is in the code folder. The data folder contains the images for each run with 20 replicatesa and summary figures in plotting folder in each folder for different selection modes.
The folder code contains 3 python files and one Jupyter notebook:
- no_selection.py - code for simulations under no selection, parallelized
- pretty_stochastic.py - code for simulations under selection, parallelized
- stochastic_plotting.ipynb - code for visualizations (different sections for processing no selection and selection data)
- utils.py - code for summary statistics used for visualization
The folder data contains the visualizations of the simulation and two folders:
- no_selection_f3less - plots the proportions of each genotype throughout simulation under no selection
- dif_selection_f3less - plots the proportions of each genotype throughout simulation under selection
Each of these subfolders also contains plotting folder, where summary statistics are visualized.
The project has the following structure:
pks_stochastic
│ README.md
│ requirements.txt
│
└───code
│ │ no_selection.py
│ │ selection.py
│ │ stochastic_plotting.ipynb
│ │ utils.py
│
└───data
│ │
│ └───no_selection_f3less
│ │ ...
│ └───plotting
│ │ │ ...
│ │
│ └───dif_selection_f3less
│ │ ...
│ └───plotting
│ │ │ ...
All code was run on Python 3.12.7 and macOS Sonoma 14.4.
- You need
gitto be installed. Open terminal (Crtl+Alt+t) and run following commands:
git clone https://github.com/AnnaToi01/pks_stochastic.git
cd pks_stochastic-
Create virtual environment
-
Via
venv- Create virtual environment
python -m venv venv
- Activate it
source venv/bin/activate
- Create virtual environment
-
Via
virtualenv- Install virtualenv if it is not installed.
pip install virtualenv
- Create virtual environment
virtualenv venv --python=3.12
- Activate it
source ./venv/bin/activate
- Install virtualenv if it is not installed.
-
Via
conda- Install Anaconda if not already installed (see Instructions).
- Create virtual environment
conda create --name <env_name> python=3.12
- Activate it
conda activate <env_name>
-
-
Install necessary libraries
pip install -r requirements.txtAfter all required libraries installation you can launch the code and Jupyter notebooks.