stochasticantibiotic

A Stochastic Programming Approach to the Antibiotics Time Machine Problem

https://github.com/oguzmes/stochasticantibiotic

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

markov-chain markov-decision-processes optimization-algorithms python
Last synced: 6 months ago · JSON representation ·

Repository

A Stochastic Programming Approach to the Antibiotics Time Machine Problem

Basic Info
  • Host: GitHub
  • Owner: oguzmes
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 5.64 MB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
markov-chain markov-decision-processes optimization-algorithms python
Created about 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

A Stochastic Programming Approach to the Antibiotics Time Machine Problem

This repository contains the code for the paper A Stochastic Programming Approach to the Antibiotics Time Machine Problem.

Authors

Usage

Requires Python 3.11 and library version requirements can be found in requirements.txt.

Running Code and Getting Results

Tool can be used from CLI after installing the necessary dependencies and cloning the repository. The information on how to use the tool is also defined within itself. bash python ABR.py -h usage: StochasticAntibiotic [-h] [--dataset DATASET] [--n [N]] [--initialState [INITIALSTATE]] [--targetState [TARGETSTATE]] [--plotSolution] [--solutionMethod {DP,Multistage,Strong2stage,Weak2stage}] [--matrixSamplingSize MATRIXSAMPLINGSIZE] [--matrixType {epm,cpm}] [--timeLimit TIMELIMIT]

optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET
  --n [N]               step size (default: 3)
  --initialState [INITIALSTATE]
            initial state selection (default: 1011)
  --targetState [TARGETSTATE]
            target state selection (default: 0000)
  --solutionMethod {DP,Multistage,Strong2stage,Weak2stage}
            solution method selection (default: DP)
  --matrixSamplingSize MATRIXSAMPLINGSIZE
            matrix sampling size selection (default: 10000)
  --matrixType {epm,cpm}
            matrix type selection (default: cpm)
  --timeLimit TIMELIMIT
            time limit (seconds) for solvers (default: 3600)

Developed by O. Mesum, Assoc. Prof. B. Kocuk

The following code will find best antibiotic treatment plan starting from genotype 1110 to genotype 0001 in 6 steps using Strong2stage method. Solver is time limit is set to 1000 seconds and matrix sampling size is 1000 for both evaluator and optimizer. If successful within time limit it will plot the solution aswell.

bash python ABR.py --dataset msx255_SuppData2017_GRME_ABR.xlsx --initialState 1110 --n 6 --targetState 0000 --solutionMethod Strong2stage bash Matrix_useCase=optimization_type=cpm_s=10000 does not exist, generating from scratch. Matrix_useCase=evaluator_type=cpm_s=10000 does not exist, generating from scratch. Saved N6_1110-0000_Strong2stage_cpm_solution.xlsx under ..\data\solutions. Saved N6_1110-0000_Strong2stage_cpm_plot.png under ..\data\solutions. Results of each runs can be found under ..\data\solutions.

  • Prior to solving instances the matrix sampling part might take long. So to avoid this for further replicatons and experimentation sampled matrices are saved under ..\data\matrix_files.
| | Info | |:-------------------|:-------------| | OptVal | 0,649 | | EvaVal | 0,65 | | SolutionMethod | Strong2stage | | bbNode | 409 | | elapsedTime | 1,311 | | matrixSamplingSize | 10000 |

On left hand side we can see optimal antibiotic treatment plan. On right hand side there are descriptive statistics on problem instance and solver. - OptVal: Optimal objective value of the problem. - EvaVal: Evaluator objective value given optimal treatment plan. - SolutionMethod: Selected solution method for problem instance. - bbNode: Number of branch and bound node used in optimizer. - elapsedTime: Elapsed time for given problem instance. - matrixSamplingSize: Matrix sampling size defined in the experimentation.

.xlsx file under ..\data\solutions contains much more detailed statistics on problem instance. Under U_values sheet, you can find state probabilities at each timestep, and under solution you can find used antibiotics in solution.

Also notice node sizes and arc widths are different from each other. This is due to node and edges representing transition and state probabilities at each timestep.

bash python ABR.py --dataset msx255_SuppData2017_GRME_ABR.xlsx --initialState 1111 --n 5 --targetState 0000 --solutionMethod Multistage bash Returning Matrix_useCase=optimization_type=cpm_s=10000 from existing file. Returning Matrix_useCase=evaluator_type=cpm_s=10000 from existing file. Saved N5_1111-0000_DP_cpm_solution.xlsx under ..\Data\Solutions. Saved N5_1110-0000_DP_cpm_plot.png under ..\Data\Solutions.

| | Info | |:-------------------|:-------| | OptVal | 0,753 | | EvaVal | 0,754 | | SolutionMethod | Multistage | | bbNode | 1 | | elapsedTime | 1,769 | | matrixSamplingSize | 10000 |

If transition probabilities and state probabilities are less than pre-defined threshold (0.01), it will not show on plot.

Known Issues

  • The code may not work with versions of dependencies other than those specified in requirements.
  • There aren't input checks for most of the cases.
  • Strong2Stage, Multistage, Weak2stage requires Gurobi License.

License

The code in this repository is released under the MIT License.

Citing

If you use this code or the results from our paper in your own work, please cite our paper: sql @article{stoch-antibiotic, title={A stochastic programming approach to the antibiotics time machine problem}, author={Oğuz Mesüm, Ali Rana Atilgan, Burak Kocuk}, journal={Mathematical Biosciences}, volume={}, pages={}, year={2024} } `

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Stochastic Antibiotic
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Oguz
    family-names: Mesum
    email: oguzmesum@sabanciuniv.edu
    affiliation: Sabanci University
    orcid: 'https://orcid.org/0009-0009-3083-8174'
  - given-names: Burak
    family-names: Kocuk
    email: burakkocuk@sabanciuniv.edu
    affiliation: Sabanci University
    orcid: 'https://orcid.org/0000-0002-4218-1116'
identifiers:
  - type: doi
    value: 10.1016/j.mbs.2024.109191
    description: MBS Journal
repository-code: 'https://github.com/oguzmes/StochasticAntibiotic'
url: 'https://github.com/oguzmes/StochasticAntibiotic/README.md'
abstract: >-
  Antibiotics Time Machine is an important problem to
  understand antibiotic resistance and how it can be
  reversed. Mathematically, it can be modelled as follows:
  Consider a set of genotypes, each of which contain a set
  of mutated and unmutated genes. Suppose that a set of
  growth rate measurements of each genotype under a set of
  antibiotics are given. The transition probabilities of a
  ‘realization’ of a Markov chain associated with each arc
  under each antibiotic are computable via a predefined
  function given the growth rate realizations. The aim is to
  maximize the expected probability of reaching to the
  genotype with all unmutated genes given the initial
  genotype in a predetermined number of transitions,
  considering the following two sources of uncertainties:
  (i) the randomness in growth rates, (ii) the randomness in
  transition probabilities, which are functions of growth
  rates. We develop stochastic mixed-integer linear
  programming and dynamic programming approaches to solve
  static and dynamic versions of the Antibiotics Time
  Machine Problem under the aforementioned uncertainties. We
  adapt a Sample Average Approximation approach that
  exploits the special structure of the problem and provide
  accurate solutions that perform very well in an
  out-of-sample analysis.
keywords:
  - stochastic-optimization
  - markov-chain
  - optimization-algorithms
license: MIT
version: 1.0.0
date-released: '2023-02-04'

GitHub Events

Total
Last Year