Skip to main content

ReSim: chemoREsistance SIMulator

ReSim (chemoREsistance SIMulator) is a python package that simulates cancer chemoresistance dynamics based on a stochastic model. The model describes the interaction between chemotherapeutics and various cancer cell subpopulations (including sensitive, primary resistant, acquired resistant and quiescent cancer cells).

ReSim provides both GUI (powered by Flask <http://flask.pocoo.org>) and CUI.

Remarks: Simulation result is greatly depended on input params, therefore ReSim is intended to use in parallel with in vitro assay. Procedures or details in identifying input params in vitro is out of scope here and will be documented in elsewhere (hope to get it publish soon).

Dependencies

  • flask

  • Flask-WTF

  • numpy

  • scipy

  • pandas

  • matplotlib

  • seaborn

  • plotly

  • sdeint

Installation

We strongly recommend everyone to install resim within a virtual environment. Setup the venv as usual and run

$ pip install resim

Otherwise, install it locally.

Getting Start - GUI

Open your command prompt, simply run

$ resim-flask

ReSim is now available at http://localhost:5000/resim .

Note GUI provides a simplified & handy version of resim with interactive plotly plots. Please use CUI if you need more control of input params.

Advanced Usage

Using defaults params (calibrated from the case of sorafenib and liver cancer):

>>> import resim

>>> model = resim.Simulator()
>>> res = model.simulate()

>>> snsplt_cells = resim.plot_cells(res, subplot=True)
>>> snsplt_drug = resim.plot_drug(res)
>>> snsplt_fht = resim.plot_fht(res)

>>> snsplt_cells.figure.savefig('resim_cells.png')
>>> snsplt_drug.figure.savefig('resim_drug.png')
>>> snsplt_fht.figure.savefig('resim_fht.png')

You may set your own params. For examples, input the growth rate of sensitive cells and resistant cells determined in vitro:

>>> import resim

>>> model = resim.Simulator(gr=[0.2, 0.1, 0.1])
>>> res = model.simulate()

model.simulate() returns a dict of dictionary containing pd.DataFrame or np.array. To extract the result,:

>>>  df_cells = res['case']['cells']
>>>  df_drugs = res['case']['drugs']

>>> l_fht_control = res['control']['fht'])
>>> l_fht_treatment = res['case']['fht'])

Notes GUI outputs are generated by Plotly <https://plot.ly/>. But both plot_cells, plot_drug and plot_fht in CUI return seaborn <https://seaborn.pydata.org/> plot object. You may customize your own theme, title, layout.

Documentation

Available at https://resim.readthedocs.io/.

TODO

  • Add class methods for conventional first-line/second-line chemos in HCC, PC.

  • Add tool for converting tumor’s diameter/volume to number of cells.

  • Add tool for converting doubling time to growth rate.

  • Add tool for converting half-life to k.

  • Add command line module.

  • Integrate parallel programming sde solver module nsim <https://github.com/mattja/nsim> to speed up the computation.

Release files for resim 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resim 0.1.1
File Size Uploaded
resim-0.1.1.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for resim 0.1.1
File Interpreter ABI Platform
resim-0.1.1-py2-none-any.whl Python 2 none any Details

Total release size: 39.1 kB

Release files / resim-0.1.1.tar.gz

Download URL resim-0.1.1.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
64578f652b8fb74482c38e1caf0f2a01c20f6e3530dcc5493fc5f70e5a4576d1
BLAKE2b-256 checksum
How to use checksums
b371263f4fecee4f3dd2d55839f949b1b914687963c57aa8879b7f00cb8aa3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / resim-0.1.1-py2-none-any.whl

Download URL resim-0.1.1-py2-none-any.whl
Size 22.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
e36c679d1e0d6cf4ec2ddf9695eb3d59b14ef71a3255c2800f70406fda5f0a19
BLAKE2b-256 checksum
How to use checksums
7ab07254f4116d49ff649ccc468de28f1f753716c2ee09bd3d3b471d26023159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page