choderalab / feflow

Recipes and protocols for molecular free energy calculations using the openmmtools/perses and Open Free Energy toolkits
MIT License
10 stars 1 forks source link

Miscellaneous HTF improvements #29

Open ijpulidos opened 4 months ago

ijpulidos commented 4 months ago

From discussions with D. Rufa, there are some things that can be improved or simplified in our current implementation of the HybridTopologyFactory.

I'm creating this issue to document some of the conclusions from this dicussion and to store them in a way that we can use as a reference in the future.

Some of the comments/improvements of the constructor are:

    def __init__(self,
                 old_system, old_positions, old_topology,
                 new_system, new_positions, new_topology,
                 old_to_new_atom_map, old_to_new_core_atom_map,
                 use_dispersion_correction=False,  # This should be a specific repexHTF that has this built in as True -- this is only helpful for repex
                 softcore_alpha=0.5,
                 softcore_LJ_v2=True,  # remove it. If we want to use a different implementation we should subclass this -- if we need to change it
                 softcore_LJ_v2_alpha=0.85,
                 interpolate_old_and_new_14s=False,  # this is a good candidate for subclassing -- shouldn't be a kwarg
                 flatten_torsions=False,
                 rmsd_restraint=False,  # This will become required at some point -- stability issues -- check perses
                 **kwargs):

Some comments that are relevant to understand why we need some variables, as follows,

# aux list stores the torsions that we already computed such that we don't add them again when checking the new system
        auxiliary_custom_torsion_force = []
        # aludel/valence.py -- convenient way of handling all the valence terms for alchemistry
        old_custom_torsions_to_standard = []

There are simplified ways of getting the positions form the hybrid topology

    # TODO: the get positions could be simplified like alude/atm.py get_hybrid_positions.py
    def old_positions(self, hybrid_positions):
ijpulidos commented 4 months ago

Note that some of the proposed refactor would require having a specific object/class for REPEX compared to other protocols (say for example NEQCycling)