bond_count#
- skfp.descriptors.bond_count(mol: Mol, bond_type: str | None = None) int #
Bond count.
Counts the total number of bonds. If a specific bond type is specified, returns count of only that type.
- Parameters:
mol (RDKit
Mol
object) – The molecule for which the bond count is to be calculated.bond_type (str, optional) – If
None
, returns the total number of bonds. Otherwise, the valid options are RDKit bond types [1], e.g. “SINGLE”, “DOUBLE”, “TRIPLE”, “AROMATIC”.
References
Examples
>>> from rdkit.Chem import MolFromSmiles >>> from skfp.descriptors import bond_count >>> mol = MolFromSmiles("C1=CC=CC=C1") # Benzene >>> bond_count(mol) 6 >>> bond_count(mol, "AROMATIC") 6 >>> bond_count(mol, "DOUBLE") 0