PhosKinTime is an ODE-based modeling package for analyzing phosphorylation dynamics over time. It integrates parameter estimation, sensitivity analysis, steady-state computation, and visualization tools to help researchers explore kinase-substrate interactions in a temporal context.
This project originated as part of my master's thesis work at Theoretical Biophysics group ( now, Klipp-Linding Lab), Humboldt Universität zu Berlin.
- Conceptual framework and mathematical modeling were developed under the supervision of Prof. Dr. Dr. H.C. Edda Klipp.
- Experimental datasets were provided by the (Retd. Prof.) Dr. Rune Linding.
- The subpackage
tfopt
is an optimized and efficient derivative of original work by my colleague Julius Normann, adapted with permission.
I am especially grateful to Ivo Maintz for his generous technical support, enabling seamless experimentation with packages and server setups.
PhosKinTime uses ordinary differential equations (ODEs) to model phosphorylation kinetics and supports multiple mechanistic hypotheses, including:
- Distributive Model: Phosphorylation events occur independently.
- Successive Model: Phosphorylation events occur sequentially.
- Random Model: Phosphorylation events occur in a random manner.
The package is designed with modularity in mind. It consists of several key components:
- Configuration: Centralized settings (paths, parameter bounds, logging, etc.) are defined in the config module.
- Models: Different ODE models (distributive, successive, random) are implemented to simulate phosphorylation.
- Parameter Estimation: Multiple routines (sequential and normal estimation) estimate kinetic parameters from experimental data.
- Sensitivity Analysis: Morris sensitivity analysis is used to evaluate the influence of each parameter on the model output.
- Steady-State Calculation: Functions compute steady-state initial conditions for ODE simulation.
- Utilities: Helper functions support file handling, data formatting, report generation, and more.
- Visualization: A comprehensive plotting module generates static and interactive plots to visualize model fits, parameter profiles, PCA, t-SNE, and sensitivity indices.
This guide provides clean setup instructions for running the phoskintime
package on a new machine. Choose the scenario
that best fits your environment and preferences.
Before proceeding, ensure you have the following prerequisites installed:
- graphviz (for generating diagrams)
# For Debian/Ubuntu
sudo apt-get install graphviz
# For Fedora
sudo dnf install graphviz
# For MacOS
brew install graphviz
- python 3.10 or higher
# Check python version
python3 --version
# If not installed, install python 3.10 or higher
# For Debian/Ubuntu
sudo apt-get install python3.10
# For Fedora
sudo dnf install python3.10
# For MacOS
brew install python@3.10
- git (for cloning the repository)
# For Debian/Ubuntu
sudo apt-get install git
# For Fedora
sudo dnf install git
# For MacOS
brew install git
sudo apt update && sudo apt install -y python3 python3-pip python3-venv git
sudo dnf install -y python3 python3-pip python3-virtualenv git
git clone git@github.com:bibymaths/phoskintime.git
cd phoskintime
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
curl -sSL https://install.python-poetry.org | python3 -
# Or: pip install poetry
git clone git@github.com:bibymaths/phoskintime.git
cd phoskintime
# Install dependencies
poetry install
# Optional: activate shell within poetry env
poetry shell
Scenario 3: Using uv
(fast, isolated pip alternative)
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone git@github.com:bibymaths/phoskintime.git
cd phoskintime
# Create virtual environment and install deps fast
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
git clone git@github.com:bibymaths/phoskintime.git
cd phoskintime
# Create and activate conda environment
conda create -n phoskintime python=3.10 -y
conda activate phoskintime
# Install dependencies
pip install -r requirements.txt
Or if using pyproject.toml
, add:
pip install poetry
poetry install
For making illustration diagrams, you need to install Graphviz. You can do this via conda or apt-get:
conda install graphviz
or
apt-get install graphviz
or download it from the Graphviz website. For macusers, you can use Homebrew:
brew install graphviz
The package is executed via the main script located in the bin
directory. This script sets up the configuration,
processes experimental data, performs parameter estimation, generates model simulations, and creates a comprehensive
report.
The command-line arguments (such as parameter bounds, fixed parameters, bootstrapping iterations, and input file paths) are parsed by the configuration module. The main script then:
- Loads the experimental data.
- Logs the configuration and initializes output directories.
- Processes each gene in parallel using a ProcessPoolExecutor.
- Performs parameter estimation (toggling between sequential and normal modes as configured).
- Generates ODE simulations and various plots.
- Saves all results (including a global HTML report) in the designated output directory.
The phoskintime
pipeline provides a command-line interface to execute various stages of the workflow,
including preprocessing, optimization, and modeling. Below are the usage instructions and examples for running
the pipeline.
Before running any commands, ensure you are in the working directory one level above the project root (where the project
directory is visible).
Run the entire pipeline with the default (local) solver:
python phoskintime all
Execute only the preprocessing stage:
python phoskintime prep
Run TFOPT with the local solver:
python phoskintime tfopt --mode local
Run TFOPT with the evolutionary solver:
python phoskintime tfopt --mode evol
Run KINOPT with the local solver:
python phoskintime kinopt --mode local
Run KINOPT with the evolutionary solver:
python phoskintime kinopt --mode evol
Execute the modeling stage:
python phoskintime model
Here’s a brief overview of the execution flow:
-
Configuration:
config/config.py
andconfig/constants.py
set up model options (e.g.,ODE_MODEL
,ESTIMATION_MODE
), time points, file paths, and logging settings.- Command-line arguments are parsed to override default settings.
-
Parameter Estimation:
- Depending on the chosen estimation mode (sequential or normal), functions from
paramest/seqest.py
orparamest/normest.py
are used. - The toggle functionality in
paramest/toggle.py
selects the appropriate routine. - Results are saved and passed for visualization.
- Depending on the chosen estimation mode (sequential or normal), functions from
-
Model Simulation and Visualization:
- The selected ODE model (from
models/
) is used to simulate system dynamics. - The
plotting
module generates plots (e.g., parallel coordinates, PCA, t-SNE, model fits, and sensitivity plots) to visually inspect the results.
- The selected ODE model (from
-
Reporting:
- The
utils/display.py
andutils/tables.py
modules save results and generate an HTML report summarizing the analysis.
- The
-
Config Module:
config/constants.py
: Global constants (model settings, time points, directories, scoring weights, etc.).config/config.py
: Command-line argument parsing and configuration extraction.config/logconf.py
: Logging configuration with colored console output and rotating file logs.config/helpers/__init__.py
: Helper functions for generating parameter names, state labels, bounds, and clickable file links.
-
Models Module:
Implements various ODE models:randmod.py
: Random model with vectorized state calculations.distmod.py
: Distributive model.succmod.py
: Successive model.weights.py
: Weighting schemes for parameter estimation.
-
Parameter Estimation Module:
normest.py
: Normal (all timepoints at once) estimation.toggle.py
: Utility to switch between estimation modes.core.py
: Integrates estimation, ODE solving, error metrics, and visualization.
-
Steady-State Module:
initdist.py
,initrand.py
,initsucc.py
: Compute steady-state initial conditions for each model type.
-
Sensitivity Module:
analysis.py
: Implements Morris sensitivity analysis, including problem definition, sampling, analysis, and plotting of sensitivity indices.
-
Utils Module:
display.py
: Helper functions for file/directory management, data loading, result saving, and report generation.tables.py
: Functions to generate, save, and compile data tables (LaTeX and CSV).
-
Bin Module:
main.py
: The main entry point that orchestrates the entire workflow—from configuration and data loading to parameter estimation, simulation, visualization, and report generation.
You can customize the package by:
- Adjusting model parameters and bounds in the config files.
- Choosing the ODE model type by modifying
ODE_MODEL
inconstants.py
. - Configuring output directories and file paths.
- Modifying the logging behavior in
logconf.py
. - Tweaking the scoring function weights in
constants.py
.
PhosKinTime is a flexible and powerful package for modeling phosphorylation kinetics. Its modular design allows researchers to simulate different mechanistic models, estimate kinetic parameters, analyze parameter sensitivity, and generate comprehensive visual and tabular reports. Whether you are exploring basic kinetic hypotheses or conducting in-depth sensitivity analysis, PhosKinTime offers the necessary tools for robust model-based analysis.
For more information, please refer to the individual module documentation and source code.
This package is distributed under the BSD 3-Clause License.
See the LICENSE file for full details.