MobleyLab / chemper

Repository for Chemical Perception Sampling Tools
MIT License
19 stars 10 forks source link

Fix bug relating to how symmetry around valence terms is addressed #59

Closed bannanc closed 5 years ago

bannanc commented 5 years ago

I found another bug while testing chemper with smirnoff99Frosst:

In smirnoff99Frosst, there is a SMIRKS pattern for a proper torsion: [#1:1]-[#6X4:2]-[#6X4:3]-[#8X2:4] which corresponds to H-C-C-O. When I tried to make SMIRKS for proper torsions, the cluster for this parameter lead to this SMIRKS:

 [#1X1x0H0,#8X2H1x0,#8r4X2x2H0,#8X2r5x2H0,#8r6X2x2H0,#8X2x2r7H0,#8X2x2H0r8,#8X2x2r9H0;+0;A:1]
 [#6r4H1,#6r5H1,#6r6H1,#6r7H1,#6r8H1,#6r9H1,#6r5H2,#6r6H2,#6r7H2,#6r8H2,#6H2r9;+0;A;X4;x2:2]
     [#1X1H0,#8X2H1;+0;A;x0]
     [#1X1x0H0,#6r4x2H1X4,#6r5x2H1X4,#6r6x2H1X4,#6x2r7H1X4,#6r8x2H1X4,#6r4x2H2X4,#6x2r5H2X4,#6r6x2H2X4,#6r7x2H2X4,#6r8x2H2X4,#6x2H2r9X4,#8X2H1x0,#8r4X2x2H0,#8X2r5x2H0,#8r6X2x2H0,#8X2x2r7H0,#8X2x2H0r8,#8X2x2r9H0;+0;A]
 [#6r4H1,#6r5H1,#6r6H1,#6r7H1,#6r8H1,#6r4H2,#6r5H2,#6r6H2,#6r7H2,#6r8H2,#6H2r9;+0;A;X4;x2:3]
     [#1X1H0,#8X2H1;+0;A;x0]
 [#1X1x0H0,#8X2H1x0,#8r4X2x2H0,#8X2r5x2H0,#8X2x2r7H0,#8X2x2H0r8;+0;A:4]

I know this SMIRKS is difficult to read, so I printed to the atom SMARTS hierarchically since the bonds aren't as important. What you can see is the unindented lines is that atom 1 and atom4 can be a hydrogen or an oxygen.

This is because of the way symmetry is determined in proper torsions. Currently my pairing only lets you use one atom and one bond for each pair. In this case I used the pairs:

However, a better way to handle this would be to use groups which consider the inner and outer bonds:

This will require some potential reorganization in my code to make comparisons more general.

bannanc commented 5 years ago

This has been fixed in PR #60 and can be closed when that is merged.

bannanc commented 5 years ago

This was fixed by PR #60