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
| Environment | Structural criterion | Estimate | Clamp | Confidence |
|---|---|---|---|---|
carboxylic_acid_oxygen | O-H attached to a carbon with a C=O | 4.5 - 2.0 q | −1…14 | 0.82 |
phenol_oxygen | O-H attached to an aromatic carbon | 10.0 - 1.5 q | 2…16 | 0.68 |
thiol_sulfur | S-H | 10.5 - 1.2 q | 2…16 | 0.64 |
ammonium_like | N+ with at least one N-H | 9.7 - 1.0 q | 4…14 | 0.62 |
pyridinium_like | N+ with an N-H and an aromatic bond | 5.2 - 1.0 q | 4…14 | 0.60 |
pyrrole_like_nitrogen | neutral aromatic N with an N-H | 16.0 - 1.2 q | 8…16.5 | 0.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
| Environment | Structural criterion | Estimate | Clamp | Confidence |
|---|---|---|---|---|
aliphatic_amine | neutral sp3 N, no aromatic bond | 10.8/10.4/9.8 - 2.5 q for 2/1/0 H | 2…14.5 | 0.75 |
aromatic_nitrogen | neutral aromatic N with no N-H | 5.2 - 1.8 q | −1…10 | 0.60 |
aniline_like | primary/secondary N attached to an aromatic carbon, not an amide | 4.6 - 2.0 q | 0…8 | 0.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.
| SMILES | Acidic site | Basic site |
|---|---|---|
CC(=O)O | 5.463 carboxylic_acid_oxygen | — |
c1ccccc1O | 10.762 phenol_oxygen | — |
CCS | 10.716 thiol_sulfur | — |
CCN | — | 11.627 aliphatic_amine |
c1ccncc1 | — | 5.677 aromatic_nitrogen |
c1cc[nH]c1 | 16.441 pyrrole_like_nitrogen | — |
c1cnc[nH]1 | 16.421 pyrrole_like_nitrogen | 5.642 aromatic_nitrogen |
Nc1ccccc1 | — | 5.397 aniline_like |
CC(=O)N | — | — |
CC(=O)Nc1ccccc1 | — | — |
[NH4+] | 10.069 ammonium_like | — |
c1cc[nH+]cc1 | 5.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
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);
}import sci_form
result = sci_form.compute_empirical_pka("c1cc[nH]c1")
print(result.acidic_sites[0].environment, result.acidic_sites[0].estimated_pka)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 (
ValueErrorin 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.