openforcefield / openff-interchange

A project (and object) for storing, manipulating, and converting molecular mechanics data.
https://docs.openforcefield.org/projects/interchange
MIT License
69 stars 22 forks source link

Add support for using customised packmol input file #729

Open taidbui opened 1 year ago

taidbui commented 1 year ago

Description Please describe the behavior you would like added to Interchange.

Dear Dev team,

Currently, the packmol features within Interchange or Evaluator enable the solvation and random placement of molecules within a box. While this functionality is undoubtedly valuable, there are scenarios where it becomes necessary to construct initial configurations in a more specific and controlled manner. For instance, tasks such as creating bilayers, droplets, or vesical shapes call for a customized arrangement of molecules, which is not adequately supported by the existing capabilities.

Hence, I would like to propose the inclusion of a feature that allows users to utilize a customized packmol input file instead of solely relying on the one generated through pack_box. By granting this flexibility, users would gain the ability to precisely define the desired configuration, catering to a broader range of scientific and engineering needs. This may also help Interchange to be even a more indispensable tool for the MM community.

Thank you for considering my suggestion.

Sincerely,

Tai Bui

mattwthompson commented 1 year ago

Could you give an example of the sorts of things you'd want to do with a custom input script? The objective with the wrappers you've found is to cover a few common use cases well; packing a box of mixed solvents or a protein in water with ions covers well over 90% of the use cases that are of interest to the scientists within OpenFF today. PACKMOL offers a ton of features, so more involved use cases I'm tempted to suggest users should write their own functions based on the existing ones.

@Yoshanuikabundi has some opinions on this topic, I think, but he might be on vacation now.

taidbui commented 1 year ago

Hi @mattwthompson,

Thanks for getting back to me. Please find below some example systems where they should be constructed in a specific way, hopefully you find this helpful. There are more types of systems which I believe haven't been mentioned here.

  1. Protein-Ligand Complexes: When studying the interaction between proteins and small molecules (ligands), the ligands are typically docked into the binding site of the protein. The initial configuration is carefully designed based on structural information or computational docking algorithms.

  2. Lipid Bilayers: Lipid bilayers, which mimic cell membranes, are commonly used in molecular simulations. The lipids are arranged in a specific manner to form a bilayer structure, typically by placing lipid molecules in opposing layers with appropriate orientations and packing.

  3. Nanoparticles: Simulating the behavior of nanoparticles often involves designing their initial configuration based on experimental or theoretical insights. The nanoparticles can be positioned relative to each other or with respect to other components, such as solvent or biomolecules.

  4. Crystal Structures: Simulations involving crystalline materials (including liquid crystals) typically start with the atomic positions obtained from experimental crystallography data or predicted from computational methods. These initial structures preserve the long-range ordering of atoms in the crystal lattice.

  5. Self-Assembled Structures: Some systems exhibit self-assembly behavior, where specific arrangements of molecules can spontaneously form. In these cases, the initial configuration may involve placing seed molecules or enforcing certain spatial constraints to guide the self-assembly process.

jacob-votava commented 2 months ago

I am looking at a system where I would like to arrange mesogens in a specific way in an attempt to seed self-assembly. This could be my ignorance of interchange/topology's capabilities, but currently I have to convert my output file into something packmol/other programs can read and then use the force field parameters it generates. I'm a new student, and I just discovered openFF--but this feature be an excellent addition to an already great software package and would massively improve the flexibility of openFF for my purposes.

mattwthompson commented 2 months ago

Welcome @jacob-votava -

There are a few ways to go about doing this; in general for complex preparation I'd recommend preparing something like PDB file externally and load it up with the toolkit into a Topology object ^1. This ensures that the right molecular descriptions (in the right order, with the right number of copies, probably with the correct metadata, and with coordinates) are loaded up. Once everything is in a Topology, you can proceed along the workflow like normal ^2; ForceField.create_interchange or something similar and then exporting to OpenMM/GROMACS/Amber/LAMMPS

Interchange's PACKMOL wrapper is meant to handle simpler systems and not cover all of its functionality; it's just not feasible to cover all possible combinations provided by such a powerful tool

If there's more you're after, please post some code describing what you're trying to do and where you're getting stuck

jacob-votava commented 2 months ago

Wow! Thanks for the response. This is great information to get me started. I'm very excited by this software and will be introducing it to the rest of my lab. I appreciate your help!