Metadata-Version: 2.4
Name: py50
Version: 1.2.0
Summary: Generate Dose-Response Curves
Author: Tony Eight Lin
Author-email: Tony Eight Lin <tonyelin@tmu.edu.tw>
License-Expression: GPL-3.0-only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pandas>=1.5.0
Requires-Dist: numpy>=1.26.4
Requires-Dist: matplotlib>=3.8.1
Requires-Dist: scipy>=1.11.3
Requires-Dist: seaborn>=0.12.2
Requires-Dist: scikit-posthocs>=0.7.0
Requires-Dist: pingouin>=0.6.1
Requires-Dist: statannotations>=0.6.0
Requires-Dist: fastmcp>=4.0.0 ; extra == 'mcp'
Requires-Dist: tabulate>=0.9.0 ; extra == 'mcp'
Requires-Python: >=3.10
Project-URL: Repository, https://github.com/tlint101/py50.git
Project-URL: Documentation, https://py50.readthedocs.io/en/latest/
Provides-Extra: mcp
Description-Content-Type: text/markdown

![py50_full.png](img/py50_full.png)

# py50: Generate Dose-Response Curves

[![py50](https://img.shields.io/pypi/v/py50.svg?label=py50&style=flat)](https://pypi.org/project/py50/)
[![Python Versions](https://img.shields.io/badge/python-3.10+-blue.svg?logo=python&logoColor=white)](https://pypi.org/project/py50/)
[![Streamlit](https://img.shields.io/badge/Streamlit-1.34.0-FF4B4B.svg?style=flat&logo=Streamlit&logoColor=white)](https://py50-app.streamlit.app)
[![DOI](https://zenodo.org/badge/716929963.svg)](https://zenodo.org/doi/10.5281/zenodo.10183912)
[![Documentation Status](https://readthedocs.org/projects/py50/badge/?version=latest)](https://py50.readthedocs.io/en/latest/?badge=latest)

## Summary

The aim of py50 is to make the generation of dose-response curves and annotated plots with statistics. The project was
created primarily for my personal use and for my coworkers/classmates. I found many of my classmates/coworkers were
using a program that I find to be unfriendly in generating dose-response curves or with calculating statistics and
plots. During my search, I found other helpful repositories that can generate dose-response curves, calculate
statistics, or make annotated plots. However, I found that these packages did not meet my requirements:

1. Use Pandas for the Data so that it can be easily plugged into a Jupyter Notebook or Python scripts
2. Adaptable to user needs
3. Easy to use (hopefully!)

The dose-response curves in py50 are built using the four parameter logistic regression model:

$`Y = \text{Min} + \frac{\text{Max} - \text{Min}}{1 + \left(\frac{X}{\text{IC50}}\right)^{\text{Hill coefficient}}}`$

where min is the minimum response value, max is the maximum response value, Y is the response values of the curves, and 
X is the concentration.

The statistics and annotated plots are wrapped from [Pingouin](https://github.com/raphaelvallat/pingouin)
and [Statannotations](https://github.com/trevismd/statannotations).
This may have been done inelegantly and will be updated based on my use or recommendations by others. As things stand, 
this project meets my needs and the needs of my classmates/coworkers.
Hopefully it can meet the needs of others.

## Installation

```
pip install py50
```

pacakge can be upgraded specifically using pip with the following:

```
pip install py50 -U
```

## Tutorial

Documentation can be found [here](https://py50.readthedocs.io/en/latest/).

A Jupyter Notebook demoing the code can be found [here](https://github.com/tlint101/py50/tree/main/tutorials).

A blog post demoing the code can be found at [Practice in Code](https://tlint101.github.io/practice-in-code/)

# Web Application [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://py50-app.streamlit.app)

For those who are not versed in python coding, py50 has been converted into a web application using Streamlit!

The web application can be found here: [py50-app](https://py50-app.streamlit.app)

The repository for the Streamlit app version can be found
here: [py50-streamlit](https://github.com/tlint101/py50-streamlit)

**NOTE:** Updates to the web application take more time. Updates will be made when possible or upon request.

# MCP

py50 ships an MCP server that exposes its dose-response calculations and plots to
an MCP-compatible client — Claude Desktop, or a local LLM through a runner such as
Jan or LM Studio.

To get started, install py50 with the MCP dependencies:

```bash
pip install 'py50[mcp]'
```

This adds a `py50-mcp` executable to your environment. The MCP can then be set up as follows:


```json
{
  "mcpServers": {
    "py50": {
      "command": "/absolute/path/to/env/bin/py50-mcp"
    }
  }
}
```

Test installation by running `which py50-mcp` in the activated environment.


## Citation

If you are interested in citing the repository, the BibTeX reference is as follows:
```aiignore
@software{lin_2024_14523624,
  author       = {Lin, Tony Eight},
  title        = {py50: Generate Dose-Response Curves},
  month        = dec,
  year         = 2024,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.10183912},
  url          = {https://doi.org/10.5281/zenodo.10183912},
}
```
All versions can be linked to the Zenodo repository here: [![DOI](https://zenodo.org/badge/716929963.svg)](https://zenodo.org/doi/10.5281/zenodo.10183912)

Thanks for your interest! 
