Post #1978201
2026-03-21 10:34 UTC
Replies (2)
-
@dalke@toots.nu 2026-03-21 10:36
To make it more fun, add more possible matches >>> pat = Chem.MolFromSmarts("[$([CX4](-*)(-*)-[CX4](-*)(-*)-[CX4](-*)(-*)-[CX4](-*)(-*)-[CX4](-*)-*)]") >>> print(len(mol.GetSubstructMatches(pat, maxMatches=25000))) 46 >>> print(len(mol.GetSubstructMatches(pat, maxMatches=30000))) 50
-
@molecule@mstdn.science 2026-04-13 22:26
@dalke here's another example where this affects the match count on even a relatively small molecule ``` 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))) ``` only 2 matches! (the N(SF5)3 molecule actually exists: https://doi.org/10.1016/j.molstruc.2016.05.089 )