Residues within cutoff distance

GROMACS version: 2021.2
GROMACS modification: No

Hello esteemed colleagues,

I have a ligand A, and I would like to find all the residues of molecule B within 0.5 nm of A (based on the pairwise inter-atomic distances between the two selections) of each frame of the MD simulation.

Could anyone please suggest the gmx command most relevant for this particular task? It would be more suitable to get only the residues numbers at each frame of the simulation, but it would be fine to obtain the individual atom numbers also.

Thanks a lot for your assistance.

HI Peter,
did you try to use gmx select ( https://manual.gromacs.org/documentation/current/onlinehelp/gmx-select.html) . Here you find more on the syntax https://manual.gromacs.org/current/onlinehelp/selections.html?highlight=selection
The tool can provide an dynamics index (for each frame of your trajcetory) based on the expression that you provide (all the residues of molecule B within 0.5 nm of A) .
\Alessandra

1 Like

Hello Alessandra,

Thank you very much for the prompt reply. I tried implementing your suggestion, but gmx select is unable to parse my atom selections. These work for VMD but are producing errors in this case. Please find the command I used below for reference.

gmx select -s prod_5.tpr -f prod.trr -select resname ALA ARG ASN ASP CYS GLU GLN GLY HIS ILE LEU LYS MET PHE PRO SER THR TRP TYR VAL and same residue as within 0.5 of resname LIG and resid 318 -oi output.dat -pdbatoms selected -ofpdb output.pdb > output.log

Please find the relevant error message generated below:

Error in user input:
Invalid command-line options
    In command-line option -select
        Invalid selection 'resname'
            Near 'resname'
                syntax error
    In command-line option -select
        Invalid selection 'and'
            Near 'and'
                syntax error
    In command-line option -select
        Invalid selection 'same'
            While parsing 'same'
                'same' should be followed by a single keyword
    In command-line option -select
        Invalid selection 'residue'
            Near 'residue'
                syntax error
    In command-line option -select
        Invalid selection 'within'
            While parsing 'within'
                'within' should be followed by a value/expression
                'of' is missing
    In command-line option -select
        Invalid selection '0.5'
            Near '0.5'
                syntax error
    In command-line option -select
        Invalid selection 'resname'
            Near 'resname'
                syntax error
    In command-line option -select
        Invalid selection 'and'
            Near 'and'
                syntax error
    In command-line option -select
        Invalid selection 'resid'
            Near 'resid'
                syntax error

Thank you
Peter

Hi,
you can try to put the selection between ’ ’
e.i.
gmx select -s md.tpr -f md.xtc -select 'resname ALA ARG and same residue as within 0.5 of resname ALA
\Alessandra

1 Like

Thank you very much for the crucial hint. The command works now! Only a few minor issues remain from the point of data analysis.

Is it possible to get just the residue numbers instead of the individual atom numbers with -oi output.dat -on output.ndx?

Also, -ofpdb output.pdb generates output for only the first frame I think. Hence, would it be feasible to instruct the command to write output for the individual frames too?

Please let me know your opinion regarding these issues.

Thanks and regards
Peter

Hi,

You can use -selrpos and/or -seltype to select residue in place of atoms (see sythax in the link above).

Have a look at the gmx trajectory https://manual.gromacs.org/current/onlinehelp/gmx-trajectory.html

\Alessandra

Thanks a lot!

The following command was able to selectively output just the residue numbers of interest at each trajectory frame:

gmx select -s prod_5.tpr -f prod.trr -select 'resname ALA ARG ASN ASP CYS GLU GLN GLY HIS ILE LEU LYS MET PHE PRO SER THR TRP TYR VAL and same residue as within 0.5 of resname LIG and resid 318' -seltype res_com -oi output.dat > output.log

Unfortunately, the capability to generate PDB files from dynamic user-defined selections seems to be not available in GROMACS. Whereas gmx trajectory is able to output the coordinates of the provided selection, it does so to an XVG file. The output there is difficult to decipher, as it is in the form of a space-separated string of xyz coordinates. Whereas gmx traj can generate a PDB file, but it does not have the ability to accept selections as such. A similar issue has been mentioned in a previous forum earlier.

However, obtaining the residue numbers instead of the corresponding atom numbers is sufficient for the analysis at the moment. Thank you very much for your assistance.