Skip to main content

Osmo Recipe Solver

A Python package and command-line interface for calculating multi-solute solution osmolarity, predicting osmotic pressure, and reconciling target buffer recipes for laboratory research.

What It Does

pepkio-osmo-recipe-solver provides computational tools to determine theoretical osmolarity ($\text{mOsm/L}$), compute total ionic strength, assess solution tonicity, and reconcile solute concentrations in multi-component aqueous solutions.

Researchers can compute total osmolarity from molar solute inputs, evaluate tonicity relative to standard biological baselines (e.g., ~290 mOsm/L for mammalian physiological fluids), and automatically solve for the solute mass or concentration required to achieve a specific target osmolarity.

Features

  • Multi-Solute Osmolarity Calculation: Computes theoretical solution osmolarity ($\text{mOsm/L}$) across ionic salts, organic buffers, and non-electrolyte mixtures.
  • Stoichiometric Dissociation Accounting: Applies van 't Hoff dissociation factors ($\nu$) for electrolytes, polyvalent salts, and non-dissociating compounds.
  • Tonicity Classification: Evaluates effective tonicity and categorizes formulations as isotonic, hypotonic, or hypertonic against physiological reference standards.
  • Automated Recipe Reconciliation: Solves for the required adjusting solute concentration (e.g., $\text{NaCl}$, sucrose, or mannitol) to meet a specified target osmolarity.
  • Ionic Strength Computation: Calculates total ionic strength ($I$) to assist in buffer formulation for protein chemistry and enzyme kinetics.
  • Python API & CLI: Provides both a programmatic Python client and a command-line interface for integration into automated laboratory pipelines.

Installation

Install the package from PyPI using pip:

pip install pepkio-osmo-recipe-solver

Quick Example

from pepkio_osmo_recipe_solver import PepkioClient, OsmoSolverInput, SoluteInputRow

# Initialize client (reads PEPKIO_API_KEY environment variable if set)
client = PepkioClient(api_key="your_api_key")

# Define a standard 1X Phosphate-Buffered Saline (PBS) solution
pbs_input = OsmoSolverInput(
    tab="calculator",
    solutes=[
        SoluteInputRow(solute_id="nacl", concentration=137, unit="mM"),
        SoluteInputRow(solute_id="kcl", concentration=2.7, unit="mM"),
        SoluteInputRow(solute_id="na2hpo4", concentration=10, unit="mM"),
        SoluteInputRow(solute_id="kh2po4", concentration=1.8, unit="mM"),
    ]
)

# Compute osmolarity and tonicity
result = client.run(pbs_input)
calc = result.result["calculator"]

print(f"Total Osmolarity: {calc['total_osmolarity_mOsm_L']} mOsm/L")
print(f"Tonicity Classification: {calc['tonicity_label']}")

Typical Use Cases

  • Electrophysiology & Patch-Clamp: Formulating internal pipette solutions and external bath formulations (aCSF) to match physiological osmolarity targets (290–310 mOsm/kg).
  • Cell Culture & Organoid Media: Adjusting basal media and serum-free buffers to maintain cell membrane stability and prevent osmotic shock.
  • Cryopreservation Formulations: Computing multi-solute cryoprotectant mixtures containing DMSO, glycerol, or trehalose to minimize intracellular ice formation.
  • Protein Chemistry & Chromatography: Determining salt concentrations and ionic strength for ion-exchange and hydrophobic interaction chromatography buffers.
  • Plant Protoplast Isolation: Preparing hypertonic stabilization buffers with mannitol or sorbitol to maintain protoplast integrity.

Scientific Background

Theoretical osmolarity for a solution containing $N$ distinct solutes is calculated as:

$$\text{Osmolarity (mOsm/L)} = \sum_{i=1}^{N} \nu_i \cdot C_i \times 1000$$

where $\nu_i$ is the stoichiometric dissociation factor (van 't Hoff number) and $C_i$ is the solute molar concentration ($\text{mol/L}$).

Key physical concepts include:

  • Osmotic Pressure ($\Pi$): Calculated via the van 't Hoff relation $\Pi = \text{Osmolarity} \cdot R \cdot T$, where $R$ is the ideal gas constant and $T$ is absolute temperature.
  • Ionic Strength ($I$): Defined as $I = \frac{1}{2} \sum c_i z_i^2$, reflecting the total electrostatic field produced by dissolved ions.
  • Osmolarity vs. Osmolality: Osmolarity measures solute osmoles per liter of final solution ($\text{mOsm/L}$), whereas osmolality measures osmoles per kilogram of solvent ($\text{mOsm/kg H}_2\text{O}$). In dilute room-temperature aqueous solutions, the numerical values are nearly identical.

Web Application

For researchers who prefer a graphical interface, an interactive web version is available.

Web Application: https://www.pepkio.com/tools/osmo-recipe-solver

Web-only features include interactive visual buffer design, live tonicity scale visualization, shareable recipe permalinks, and printable laboratory bench protocols and worksheets.

Documentation and Resources

GitHub Repository: https://github.com/pepkio/pepkio-osmo-recipe-solver

Web Application: https://www.pepkio.com/tools/osmo-recipe-solver

Source code, issue tracking, and developer updates are maintained on GitHub.

About Pepkio

Pepkio (https://www.pepkio.com/) develops software tools and bioinformatics solutions for life science researchers, including laboratory calculators and analysis services (https://www.pepkio.com/cro).

Keywords

  • pepkio-osmo-recipe-solver, osmo-recipe-solver, osmolarity calculator, osmolality calculator, buffer recipe solver, tonicity calculator, ionic strength calculator, osmotic pressure, van t Hoff factor, dissociation constant, cell culture buffer, electrophysiology aCSF, patch clamp pipette solution, cryopreservation buffer, PBS osmolarity, NaCl dissociation, protoplast isolation buffer, mannitol osmolarity, solution preparation, stock solution dilution, molarity to osmolarity, isotonic solution, hypertonic buffer, hypotonic solution, lab buffer calculator
  • how to calculate osmolarity of multi solute solution, how to calculate osmolality from molar concentration, how to adjust buffer tonicity for cell culture, electrophysiology internal solution osmolarity recipe, how to prepare 1X PBS buffer osmolarity, difference between osmolarity and osmolality in biology, how does van t Hoff factor affect osmolarity, calculating ionic strength of buffer solution, osmotic pressure formula van t Hoff equation, how to make isotonic solution for mammalian cells, cryoprotectant osmolarity calculation trehalose sucrose, protoplast osmotic stabilization mannitol sorbitol, how to solve buffer recipe target osmolarity, Python library for buffer osmolarity calculations, CLI tool for lab solution preparation

Metadata

Release files for pepkio-osmo-recipe-solver 0.1.0

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

Source distribution (sdist)

Source distribution for pepkio-osmo-recipe-solver 0.1.0
File Size Uploaded Provenance
pepkio_osmo_recipe_solver-0.1.0.tar.gz 36.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pepkio-osmo-recipe-solver 0.1.0
File Interpreter ABI Platform
pepkio_osmo_recipe_solver-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.9 kB

Release files / pepkio_osmo_recipe_solver-0.1.0.tar.gz

Download URL pepkio_osmo_recipe_solver-0.1.0.tar.gz
Size 36.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f0c4f86c45c03e4747f70e60954ba05029909e28d10df18cf382c249e4ebb9b4
BLAKE2b-256 checksum
How to use checksums
745a424425e0d5bc7197527a3e308247f3742bfdefe3c5beb4d1889c97821c8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pepkio_osmo_recipe_solver-0.1.0-py3-none-any.whl

Download URL pepkio_osmo_recipe_solver-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6c3d959a28918f64dc183d6db1c59f5a7d7b842129f8b9eb2ef4ab069470e5d
BLAKE2b-256 checksum
How to use checksums
3112cad8a5dccc284bbf3ec0a62bea5ff29632b5b5fc127b6e6640eb5b79949c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pepkio-osmo-recipe-solver 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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