bio-curve-fit
A Python package for fitting common dose-response and standard curve models. Designed to follow the scikit-learn api.
Quickstart
Installation
pip install bio-curve-fit
We recommend using python virtual environments to manage your python packages in an isolated environment. Example:
python -m venv venvname
source venvname/bin/activate
Example usage:
from bio_curve_fit.logistic import FourParamLogistic
# Instantiate model
model = FourParamLogistic()
# create some example data
standard_concentrations = [1, 2, 3, 4, 5]
standard_responses = [0.5, 0.55, 0.9, 1.25, 1.55]
# fit the model
model.fit(
standard_concentrations,
standard_responses,
)
# interpolate the response for new concentrations
model.predict([1.5, 2.5])
# interpolate the concentration for new responses
model.predict_inverse([0.1, 1.0])
Calculate and plot the curve and limits of detection:
plot_standard_curve(standard_concentrations, standard_responses, model, show_plot=True)
You can also customize the plot arbitrarily using matplotlib. For example, adding labels to the points:
from adjustText import adjust_text
fig, ax = plot_standard_curve_figure(standard_concentrations, standard_responses, model)
texts = []
for x, y in zip(standard_concentrations, standard_responses):
texts.append(ax.text(x, y, f"x={x:.2f}, y={y:.2f})", fontsize=13, ha="right"))
# Adjust text labels to avoid overlap
adjust_text(texts, ax=ax)
Examples
See the example notebooks for more detailed usage.
Contributing
Contributions are welcome! We built this package to be useful for our own work, but we know there is more to add. Please see CONTRIBUTING.md for more information.
Release files for bio-curve-fit 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bio_curve_fit-1.1.2.tar.gz | 797.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bio_curve_fit-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 811.6 kB
Release files / bio_curve_fit-1.1.2.tar.gz
| Download URL | bio_curve_fit-1.1.2.tar.gz |
|---|---|
| Size | 797.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88e0311c10a7d4389464e5413765d24a1ed9b03ffae3541c5f15801da606dd38
|
|
BLAKE2b-256 checksum How to use checksums |
dca7c83a02b0ac3183042f21242e2a4a3a4e94b155c422fee74d510fa34e9da6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bio_curve_fit-1.1.2-py3-none-any.whl
| Download URL | bio_curve_fit-1.1.2-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
901de258cfcdca40178b4732e16dc2750a069834a7f9136560766a71d95c5af1
|
|
BLAKE2b-256 checksum How to use checksums |
600f4c680e9b47f59fd8e49a4d8c9017be84096bda79a20a6c5799b90d343b4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|