In the CV section of the plumed documentation, you will find COORDINATION tool. It uses switching function to update the contact list between two groups within some cutoff.
You can utilise this tool during the MD run or after the run.
Before this you have to patch the plumed with gromacs.
To estimate protein-ligand contact frequency using GROMACS trajectory, you can follow these general steps:
Prepare the Trajectory and System Files: Ensure that you have a trajectory file (.xtc or .trr) and a corresponding coordinate file (.gro or .pdb) that contains the protein-ligand complex. Make sure you have the necessary topology files (.top) and parameter files (.mdp) required by GROMACS.
Define Contact Criteria: Determine the criteria for considering a contact between the protein and ligand. This could be based on a specific distance cutoff or other geometric criteria, such as the number of hydrogen bonds formed or the presence of specific interactions.
Use GROMACS Tools: Utilize GROMACS tools to analyze the trajectory and calculate the contact frequency. One commonly used tool is the "gmx distance or mindist" command, which calculates distances between atom pairs over the trajectory. For example, you can specify the protein and ligand atoms of interest and set a distance cutoff to identify the contacts.
Analyze the Output: Process the output generated by GROMACS tools to obtain the contact frequency. The output could be in the form of a text file or data that can be further analyzed using scripting or statistical software.
- This will help you to estimate the number of contacts between ligand and receptor. Then plot the .xvg file by excel or qtgrace or grace to see the frequency of the number of contacts.
If you want to select an atom of your receptor or specific atoms in your ligand you can use -seltype option. For your more information please see the following links:
The you may can calculate the frequency by contact_frequency = contact_frames / total_frames.
Alternatively, you may make index file as follow: gmx make_ndx -f .gro -o .ndx then use minimum distance command (gmx mindist) to calculate the number of close contants between your ligand and receptor in the .ndx file; gmx mindist -f trajectory.xtc -s .tpr -n .ndx -od mindist.xvg -pi -d 0.5