Skip to main content

PyHTE

A python package for high-throughput experiments and laboratory automation.

Features

  • Compositions of solvent volumes and solute amounts, with mixed solvents and dissolved solids
  • Labware: containers and plates with capacities and dead volumes
  • Plans that are simulated before dispensing, and designs that create them, e.g. titrations
  • Devices: protocols for the UK Robotics D2 dispenser, measurements from the JASCO V-750 spectrophotometer
  • Records of what was actually dispensed, and the state derived from them
  • Storage of plates, plans, runs and measurements in an SQLite (or other SQL) database

Installation

python3 -m pip install pyhte

The package is published as pyhte and imported as hte.

Optional RDKit support (molecule objects on substances):

python3 -m pip install "pyhte[chem]"

Development tools (including pytest, ruff and pyright, and sphinx) from a clone of the local package:

python3 -m pip install -e .[chem] --group dev

Usage

Volumes are given in L, amounts in mol, concentrations in mol/L, masses in g and molar masses in g/mol. The factors in hte.units convert from and to these base units: multiply to enter a value (250*uL), divide to read one (state[well].volume/uL).

Containers and plates describe the labware only. What they contain is a LabState: an immutable snapshot that maps containers to their Composition. A Plan starts from an initial state and never modifies it; plan.simulate() derives the final state and checks every transfer on the way.

from hte import Composition, Container, LabState, Plate, PlateType, Substance, TitrationDesign, TitrationSeries
from hte.units import mL, mM

water, dmso = Substance("water"), Substance("DMSO")
analyte, titrant = Substance("analyte"), Substance("titrant")

analyte_stock = Container(capacity=10*mL, label="analyte")
titrant_stock = Container(capacity=10*mL, label="titrant")
solvent = Container(capacity=50*mL, label="solvent")
plate = Plate.create(PlateType.well_24())

initial = LabState.create(
    {
        analyte_stock: Composition.solution(dmso, 5*mL, {analyte: 10*mM}),
        titrant_stock: Composition.solution(water, 5*mL, {titrant: 20*mM}),
        solvent: Composition.solution(water, 30*mL),
    },
    plates=[plate],  # registers the (empty) wells
)
design = TitrationDesign(
    series=TitrationSeries(
        analyte_concentration=[1*mM] * plate.size,
        titrant_concentration=[i * 4*mM / (plate.size - 1) for i in range(plate.size)],
    ),
    analyte=analyte_stock,
    titrant=titrant_stock,
    solvent=solvent,
    volume=1*mL,
    plate=plate,
)

plan = design.create_plan(initial)
final = plan.simulate()  # raises at the first transfer that is not possible

well = plate["B3"]
print(final[well].concentration(titrant)/mM)  # 1.391...
print(final[well].solvent_fractions)  # 10 % DMSO, 90 % water
print(initial[well].is_empty)  # True: the initial state is unchanged

The documentation covers dispensing with the D2, recording runs, importing measurements from the V-750 and saving to a database; see the tutorial for a complete walk-through.

Invalid input and violated domain rules raise hte.exceptions.ValidationError, a subclass of both HTEError and ValueError.

Metadata

Release files for pyhte 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 pyhte 0.1.0
File Size Uploaded Provenance Actions
pyhte-0.1.0.tar.gz 46.6 kB Without provenance Details for pyhte-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyhte 0.1.0
File Interpreter ABI Platform Actions
pyhte-0.1.0-py3-none-any.whl Python 3 none any Details for pyhte-0.1.0-py3-none-any.whl

Total release size: 100.2 kB

Release files / pyhte-0.1.0.tar.gz

Download URL pyhte-0.1.0.tar.gz
Size 46.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c9abc775d2d5623f5c371c677fe32fa273eb4825979e642011224bcea37eaa06
BLAKE2b-256 checksum
How to use checksums
30ad5a777c2a551ddeb3648dce86c92bb3ea9a52339d6d8b2e8479b97b689689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pyhte-0.1.0-py3-none-any.whl
Size 53.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77d26ba15d49924dbe150391bce39122b2492e82599fbf0c1b3fbef0c2822279
BLAKE2b-256 checksum
How to use checksums
778892ba619a69dc5dd42a460e9140d9ccd770f30cd0f8a2fd3e1e44ab7f6bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for pyhte 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.

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