proteneer / timemachine

Differentiate all the things!
Other
138 stars 17 forks source link

Refactor chiral restraint setup to avoid repeated work #1360

Closed mcwitt closed 2 months ago

mcwitt commented 2 months ago

The chiral validity MCS filter added in #1356 is prohibitively slow in some important edge cases where the MCS search visits a large number of chirally-invalid leaf nodes before finding a valid one, because each invocation of the leaf filter is expensive.

One opportunity for improvement is to remove some of the substantial redundant work that is done when setting up chiral restraints for the hybrid mol in the leaf filter. Much of the expensive work is independent of the dummy group assignment, and can be precomputed outside of the MCS search.

This PR refactors bond and chiral restraint setup to reduce the time for a single execution of the chiral validity filter from 200-300 ms down to ~10 ms.

Summary of changes