OpenFreeEnergy / feflow

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

Refactor setup unit to work with protein mutation protocol #77

Open IAlibay opened 2 months ago

IAlibay commented 2 months ago

Currently this will only work for small molecules.

ijpulidos commented 1 week ago

Some thoughts after going through the SetupUnit code. We should probably rename this issue accordingly, more in terms of refactoring the SetupUnit to work for different protocols.

Ideally we would benefit from having reusable units and components in the protocols that can be shared between protocols that have some kind of similarity. It should be possible for the protein mutation protocol to share the setup unit with the current nonequilibrium cycling protocol. This involves a set of changes, from a first look at the code:

ijpulidos commented 1 week ago

After discussion with @IAlibay , some things are clearer now.

* Related to the previous issue. Infer alchemical components from mapping. I believe it should be possible to get the alchemical components from the mapping objects, without having to know if we want to transform a specific type of component, I think the mapping already has that information.

This was done this way to support the absolute FE protocol, which wouldn't have mappings at all. We should use the readily available get_alchemical_components from the openfe system creation module.

* I think we need a way to somehow map between resids in topology with components, such that it is easy to extract resids from alchemical components and/or mappings.

This was an oversight on my part, we already have that from the comp_resids dictionary in the current setup unit.