biosimspace icon indicating copy to clipboard operation
biosimspace copied to clipboard

Support Membrane Protein pre-equilibration in Biosimspace via Gromacs

Open Roy-Haolin-Du opened this issue 8 months ago • 5 comments

Hi,

I hope this message finds you well😄. Sorry to trouble you.

We are supporting Membrane Protein in a3fe via Gromacs to do min, nvt, npt and equil. However, for membrane protein systems, special .mdp parameters are required.

Especially, the temperature coupling groups usually would be divided into different compenets.(e.g. protein/membrane/solvent separation). But in BSS,

protocol_dict["tc-grps"] = (
                "system"  # A single temperature group for the entire system.
            )

, which is as a single system. in https://github.com/OpenBioSim/biosimspace/blob/8ba863f612baee764c8b5935df9c40dbc2daef1e/python/BioSimSpace/Sandpit/Exscientia/Protocol/_config.py#L421

If I want to set tc_grps = SOLU MEMB SOLV, just kindly, is there a way in BSS to define separate temperature coupling groups?

In GROMACS, the default share/top/defselection.dat file includes predefined groups such as Protein, Non-Protein, Water, and Ion. Would it be appropriate to define the membrane group as something like Non-Protein and not Water_and_Ions?

Or, do we need pre-defined in our system by creating using gmx make_ndx and define in an index file?

I’d be sincerely grateful for any suggestions or comments you might have.

Thanks so much.

Best,

Roy

Roy-Haolin-Du avatar Jun 12 '25 15:06 Roy-Haolin-Du

Hi Roy, I'm not of the best approach. This isn't something that I've tried before. I'd suggest using the extra_options keyword argument to overload the default values and see if it works. For example, you could pass:

import BioSimSpace.Sandpit.Exscientia as BSS

process = BSS.Process.Gromacs(system, protocol, extra_options = {"tc_grps": "...", ...})

Note that once you add more groups then you'll need to overload other options accordingly, e.g. there will be a temperature and themostat time constant for each group, not just one.

Note that you are using the Recursion sandpit at present, so it's not easy to directly modify the code since we need to make sure that we don't break any of their internal functionality. If changes are needed, then I can work to make sure that they are consistent with their internal tooling.

Cheers.

lohedges avatar Jun 13 '25 10:06 lohedges

Thanks!

I was able to overwrite the .mdp parameters using extra_options method, and that worked very well!

However, I’m wondering is there a way to separate different groups? (as done with gmx make_ndx in GROMACS) within the BioSimSpace?

Thanks so much.

Cheers,

Roy

Roy-Haolin-Du avatar Jun 13 '25 10:06 Roy-Haolin-Du

No, there's nothing in BioSImSpace to create groups or index files. If you're using existing GROMACS groups then I'd suggest just writing your own wrapper to gmx make_ndx in a3fe, then writing the output to the working directory of the process used by BioSimSpace. For example. for non-Protein and not Water_and_Ions you could do something like:

{echo -e "11 &! 16" ; echo -e "q";} | gmx make_ndx -f gromacs.gro -o index.ndx

Here 11 and 16 refer to the non-Protein and Water_and_ions groups. You should be able to just do a pre-run of gmx make_ndx to get the group numbers if needed.

lohedges avatar Jun 13 '25 10:06 lohedges

Thanks Lester! And sorry for following up with one more question, please!

For temperature coupling groups (protein/membrane/solvent separation) in gmx.mdp file, tc-groups = SOLU MEMB SOLV. I can create a custom wrapper for gmx make_ndx in a3fe to generate membrane protein temperature coupling groups.

SOLU: Protein + Ligand MEMB: Membrane lipids (PA + PC + OL) SOLV: Solvent (ions + water)

However, the limitation discovered in BSS:

BioSimSpace's _gromacs.py's _generate_binary_run_file method lacks -n index.ndx support.

The gmx grompp command generated by BioSimSpace is: gmx grompp -f gromacs.mdp -po gromacs.out.mdp -c gromacs.gro -p gromacs.top -r gromacs_ref.gro -o gromacs.tpr from https://github.com/OpenBioSim/biosimspace/blob/baad60690aff9fc09da3a3a7edfdee11c74639b8/python/BioSimSpace/Sandpit/Exscientia/Process/_gromacs.py#L628-L647 which is seems does not support custom index files for these groups.(-n index.ndx) gmx grompp -f gromacs.mdp -po gromacs.out.mdp -c gromacs.gro -p gromacs.top -r gromacs_ref.gro -o gromacs.tpr -n index.ndx.

Would you be able to help me confirm this? If not, no worries! I’ve already thought of an alternative solution.

Thank you so much!

Cheers,

Roy

Roy-Haolin-Du avatar Jun 16 '25 16:06 Roy-Haolin-Du

No, we only call grompp with options required for the existing protocols, you'd need to wrap a different call to it within a3fe. In the non sandpit code there is a Proces.Gromacs._generate_binary_run_file() method that could be updated to allow additional command-line options at some point in the future.

lohedges avatar Jun 17 '25 08:06 lohedges