Elektrine lite

← Feed

@dalke@toots.nu

Post #1978207

2026-04-15 14:29 UTC

@molecule .... and here's a diff which adds that to RDKit. (Incomplete. Doesn't do the full function registration or handle MolToSmarts or have tests.) https://paste.sr.ht/~dalke/e3748ccea2bf3b58c04abd8fa9aaebb57953ce13 With it, something like [!$(*#*)&!D1] can be replaced with [##0!D1], and make HasSubstructMatch twice as fast. BTW, my has-a-double-or-triple-bond SMARTS should be "[!#=0,!##0]" (with "," not ";"). :) To go further than this POC and add it to RDKit would require evidence of of utility that I can't provide.

Replies (1)

  • @dalke@toots.nu 2026-04-16 17:45

    @molecule EState atom typing is 30% faster with the new SMARTS extension. old time: 15.32 (EState atom typing with recursive SMARTS) new time: 10.59 (EState atom typing with my new notation) other time: 18.38 (Python startup/overhead and parse time) Nicer to read too, for orbital configuration patterns. Compare: [PX3#-3H2] [PX3#-3H1] [PX3#-3H0] [PX4#-3#=1H0] vs [PX3H2]-[!#1] [PX3H1](-[!#1])-[!#1] [PX3H0](-*)(-*)-* [PX4H0](=*)(-*)(-*)-*

    Open ##1978208