Skip to content

Conversation

@ijpulidos
Copy link
Contributor

These changes aim to add support to be able to perform protein mutations in the current SetupUnit that the NonEquilibriumCyclingProtocol uses.

This mostly implies making sure that the alchemical component is now not assumed to be a SmallMoleculeComponent but also a ProteinComponent.

Utility functions for achieving such purpose were written or modified accordingly. Someof these changes were needed to be made on the openfe side of things, since we have not yet decided on migrating them to feflow (this code base).

@ijpulidos ijpulidos marked this pull request as draft January 30, 2025 18:03
@ijpulidos ijpulidos linked an issue Jan 30, 2025 that may be closed by this pull request
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things but otherwise lgtm.

- gufe ~=1.7.1
- numpy
- openfe >=0.15 # TODO: Remove once we don't depend on openfe
- openfe ~=1.7.0 # TODO: Remove once we don't depend on openfe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're at 1.8 now, but that might be better bumped in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I need to change it here since I'm also bumping the python version. Hopefully it would "just work". THanks for the heads up.

@@ -0,0 +1,49 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the idea of a tutorial, but I would recommend just bumping it to a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already worked on a tutorial, lives in https://github.com/OpenFreeEnergy/feflow/blob/protein-mutation-setup/docs/tutorials/protein-mutations-neq.ipynb

I guess we could consider moving it to the OpenFE Example Notebooks instead in the future.


class ProteinMutationProtocol(Protocol):
pass
ProteinMutationProtocol = NonEquilibriumCyclingProtocol
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still todo to remove?

return topology


def get_positions_from_component(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can limit it to ExplicitComponents, that way SolventComps don't have it.

ValueError
If the atom index is not found in the topology.
"""
for residue in topology.residues():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely would remove if it's not doing anything.

Comment on lines 148 to 150
solvent_comp_a = (
solvent_comps.pop() if solvent_comps else None
) # there must be at most one solvent comp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're already volidating it to be a single component, do you need to go thought this? I.e. could you not just make solvents_comp_a == solvent_comps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true, I will validate in the _validate method of the protocol, and improve the logic here. The only caveat is that some utility functions expect the component itself, some other expect a list of components (because they are meant to be used for non-solvent components as well), but that shouldn't be an issue. Maybe something we want to change in the future, for all "utils" to have the same typing signature?

integrator_settings=integrator_settings,
cache=ffcache,
has_solvent=solvent_comp is not None,
has_solvent=bool(solvent_comp_a),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] As far as I know, PEP8 does prefer var is not None over bool(var)

elif alchemical_settings.softcore_LJ.lower() == "beutler":
softcore_LJ_v2 = False
# TODO: We need to test HTF for protein mutation cases, probably.
# What are ways to quickly check an HTF is correct?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean in terms of testing the hyrid system? Easiest way is to check if the endstates match the energy of the non-alchemical systems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good suggestion, I think I'll bump that to a future PR, but sounds like something we could do. Issue raised in #134

@ijpulidos ijpulidos changed the title [DNM] Protein mutation support in Neq Cycling Setup Unit Protein mutation support in Neq Cycling Setup Unit Dec 19, 2025
@ijpulidos ijpulidos merged commit 570ec7c into protein-mutation-protocol Dec 19, 2025
6 checks passed
@ijpulidos ijpulidos deleted the protein-mutation-setup branch December 19, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor setup unit to work with protein mutation protocol

4 participants