[gmx-users] Calculate and print ALL distances between atoms A and B from structure file (i.e. not over time), with detailed information

Justin Lemkul jalemkul at vt.edu
Mon Aug 27 18:50:32 CEST 2018

On 8/27/18 9:37 AM, Javier Luque Di Salvo wrote:
> Dear users,
> I am trying to calculate ALL distances between two types of atoms, say atom
> A and atom B. The system is a polymer composed of 20 linear chains. Each
> chain has 1 (one) atom A that can form a crosslink with some atom B of an
> adjacent, near chain. Thus, in order to generate such crosslinks
> (self-crosslinks are not necessarily excluded), I run NVT and NPT
> simulations to compress the linear chains and bringing them together. At
> some point, when the chains are closer, I need to analyze distances A-B
> that fall within a certain cutoff, in order to decide if a bond can be
> formed and added following the specbonds.dat topology directives.
> I tried with mindist, distance, pairdist, but I was not able to generate an
> output that specifies all the distances among a given atom A and all atoms
> B. This output should contain either the atom number/ chain/ residue of
> each atom involved in the distance calculation. Atom type B is present on
> each linear chain 15 times; if no cutoff is specified, the output should
> contain (15x20) distances for each A atom; i.e. 15x20x20 distances.
> Currently I can identify only the minimum distance between atom A and B,
> but I am a bit lost in how to generate the more detailed output as
> described above. Any guidance is appreciated.

gmx distance -oall with two selections (all atoms A and all atoms B) 
should give you what you want, or if you're only interested in a given 
polymer's atom A and all other B, you can select those groups, as well.



Justin A. Lemkul, Ph.D.
Assistant Professor
Virginia Tech Department of Biochemistry

303 Engel Hall
340 West Campus Dr.
Blacksburg, VA 24061

jalemkul at vt.edu | (540) 231-3129


More information about the gromacs.org_gmx-users mailing list