Chemistry::OpenSMILES::Aromaticity - Aromaticity handling
routines
Chemistry::OpenSMILES::Aromaticity encodes some aromaticity
handling subroutines for aromatisation and kekulisation. Both
implementations are experimental, handle only some specific cases and are
neither stable nor bug-free, thus should be used with caution.
- aromatise( $moiety
)
- Mark electron cycles as aromatic.
- kekulise( $moiety,
$order_sub )
- Find nonfused even-length aromatic cycles consisting only of B, C, N, P, S
and mark them with alternating single and double bonds. Subroutine as well
accepts an optional subroutine reference
$order_sub, providing external order for atoms.
This is needed to stabilise the algorithm, as otherwise the outcomes of
bond assignment may turn out different. $order_sub
is called with an atom as $_[0] and is expected to
return a value providing a distinct order indication for every atom. These
can be any scalar values, comparable using Perl's
"cmp" operator. If
$order_sub is not given, initial atom order in
input is consulted.
- electron_cycles(
$moiety )
- Find electron cycles according to "Finding Electron Cycles"
algorithm from
<https://depth-first.com/articles/2021/06/30/writing-aromatic-smiles/>.
Use with caution: the implementation is experimental.