I want to calculate distance between the atom om of DNA and atom of ligand

GROMACS version:
GROMACS modification: Yes/No
Here post your question For this i use the command
gmx make_ndx -f md_0_150.gro -o dist.ndx
and make a index file for the atoms of my choice
Available static index groups:
Group 0 “r_6_&O1P" (1 atoms)
Group 1 "r_14
&O4’" (1 atoms)
Group 2 “r_13” (32 atoms)
Group 3 "r_13
&H3" (1 atoms)
Group 4 "r_12
&H42" (1 atoms)
Group 5 "r_5
&O1P" (1 atoms)
Group 6 “r_17” (59 atoms)
Group 7 "r_17
&H" (1 atoms)
Group 8 "r_17
&H" (1 atoms)
Group 9 "r_17
&H5" (1 atoms)
Group 10 "r_17
&O1" (1 atoms)
Group 11 "r_17
&_C18” (1 atoms)
Specify any number of selections for option ‘select’
(Position pairs to calculate distances for):
(one per line, for status/groups, ‘help’ for help, Ctrl-D to end)

0
Selection ‘0’ parsed
7
Selection ‘7’ parsed
Inconsistency in user input:
Selection ‘r_6_&_O1P’ does not evaluate into an even number of positions
(there are 1 positions)

and trying to calculate the distance between two atoms with command
gmx distance -f md_0_150.xtc -s md_0_150.tpr -n dist.ndx -oav dis.xvg -dt 100
but either it gives error when i use 2 atoms or it gives the distance of only one atom when i use single atom.
please tell me the correct method.

Hi,
you can use gmx mindist if you want to calculate the distance between 2 atoms belonging to two groups (each group = one atom), like group 0 and 7 in the index group above.
To use gmx distance you need to provide a group containing pairs of atoms
I hope it helps
Alessandra