Constructing, optimizing Boolean Models and performing in-silico perturbations.
Project description
PyDrugLogics
Overview
PyDrugLogics is a Python package designed for constructing, optimizing Boolean Models and performs in-silico perturbations of the models.
Core Features
- Construct Boolean model from
.siffile - Load Boolean model from
.bnetfile - Optimize Boolean model
- Generate perturbed models
- Evaluate drug synergies
Installation
PyDrugLogics can be installed via PyPi, Conda, or directly from the source.
Install PyDrugLogics from PyPI
The process involves two steps to install the PyDrugLogics core package and its necessary external dependencies.
1. Install PyDrugLogics via pip
pip install pydruglogics
2. Install External Dependency
pip install -r https://raw.githubusercontent.com/druglogics/pydruglogics/main/requirements.txt
This will install the PyDrugLogics package and handle all dependencies automatically.
Install PyDrugLogics via conda
conda install szlaura::pydruglogics
Install from Source
For the latest development version, you can clone the repository and install directly from the source:
git clone https://github.com/druglogics/pydruglogics.git
cd pydruglogics
pip install .
pip install -r requirements.txt
CoLoMoTo Notebook environment
PyDrugLogics is available in the CoLoMoTo Docker and Notebook starting from version 2025-01-01.
Setup CoLoMoTo Docker and Notebook
- Install the helper script in a terminal:
pip install -U colomoto-docker
- Start the CoLoMoTo Notebook (a specific tag can also be given):
colomoto-docker # or colomoto-docker -V 2025-01-01
- Open the Jupiter Notebook and navigate to the
tutorialsfolder to find thePyDrugLogicsfolder hosting the pydruglogics tutorial notebook.
See more about the CoLoMoTo Docker and Notebook in the documentation.
Testing
- To run all tests and check code coverage, you need to install test dependencies:
pip install -r requirements.txt
pip install -e .[test]
- Then, from the repository root, run:
pytest tests
You should see a coverage report at the end.
Documentation
For full PyDrugLogics documentation, visit the GitHub Documentation.
Quick Start Guide
Here's a simple example to get you started:
from pydruglogics.model.BooleanModel import BooleanModel
from pydruglogics.input.TrainingData import TrainingData
from pydruglogics.input.Perturbations import Perturbation
from pydruglogics.input.ModelOutputs import ModelOutputs
from pydruglogics.execution.Executor import execute
# Initialize train and predict
model_outputs_dict = {
"RSK_f": 1.0,
"MYC": 1.0,
"TCF7_f": 1.0
}
model_outputs = ModelOutputs(input_dictionary=model_outputs_dict)
observations = [(["CASP3:0", "CASP8:0","CASP9:0","FOXO_f:0","RSK_f:1","CCND1:1"], 1.0)]
training_data = TrainingData(observations=observations)
drug_data = [['PI', 'PIK3CA', 'inhibits'],
['PD', 'MEK_f', 'activates'],
['CT','GSK3_f']]
perturbations = Perturbation(drug_data=drug_data)
boolean_model = BooleanModel(file='./ags_cascade_1.0/network.bnet', model_name='test', mutation_type='topology',
attractor_tool='mpbn', attractor_type='trapspaces')
observed_synergy_scores = ["PI-PD", "PI-5Z", "PD-AK", "AK-5Z"]
ga_args = {
'num_generations': 20,
'num_parents_mating': 3,
'mutation_num_genes': 3,
'fitness_batch_size': 20
}
ev_args = {
'num_best_solutions': 3,
'num_of_runs': 30,
'num_of_cores': 4
}
train_params = {
'boolean_model': boolean_model,
'model_outputs': model_outputs,
'training_data': training_data,
'ga_args': ga_args,
'ev_args': ev_args
}
predict_params = {
'perturbations': perturbations,
'model_outputs': model_outputs,
'observed_synergy_scores': observed_synergy_scores,
'synergy_method': 'bliss'
}
# run train and predict
execute(train_params=train_params, predict_params=predict_params)
For a more detailed tutorial, please visit the documentation or the tutorial.
Citing PyDrugLogics
If you use PyDrugLogics, please cite the paper:
Flobak, Å., Zobolas, J. et al. (2023): Fine tuning a logical model of cancer cells to predict drug synergies: combining manual curation and automated parameterization. DOI: 10.3389/fsysb.2023.1252961
@Article{druglogics2023,
title = {Fine tuning a logical model of cancer cells to predict drug synergies: combining manual curation and automated parameterization},
author = {Flobak, Å., Zobolas, J. and Other Authors},
journal = {Frontiers},
year = {2023},
month = {nov},
doi = {10.3389/fsysb.2023.1252961},
url = {https://www.frontiersin.org/journals/systems-biology/articles/10.3389/fsysb.2023.1252961/full},
}
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 pydruglogics-0.1.9.tar.gz.
File metadata
- Download URL: pydruglogics-0.1.9.tar.gz
- Upload date:
- Size: 81.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05619eb80ae8461381f0ca87d9f28aff86992c33a7ab03a4dc73f2e5b8e2c5ed
|
|
| MD5 |
659f8bce53f12c90c76ed469bbbe52e7
|
|
| BLAKE2b-256 |
e100e00e5e690e7d2c5a24bfe1f06f56a35c702aae9f7dac3156412700fca3bd
|
File details
Details for the file pydruglogics-0.1.9-py3-none-any.whl.
File metadata
- Download URL: pydruglogics-0.1.9-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf4383e6aeb36516be4b3ef6afb085698856da9858f83af14f73b65e46e40615
|
|
| MD5 |
b036ccf9bef11ff8094d7a60aae1291c
|
|
| BLAKE2b-256 |
54c1185b09068b70bb5d0f0bd3b54044cab6c1362aee98403a1f691f48ee290d
|