primaryodors / primarydock

PrimaryOdors.org molecular docker.
Other
6 stars 4 forks source link

Cinnamaldehyde grouping is producing a strange result. #344

Closed primaryodors closed 1 year ago

primaryodors commented 1 year ago
MOLECULE="cinnamaldehyde"; test/group_test_mol "sdf/$MOLECULE.sdf"

The above command produces the following output:

atom_group[ O1 C10 H17 H18 ]
atom_group[ C2 C3 C4 C5 C6 C7 C8 C9 H11 H12 H13 H14 H15 H16 ]
atom_group[ O1 ]

Shown here are the atoms contained in each group: image

Expected behavior:

  1. The aldehyde moiety consisting of atoms 1, 10, and 18 should be its own group;
  2. The benzene ring should be another group consisting of atoms 2, 3, 4, 5, 6, 8, 11, 12, 14, 15, 16;
  3. The unsaturated chain consisting of atoms 7, 9, 13, 17, should be in a group of its own;
  4. The fact that all of the heavy atoms are conjugated together should not prevent correct grouping or blur the lines between groups;
  5. As cinnamaldehyde has no ring member pnictogens or chalcogens, the rules that isolate h-bond atoms of e.g. pyrazines, indoles, and furans would not apply.

A good way to ensure item 4 would be to define a set of standard functional groups and apply pattern matching before the grouping algorithm executes. In this case the pattern matcher could identify the benzene ring and the aldehyde group, isolate those features into their own groups first, then apply the algorithm to the remaining atoms.