COSMolKit Tools
Loading browser workspace
Back to tools
COSMolKit 0.2.12 / Rust / WASMMolecular properties calculator
Calculate commonly used molecular descriptors from SMILES locally in your browser.
CANONICAL STRUCTURE
CC(=O)Oc1ccccc1C(=O)OFormulaC9H8O4
Molecular weight180.159
g/molExact mass180.04226
DaHeavy atoms13
atomsH-bond donors1
HBDH-bond acceptors3
HBATopological polar surface area63.60
A²Rotatable bonds2
strictCrippen logP1.310
logPFormal charge0
eCalculate molecular properties from SMILES
COSMolKit parses the SMILES and calculates molecular formula, average molecular weight, monoisotopic exact mass, heavy atom count, hydrogen-bond donors and acceptors, TPSA, strict rotatable bonds, Crippen logP, and total formal charge without uploading the molecule.
PYTHON BACKEND
COSMolKit Python 0.2.12Calculate the same descriptors in Python
The Python package exposes the same COSMolKit descriptor implementations used by this browser tool.
molecular_properties.py
from cosmolkit import (
Molecule, calc_crippen_descriptors, calc_exact_mol_wt,
calc_mol_formula, calc_mol_wt, calc_num_hba, calc_num_hbd,
calc_num_rotatable_bonds, calc_tpsa,
)
mol = Molecule.from_smiles("CCO")
logp, _ = calc_crippen_descriptors(mol)
properties = {
"formula": calc_mol_formula(mol),
"molecular_weight": calc_mol_wt(mol),
"exact_mass": calc_exact_mol_wt(mol),
"heavy_atoms": sum(a.atomic_num() != 1 for a in mol.atoms()),
"hbd": calc_num_hbd(mol),
"hba": calc_num_hba(mol),
"tpsa": calc_tpsa(mol),
"rotatable_bonds": calc_num_rotatable_bonds(mol, mode="strict"),
"logp": logp,
"formal_charge": sum(a.formal_charge() for a in mol.atoms()),
}
print(properties)COSMolKit Tools
Loading browser workspace