[chimerax-users] listing all-by-all atom distances
Elaine Meng
meng at cgl.ucsf.edu
Tue Jun 15 10:48:18 PDT 2021
> On Jun 15, 2021, at 9:33 AM, Juliana Glavina <jglavina at gmail.com> wrote:
>
> Hi Elaine,
> I am trying to calculate the distance between one residue and a set of residues (within a name selection). I couldn't do this in Chimera either and I couldn't find the answer online.
> Thanks!
> Juliana
Hi Juliana,
(We recommend using the chimerax-users address CC'd here for questions, so that the Q & A will be archived and searchable.)
One way to do it in ChimeraX is with the "contacts" command or Contacts tool. In this case you aren't necessarily using it to find contacts, but instead to measure and list atom-atom distances.
You say "residues" but really all the distances are measured from atom to atom. You will get all by all distances between two sets of atoms, where the first set is your first residue and the second set is all the residues in your named selection.
In ChimeraX, you can name the current selection or some other specification with the "name" command. To name the current selection "blah" it would be command:
name frozen blah sel
See "name" help:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html>
Then if you want to measure all atom-atom distances between (1) atoms in residue 55 of chain A of model 1 and (2) your named selection "blah" and show them in the Log, you could use a command something like
contacts #1/A:55 restrict blah overlap -1000 log true
The large negative overlap value is used to force measuring all the distances even if the atoms are 1000 Angstroms apart, instead of the usual behavior of finding only the contacts. The Log will have lines like the following, where the last column is the distance between atomic centers:
1728 contacts
atom1 atom2 overlap distance
/A BGC 310 C6 /A TYR 10 CE2 0.018 3.622
/A BGC 310 O6 /A HIS 152 NE2 -0.134 2.834
/A BGC 310 O4 /A TRP 183 CG -0.202 3.272
/A BGC 310 C3 /A TRP 183 CE3 -0.253 3.893
/A BGC 310 C2 /A PHE 16 CD1 -0.323 3.963
/A BGC 310 C5 /A HIS 152 NE2 -0.360 3.880
/A BGC 310 C6 /A HIS 152 NE2 -0.366 3.886
/A BGC 310 O4 /A TRP 183 CD2 -0.424 3.494
/A BGC 310 C5 /A TRP 183 CE2 -0.429 3.919
/A BGC 310 O6 /A HIS 152 CD2 -0.490 3.710
/A BGC 310 C3 /A TRP 183 CZ3 -0.495 4.135
/A BGC 310 O4 /A TRP 183 CD1 -0.499 3.719
/A BGC 310 O6 /A HIS 152 CE1 -0.556 3.776
/A BGC 310 C5 /A TRP 183 NE1 -0.596 4.116
[...]
The lines are in order of largest VDW overlap which is similar to shortest distance but not exactly the same. If you save to text file you can then sort by column, for example, by the second residue number to group those together, or by the distance.
The "contacts" command has a lot of options including saving results to text file, as detailed here:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html>
You can do the same thing in Chimera, name selection and use "findclash" but the exact commands and their syntax are slightly different.
I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco
More information about the ChimeraX-users
mailing list