Post #1978205
2026-04-13 22:26 UTC
Replies (2)
-
@dalke@toots.nu 2026-04-14 07:12
@molecule Nice. 6! = 720 hence only 2 matches with a default max of 1,000. Looks like "d" is an RDKit extension for non-hydrogen degree. I didn't know about it. I've been toying with a new SMARTS extension: '#' ('-' | '=' | '#' | ':') = for n single (implicit and explicit), double, triple, or aromatic bonds Your pattern might then be written "[d6#-6]", since I don't think you need to match aromatic bonds. "Atom with at least one a double or triple bond" would be "[!#=0;!##0]".
-
@dalke@toots.nu 2026-04-15 14:32
@molecule With my modifications to the RDKit SMARTS matcher: >>> mol = Chem.MolFromSmiles("FS(F)(F)(F)(F)N(S(F)(F)(F)(F)(F))S(F)(F)(F)(F)(F)") >>> pat = Chem.MolFromSmarts("[$([d6](*)(*)(*)(*)(*)*)]") >>> print(len(mol.GetSubstructMatches(pat))) 2 >>> pat = Chem.MolFromSmarts("[d6#-6]") >>> print(len(mol.GetSubstructMatches(pat))) 3 >>>