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.2

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.2
File Size Uploaded Provenance Actions
pyhte-0.1.2.tar.gz 46.7 kB Without provenance Details for pyhte-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 100.3 kB

Release files / pyhte-0.1.2.tar.gz

Download URL pyhte-0.1.2.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
31ab59cfa5f6955dfd85e9ac5727a1a65b9450b9b3d9be441b051fc52c8cedd8
BLAKE2b-256 checksum
How to use checksums
b9b021d02d8b4c430dc5d6dd6d486d22c15e46cd14a0cc4efd155e5a7476d9fc
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.2-py3-none-any.whl

Download URL pyhte-0.1.2-py3-none-any.whl
Size 53.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e27ac506997121f464fedeac91b8f1c754ac58d95d316380e781be190aa86c81
BLAKE2b-256 checksum
How to use checksums
76d812c96fecbf0738bf1eec0bad49f0bc73d6ebbca9301aed0e3eb63f0171f3
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.2

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