-
Notifications
You must be signed in to change notification settings - Fork 35
[ WIP ] Membrane support #1561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[ WIP ] Membrane support #1561
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1561 +/- ##
==========================================
- Coverage 95.39% 93.23% -2.17%
==========================================
Files 189 189
Lines 16646 16922 +276
==========================================
- Hits 15880 15777 -103
- Misses 766 1145 +379
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…y/openfe into membrane_prototype
…y/openfe into membrane_prototype
…y/openfe into membrane_prototype
…y/openfe into membrane_prototype
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
IAlibay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some quick things for now.
|
|
||
| # If there is an SolvatedPDBComponent, we set the solv_comp | ||
| # in the complex to None, as it is only used in the solvent leg | ||
| if isinstance(prot_comp, SolvatedPDBComponent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just return that component? That way we can still assert that solv_comp == None means that there is no solvent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm not quite following you what you mean here. As we are returning the SolvatedPDBComponent in the prot_comp, are you suggesting to also return it in the solv_comp , in addition or instead of the "normal" SolventComponent? In the membrane case you would currently have both, the SolvatedPDBComponent and the SolventComponent in the ChemicalSystem, one for the complex and one for the solvent.
| barostat_frequency: TimestepQuantity = 25.0 * unit.timestep | ||
| """ | ||
| Frequency at which volume scaling changes should be attempted. | ||
| Note: The barostat frequency is ignored for gas-phase simulations. | ||
| Default 25 * unit.timestep. | ||
| """ | ||
| surface_tension: Optional[SurfaceTensionQuantity] = 0 * unit.bar * unit.nanometer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a validator that this shouldn't be non-zero if you aren't using a MonteCarloBarostat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a validator ensuring the surface_tension is not None when the MonteCarloMembraneBarostat is present. Should there also be a validator to check that the surface_tension is either None or zero when the MonteCarloBarostat is present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that would be useful - at least users should know that value doesn't do anything in that case.
| solv_comps = state.get_components_of_type(SolventComponent) | ||
| base_solv_comps = state.get_components_of_type(BaseSolventComponent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do the second one and then do an isinstance check later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I attempted a rewrite of this function, however I'm not sure if this is more clear. The challenge is that the ChemicalSystems for these membrane systems are a bit confusing since they will have the SolvatedPDBComponent for the complex leg and a SolventComponent for the solvent leg.
So I think what we're currently supporting is:
- Vacuum (no BaseSolventComponent)
- One SolventComponent
- One SolventComponent paired with one SolvatedPDBComponent
Or would we want to support more scenarios at the moment?
| raise ValueError(errmsg) | ||
|
|
||
| if solv_comps[0].smiles != "O": | ||
| if len(solv_comps) == 1 and solv_comps[0].smiles != "O": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the isinstance check here.
| errmsg = "nocutoff cannot be used for solvent transformations" | ||
| raise ValueError(errmsg) | ||
|
|
||
| if len(solv_comps) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We either should error out if we have more than one solvated PDB component too, or we need to change this so that you have the isinstance check that covers the below test too and then a separate check that if it's a solvated PDB component the box vectors have to be the same across all the PDBs.
For now we only allow for one protein component, so maybe just enforce that here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we're already enforcing that in the validate_protein, since the SolvatedPDBComponent is also a ProteinComponent it should error out in that check as well. Or do you think we should doublecheck that here as well?
This means of course that we're currently not supporting the presence of one "normal" ProteinComponent and one SolvatedPDBComponent at the same time.
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
|
gather tests are failing as we will need to update result files on zenodo with the updated settings objects once we're settled on those. |
|
🚨 API breaking changes detected! 🚨 |
Checklist
newsentryDevelopers certificate of origin