peppr.find_resonance_charges#

peppr.find_resonance_charges(mol: Mol) tuple[ndarray[tuple[Any, ...], dtype[bool]], ndarray[tuple[Any, ...], dtype[bool]], ndarray[tuple[Any, ...], dtype[int64]]][source]#

Find indices of positively and negatively charged atoms in the given molecule and its resonance structures.

Parameters:
molMol

The molecule to find the charged atoms in.

Returns:
pos_maskndarray, shape=(n,), dtype=bool

The mask of positively charged atoms.

neg_maskndarray, shape=(n,), dtype=bool

The mask of negatively charged atoms.

conjugated_groupsndarray, shape=(n,), dtype=int

The conjugated group for each atoms. Atoms from the same group are denoted by the same integer. This means that a single charge may appear multiple times in pos_mask or neg_mask, as the corresponding atoms are part of the same conjugated group.

Warning

RDKit’s ResonanceMolSupplier only shuffles existing formal charges through conjugated systems. It does not generate zwitterionic/charge-separated resonance forms from neutral species.