Chemis...ticity(3pm)

✨ NAME ✨

Chemistry::OpenSMILES::Aromaticity β€” the aromaticity handling routines bestie, living in the Chemistry::OpenSMILES family πŸ’–


🌸 DESCRIPTION 🌸

Okay so Chemistry::OpenSMILES::Aromaticity is the module that encodes a couple of aromaticity handling subroutines β€” specifically for aromatisation and kekulisation πŸ‘‘βœ¨

But listen, real talk: both of these implementations are experimental. They only handle some specific cases, and they are neither stable nor bug-free, so please please please use them with caution πŸ«ΆπŸ’…

⚠️ Not a drill, bestie β€” experimental means experimental. Handle with care! πŸŽ€

πŸ’œ METHODS πŸ’œ

πŸ’– aromatise( $moiety )

Mark electron cycles as aromatic. That's the whole vibe ✨

πŸ’– 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 πŸ§šβ™€οΈπŸ”₯

This subroutine also accepts an optional subroutine reference $order_sub, which provides an external order for atoms. This is needed to stabilise the algorithm β€” because otherwise the outcomes of bond assignment may turn out different 😭 (no cap, the vibes get inconsistent).

How $order_sub works: it's 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, the initial atom order in the input is consulted instead. Default behaviour found, we love that for us πŸ’…

πŸ’– electron_cycles( $moiety )

Find electron cycles according to the "Finding Electron Cycles" algorithm from https://depth-first.com/articles/2021/06/30/writing-aromatic-smiles/ 🌈

⚠️ Use with caution: the implementation is experimental. I said what I said πŸ’€

That's the whole page, bestie! Sending you off with the receipts: this one's from the User Contributed Perl Documentation, riding along with perl v5.40.1, dated 2026-06-19 πŸŽ€βœ¨ Slay, and remember β€” experimental code is a vibe, not a guarantee πŸ¦‹πŸ’–

πŸ“¦ where this page comes from