Placing the position restrained itp file of a ligand in protein-ligand topology file

I am setting up a protein-ligand simulation for trypsin-benzamidine system. I created the itp file of the ligand and a position-restraint itp file for ligand. Now I included the position-restraint itp file of the ligand inside the ligand itp file.

The ligand itp file containing the [atom], [bond] etc. is LIG.itp. so at the end of LIG.itp, I used:
#ifdef POSRES
#include “posre_lig.itp”

I see in some online tutorials that they suggest that in the actual topology file right after:
#include “LIG.itp”
I define #ifdef POSRES
#include “posre_lig.itp“

Now are’nt these two the same way of doing things? Can I use any one of these two procedures to define the ligand position restraints.

Hi @mjm91

Yes, in my understanding these are equivalent. The topology is read sequentially, and the important thing is that the [ position_restraints ] section follows up the topology that defines the molecule to which they refer. As such, whether they are read from the topology of the ligand or the one of the full system doesn’t matter.

Thank you for the clarification and explanation.