Skip to main content

Tool for creating standard curves and concentration calculations.

Project description

CaliPytion - Tool to create, apply, and document calibration models for concentration calculation

Documentation Tests PyPI version

Overview

CaliPytion is a Python package for the creation, application, and documentation of calibration models for concentration calculations from a measured standard. This package allows for comparing different calibration models and selecting the best one based on various statistical metrics like R2, AIC, or RMSD. The selected model can then calculate the concentration of unknown samples from their measured signals. Furthermore, the calibration standard containing the calibration model and information on the used substance and measurement conditions can be exported in JSON and AnIML format for reuse and documentation.

Key Functionalities

  • 📈 Model Fitting and Visualization:
    Automatically fits different polynomial models to the data and provides interactive plots for visually comparing these models.
  • 🎯 Model Selection:
    After fitting, a model overview is generated, allowing the user to select the best model based on the desired metric.
  • 🚷 Avoid Extrapolation:
    It prevents the use of models outside the calibrated concentration range. However, by user choice, the model can be extrapolated to calculate concentrations outside the calibration range.
  • 🧪 Compatible with EnzymeML Documents:
    CaliPytion can be used to convert the measured signals of an EnzymeML document into concentrations.
  • 📂 FAIR Data:
    Calibration models are stored together with the standard data. Constituting a complete record of the calibration process, this data can be saved as a JSON or AnIML file.

Installation

CaliPytion can be installed via pip:

pip install calipytion # 🚧 not yet available

or directly from the source code:

pip install git+https://github.com/FAIRChemistry/CaliPytion.git

Minimal Example

from calipytion import Calibrator

# standard data
concentrations = [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5]
absorption = [0, 0.489, 1.056, 1.514, 1.988, 2.462, 2.878, 3.156]

# unknown data
unknowns = [0.3, 1, 1.345]

# initialize the calibrator
calibrator = Calibrator(
    molecule_id="s0",
    molecule_name="ABTS",
    conc_unit="mmol / l",
    concentrations=concentrations,
    signals=absorption,
)

# fit and visualize model
calibrator.fit_models()
calibrator.visualize()

# choose cubic model
cubic_model = calibrator.get_model("cubic")

# calculate concentrations
print(calibrator.calculate_concentrations(cubic_model, unknowns))
# -> [0.30018883573518623, 0.9823197194444907, 1.3193203297973393]

Model Overview

Model Name AIC R squared RMSD Equation Relative Parameter Standard Errors
cubic -56 0.9996 0.0205 a * s0 + b * s0**2 + c * s0**3 a: 4.6%, b: 67.4%, c: 33.6%
quadratic -49 0.9991 0.0318 a * s0 + b * s0**2 + c a: 4.0%, b: 20.0%, c: 115.2%
linear -37 0.9929 0.0891 a * s0 a: 1.7%

image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calipytion-1.0.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calipytion-1.0.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file calipytion-1.0.0.tar.gz.

File metadata

  • Download URL: calipytion-1.0.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for calipytion-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fa961f10610666575f4a84bf7f9d2b47f7a683c100fb7a239ff3ce3c0052495b
MD5 290ccbd2e99fd459a677418ade188080
BLAKE2b-256 b60a318e1ab48e858a2e5e5f4b457e4f06b6d6406890cdc207d7c7904612b9ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for calipytion-1.0.0.tar.gz:

Publisher: deploy_pypi.yaml on FAIRChemistry/CaliPytion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calipytion-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: calipytion-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for calipytion-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67b0377d09b2e3cede2abb6b39e35a3833edaf29de7643a56892e957fdfde4e1
MD5 0227c4ec4cba47e93262d8b8e7f1451b
BLAKE2b-256 b4b3917a587198216923f6239aa3b8aae39df800636e4c40046f2882ea5b4dbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for calipytion-1.0.0-py3-none-any.whl:

Publisher: deploy_pypi.yaml on FAIRChemistry/CaliPytion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page