Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crowsonkb/pharmacokinetics
A Flask web application to calculate and plot drug concentration over time.
https://github.com/crowsonkb/pharmacokinetics
flask-application pharmacokinetics
Last synced: 23 days ago
JSON representation
A Flask web application to calculate and plot drug concentration over time.
- Host: GitHub
- URL: https://github.com/crowsonkb/pharmacokinetics
- Owner: crowsonkb
- License: mit
- Created: 2018-12-07T18:20:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-01T11:57:01.000Z (almost 6 years ago)
- Last Synced: 2024-04-17T21:19:57.093Z (7 months ago)
- Topics: flask-application, pharmacokinetics
- Language: Python
- Homepage: https://kath.io/pk/
- Size: 231 KB
- Stars: 13
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pharmacokinetics
================A Flask web application to calculate and plot drug concentration over time. A standalone CLI interface is also included.
Example output
--------------Here, `pk` computes the concentration of a drug with a terminal half-life (t½) of 6 hours and a time to maximum concentration (tmax) of 2 hours. Doses of 10 mg each were given at t+0, t+4, and t+8 hours.
Installation
------------First, clone this repository:
```bash
git clone https://github.com/crowsonkb/pharmacokinetics
cd pharmacokinetics
```Create a new Python 3 virtual environment and activate it:
```bash
python3 -m venv venv
source venv/bin/activate
```Install the package and its dependencies:
```bash
python3 setup.py install
```This also installs the `pk` command line interface.
Run the web application:
```bash
flask run
```This will start a development server on port 5000.
CLI Usage
---------```
usage: pk [-h] --hl HOURS --tmax HOURS [--duration HOURS]
[--doses DOSE [DOSE ...]] [--offsets OFFSET [OFFSET ...]]
[--output FILE] [--output-size W H] [--dpi DPI]Calculates and plots drug concentration over time.
optional arguments:
-h, --help show this help message and exit
--hl HOURS the drug's elimination half-life, in hours (default:
None)
--tmax HOURS the drug's time to maximum concentration, in hours
(default: None)
--duration HOURS the duration, in hours, to simulate concentrations for
(default: 24)
--doses DOSE [DOSE ...]
the magnitudes of each dose (units are arbitrary)
(default: [1])
--offsets OFFSET [OFFSET ...]
the time, in hours, that each dose is given at
(default: [0])
--output FILE the output image filename (default: output.png)
--output-size W H the output width and height in pixels (default: [1920,
1280])
--dpi DPI the output dots per inch (dpi) (default: 160)
```