molsysmt.physchem.get_aromaticity#
- molsysmt.physchem.get_aromaticity(molecular_system, selection='all', structure_indices='all', chemical_state='reference', method='fused_ring_electron_count', syntax='MolSysMT', skip_digestion=False)[source]#
Perceiving aromatic flags on a complete graph before filtering source indices.
- Parameters:
molecular_system (molecular system) – Any supported form supplying elements, complete covalent connectivity, formal charges, closed-shell radical counts and supported bond orders. Missing aromatic flags may be perceived; known contradictions fail.
selection (str, list, tuple or numpy.ndarray, default='all') – Atoms to return. Only bonds with both endpoints selected are included; perception uses the full chemical graph before selection.
structure_indices (int, list, tuple or numpy.ndarray, default='all') – Structure indices (0-based) for state resolution and spatial selection. Perception uses chemical evidence, without coordinates.
chemical_state (str or int, default='reference') – Selected chemical state; ‘structure’ must resolve unambiguously.
method (str, default='fused_ring_electron_count') – RDKit’s AROMATICITY_RDKIT model: environment-dependent electron contributions in rings and fused systems, evaluated against 4N+2. RDKit is an optional explicit implementation, not a fallback.
syntax (str, default='MolSysMT') – Syntax used to evaluate selection.
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- Returns:
Source atom_indices, bond_indices, bonded_atom_pairs and aligned bool atom_is_aromatic and bond_is_aromatic arrays. Empty arrays have shapes (0,) and (0, 2). Metadata records the full evaluated source, state, model, chemical evidence, references and original producer versions. No units apply to indices or flags. No chemical assignments are attached.
- Return type:
dict
- Raises:
ArgumentError – If a method, atom selection, structure index or state is invalid.
StructuralInconsistencyError – If required chemistry is missing, unsupported or contradictory, provider perception fails, or the provider changes the source atom/bond inventory.
Notes
This experimental route supports closed-shell H/B/C/N/O/F/Si/P/S/Cl/Se/Br/Te/I graphs. It rejects query/dummy atoms, metals, dative relationships, radicals and missing formal charges or bond orders. Valence interpretation can use declared/provider implicit H; it never adds indexed atoms or changes the stored hydrogen inventory. Known formal charges, radicals and aromatic flags must survive perception. A bond joining two aromatic atoms need not be aromatic. Ring planarity and atom names are not evidence. The provider model is defined in the RDKit Book; it is not a universal definition of chemical aromaticity. Numeric H5MSM queries read chemistry without coordinates. Rich spatial selections can load coordinates. Optional Ackredit failures preserve results.
See also
molsysmt.physchem.get_aromatic_ringsGet rings from stored aromatic flags.
molsysmt.topology.get_substructure_matchesMatch declared chemical graphs.
Examples
>>> import molsysmt as msm >>> from rdkit import Chem >>> result = msm.physchem.get_aromaticity(Chem.MolFromSmiles('c1ccccc1')) >>> result['atom_is_aromatic'].tolist() [True, True, True, True, True, True] >>> bool(result['bond_is_aromatic'].all()) True
User guide
See Getting aromaticity for model evidence and scope.
Added in version 1.0.0.