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
- ubuntu stonking: libchemistry-opensmiles-perl 0.12.4-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms