Skip to content

Empirical pKa sites ​

compute_empirical_pka is a fast 2D screen for acidic and basic sites. It does not solve the electronic structure and it does not replace the thermodynamic cycle in redox potentials and pKa. The output is a ranked list of graph environments with coarse pKa estimates.

Status. Available on the Rust, Python and WASM surfaces. It has no dedicated CLI command.

Pipeline ​

flowchart LR
    A[SMILES] --> B[Parse molecular graph]
    B --> C[Gasteiger charges]
    C --> D{Acidic environment?}
    D -- yes --> E[Acidic site + pKa]
    D -- no --> F{Basic environment?}
    F -- yes --> G[Basic site + pKa]
    F -- no --> H[No site]
    E --> I[Sort acidic ascending]
    G --> J[Sort basic descending]
    I --> K[EmpiricalPkaResult]
    J --> K

Each atom is tested once against the acidic rules and once against the basic rules. A molecule can therefore return one acidic and one basic site on different atoms, as imidazole does.

Rules ​

q is the Gasteiger charge of the site atom. Every estimate is clamped to a physically plausible window; the confidence is a fixed rule weight, not a calibrated error bar.

Acidic sites ​

EnvironmentStructural criterionEstimateClampConfidence
carboxylic_acid_oxygenO-H attached to a carbon with a C=O4.5 - 2.0 q−1…140.82
phenol_oxygenO-H attached to an aromatic carbon10.0 - 1.5 q2…160.68
thiol_sulfurS-H10.5 - 1.2 q2…160.64
ammonium_likeN+ with at least one N-H9.7 - 1.0 q4…140.62
pyridinium_likeN+ with an N-H and an aromatic bond5.2 - 1.0 q4…140.60
pyrrole_like_nitrogenneutral aromatic N with an N-H16.0 - 1.2 q8…16.50.55

A quaternary ammonium (C[N+](C)(C)C) and a nitro nitrogen (O=[N+]([O-])c1ccccc1) have no N-H; they are not reported as acids.

Basic sites ​

EnvironmentStructural criterionEstimateClampConfidence
aliphatic_amineneutral sp3 N, no aromatic bond10.8/10.4/9.8 - 2.5 q for 2/1/0 H2…14.50.75
aromatic_nitrogenneutral aromatic N with no N-H5.2 - 1.8 q−1…100.60
aniline_likeprimary/secondary N attached to an aromatic carbon, not an amide4.6 - 2.0 q0…80.55

Pyrrole/indole N-H is an acid, not a base. Pyridine and the pyridine-like nitrogen of imidazole are bases. Amide nitrogen is excluded from the aniline_like rule, including aryl amides such as acetanilide. Tertiary anilines are not covered yet.

Measured examples ​

These values were produced by the Python binding from the parsed graph and Gasteiger charges; the same payload is returned by Rust and WASM.

SMILESAcidic siteBasic site
CC(=O)O5.463 carboxylic_acid_oxygen—
c1ccccc1O10.762 phenol_oxygen—
CCS10.716 thiol_sulfur—
CCN—11.627 aliphatic_amine
c1ccncc1—5.677 aromatic_nitrogen
c1cc[nH]c116.441 pyrrole_like_nitrogen—
c1cnc[nH]116.421 pyrrole_like_nitrogen5.642 aromatic_nitrogen
Nc1ccccc1—5.397 aniline_like
CC(=O)N——
CC(=O)Nc1ccccc1——
[NH4+]10.069 ammonium_like—
c1cc[nH+]cc15.418 pyridinium_like—
C[N+](C)(C)C——
O=[N+]([O-])c1ccccc1——
C——

The last rows are the regression cases for false positives: a quaternary ammonium and a nitro group must not produce an acidic site, and methane has no ionizable site.

API ​

rust
let result = sci_form::compute_empirical_pka("c1cc[nH]c1")?;
for site in &result.acidic_sites {
    println!("{} {:?} pKa={:.2}", site.environment, site.atom_index, site.estimated_pka);
}
python
import sci_form

result = sci_form.compute_empirical_pka("c1cc[nH]c1")
print(result.acidic_sites[0].environment, result.acidic_sites[0].estimated_pka)
typescript
import { compute_empirical_pka } from 'sci-form-wasm';

const result = JSON.parse(compute_empirical_pka('c1cc[nH]c1'));
console.log(result.acidic_sites[0].environment, result.acidic_sites[0].estimated_pka);

Python also keeps the deprecated alias empirical_pka. The result fields are acidic_sites, basic_sites and notes; each site has atom_index, site_type, environment, estimated_pka and confidence.

Validation and limits ​

  • Invalid or empty SMILES are rejected (ValueError in Python, {"error": ...} in WASM).
  • Acidic sites are sorted by increasing pKa; basic sites by decreasing pKa.
  • The estimate depends on Gasteiger charges, so a different charge model would change the numbers.
  • There is no solvent, pH or temperature dependence. The values are suitable for ranking related molecules, not for absolute prediction.
  • Carboxylate (CC(=O)[O-]) has no O-H and therefore no acidic site; pass the neutral acid form when screening.
  • The rules cover common C/N/O/S environments only. They do not enumerate tautomers, protonation states, phosphorus/boron acids or tertiary anilines.
  • For quantitative work use the explicit acid/conjugate-base cycle in redox potentials and pKa, which reports its method, solvation convention and conformer spread.

Released under the MIT License.