Skip to main content

pKasso

Developed by Bind Research

Protonation state prediction for small molecules

pKasso determines protonation states for small molecules from SMILES strings or RDKit molecule objects. pKasso is open-source and free to use (MIT Licence).

Protonation microstates describe the unique charge patterns on protonable sites of molecules. The acid/base equilibria (micro-pKa values) of individual protonable sites are coupled, leading to a graph of free energy difference between protonation microstates. pKasso computes this graph based on micro-pKa predictions from MolGpKa (MIT) and optionally standard state free energies from Uni-pKa (Apache-2.0). pKasso then converts the results into pH-dependent absolute microstate probabilities and predicts net acid/base equilibria (macro-pKa values) of the molecule.

pKasso is under active development. Features, prediction models, and results may change in future releases.

Try it quickly with uvx

uvx pkasso --smiles 'CCCCNCCCN'

Local installation

Basic install (MolGpKa)

# Create conda environment
conda create -n pkasso python=3.12
conda activate pkasso

# Install pkasso from PyPI
pip install pkasso

Mixed mode (MolGpKa + Uni-pKa)

pKasso can be run with a mixed model based on MolGpKa and Uni-pKa. In that case, install pKasso[unipka].

The Uni-pKa models distributed with unipkainfer used for pKasso[unipka] were trained using data from:

Jonathan Zheng, & Lafontant-Joseph, O. (2026). IUPAC/Dissociation-Constants: v2.3d (Versions v2-3d) [Dataset]. Zenodo. https://doi.org/10.5281/zenodo.19112621 (CC BY-NC 4.0 Licence).

Commercial use of the model weights is not authorised without additional permission from the relevant rights holders. This includes the use of the pKasso(Uni-pKa) and pKasso(mixed) models.

# Create conda environment
conda create -n pkasso python=3.12
conda activate pkasso

# Install pkasso with Uni-pKa support from PyPI
pip install pkasso[unipka]

Mixed mode is more computationally demanding and profits from a GPU. It can run in CPU-only mode as well, albeit more slowly.

Local webserver

A local webserver can be installed via

pip install pkasso[webserver,unipka]

followed by calling pkasso-web or by downloading and running the docker image (main). Installing pkasso[webserver] without unipka does work as well but without 'Precision Mode' (mixed mode) functionality.

Run pKasso

The easiest way to run pKasso is via the webserver hosted by Bind Research.

Command line interface

The command line interface is called via pkasso.

  1. pkasso single: Calculate single pH-dependent microstate probabilities given a SMILES string
  2. pkasso batch: Batch process a .smi file to calculate pH-dependent microstates
  3. pkasso scan: Scan a pH range and plot the microstate distributions for all pH values (for a single molecule); calculate macro-pKa values.
pkasso --smiles 'CCCCNCCCN'
# equivalent to
# pkasso single --smiles 'CCCCNCCCN'

Get help for different pKasso options (single prediction, batch prediction, pH scan) with

pkasso --help
pkasso single --help
pkasso batch --help
pkasso scan --help

All commands accept --model molgpka (the default), --model unipka, or --model mixed. The mixed model combines MolGpKa with Uni-pKa. Uni-pKa and mixed mode also accept --gpu for GPU inference.

pkasso single --smiles "CC(=O)O" --model mixed
pkasso single --smiles "CC(=O)O" --model unipka --gpu

An additional argument --unipka-model-folder (defaults to ~/.local/share/unipkainfer/models) can be provided to define where the Uni-pKa model checkpoint should be stored. A missing checkpoint is downloaded on first use.

Python interface

from pkasso import protonate

name = 'mymolecule'
smiles = r'CCCCNCCCN'
pH = 7.0

# Include microstates with probability of 20% compared to most probable microstate
# Select cutoff_export = 1. to only output the most likely microstate
cutoff_export = 0.2

# protonate accepts a smiles string or an rdkit Mol as input
smiles_out, mols_out = protonate(smiles, name=name, pH=pH, cutoff_export=cutoff_export)
print(smiles_out)

Predictors and their options are selected with a dictionary:

model = {
    "molgpka": {},
    "unipka": {
        # "model_dir": "/path/to/unipka/models",
        "folds": (1,),
        "gpu": True,
    },
}
smiles_out, mols_out = protonate(smiles, model=model, pH=pH, nthreads=8)

(Ensure that molgpka is the first listed predictor in the dictionary.)

Five variants of Uni-pKa were trained (fold 0 to fold 4). The variants have similar accuracy. By default (including the CLI) fold 2 is used. The selected Uni-pKa model fold is downloaded from Hugging Face on first use and cached for later processes. All model checkpoints are cached in the user data directory. Uncomment the "model_dir" keyword to manually define the cache folder. We have extracted the basic Uni-pKa, Uni-Mol, and Uni-Core functions needed for pKasso(Uni-pKa) inference and split them off the main Uni-pKa and Uni-Core repositories to reduce installation size for pKasso(Uni-pKa). The resulting unipkainfer package, published on PyPI, is installed automatically if pKasso is installed with Uni-pKa support: pip install pkasso[unipka].

nthreads controls RDKit preprocessing, MolGpKa PyTorch inference, and Uni-pKa preprocessing.

For more examples, see the jupyter notebook.

We use heuristic rules to exclude and modify certain prediction results from MolGpKa and Uni-pKa. The full list of exclusions and modifications is in Table S1 in the preprint (to be published) or csv file for the full list.

Metadata

Release files for pkasso 0.6.5

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

Source distribution (sdist)

Source distribution for pkasso 0.6.5
File Size Uploaded Provenance Actions
pkasso-0.6.5.tar.gz 12.0 MB With provenance Details for pkasso-0.6.5.tar.gz

Built distribution (wheel)

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

Total release size: 23.9 MB

Release files / pkasso-0.6.5.tar.gz

Download URL pkasso-0.6.5.tar.gz
Size 12.0 MB
Tags Source
SHA-256 checksum
How to use checksums
bdfb084b4b3ae161a51e626bd50a5a5a4287f5d88a3b1bddf7a3fe46523cc8c2
BLAKE2b-256 checksum
How to use checksums
092c10b6939db01a069feeabfb5b39e7fbeb09c5404b4e80a3865d27ccf952f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / pkasso-0.6.5-py3-none-any.whl

Download URL pkasso-0.6.5-py3-none-any.whl
Size 12.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
34e4d627e4f668f0c3b261ed6ea71b941a1a65ed7a0a979901bae68e7029ccab
BLAKE2b-256 checksum
How to use checksums
dc7ac5b015f3e71551aded27b5c8d59aa49e898504b56405892f8be139d98816
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for pkasso 0.6.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pkasso-0.6.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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