Possible to measure the shortest distance between two models?

Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias

Hi Matthias, The "contacts" or "clashes" command gives all-by-all distances (and VDW overlaps) between two sets of atoms. You can write all the info to a file or to a log. It does not automatically only give you the shortest distance, but it sorts the output so that the shortest is first. For example (these structures are nonphysically on top of each other, but work for illustrating the commands): open 1zik open 1gcn contacts #1 restrict #2 distanceOnly 5 log true ...shows in the log all the pairwise distances between the two sets of atoms that are within 5 angstroms, with the shortest distance first. See measurements: <https://rbvi.ucsf.edu/chimerax/docs/user/measurements.html> Clashes or contacts command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html> For scripting, instead of "log" you could use "saveFile" to get an output file for each structure pair. What you get in the Log or file looks like this: Ignore distances between atoms separated by 4 bonds or less Detect intra-residue distances: False Detect intra-molecule distances: True 3030 distances atom1 atom2 overlap distance 1gcn #1/A ARG 18 CZ 1zik #2/A LYS 15 O 4.767 0.233 1gcn #1/A LYS 12 O 1zik #2/A VAL 9 CA 4.568 0.432 1gcn #1/A ARG 18 CD 1zik #2/A LYS 16 CA 4.540 0.460 1gcn #1/A ALA 19 O 1zik #2/B LYS 15 CB 4.449 0.551 1gcn #1/A TRP 25 CE3 1zik #2/B GLU 22 CB 4.415 0.585 1gcn #1/A SER 8 OG 1zik #2/A LYS 3 CE 4.407 0.593 1gcn #1/A PHE 22 CE2 1zik #2/B HIS 18 N 4.392 0.608 1gcn #1/A LYS 12 NZ 1zik #2/A LEU 5 CB 4.356 0.644 1gcn #1/A LYS 12 CD 1zik #2/A LEU 5 O 4.335 0.665 1gcn #1/A GLN 20 CA 1zik #2/B LYS 15 CD 4.309 0.691 [... etc. ...] I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias

Hi Elaine, Thanks a lot for this. The models that I am analyzing are separated by distances in the range of 20 to >100 angstroms, for which the contacts command/interfaces becomes rather slow. Sounds like I might need a solution outside the Chimera universe. Thanks for your help, Best, Matthias Holen Sie sich Outlook für Android<https://aka.ms/AAb9ysg> ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, September 28, 2021 5:19:17 PM To: Vorländer,Matthias Kopano <matthias.vorlaender@imp.ac.at> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Possible to measure the shortest distance between two models? Hi Matthias, The "contacts" or "clashes" command gives all-by-all distances (and VDW overlaps) between two sets of atoms. You can write all the info to a file or to a log. It does not automatically only give you the shortest distance, but it sorts the output so that the shortest is first. For example (these structures are nonphysically on top of each other, but work for illustrating the commands): open 1zik open 1gcn contacts #1 restrict #2 distanceOnly 5 log true ...shows in the log all the pairwise distances between the two sets of atoms that are within 5 angstroms, with the shortest distance first. See measurements: <https://rbvi.ucsf.edu/chimerax/docs/user/measurements.html> Clashes or contacts command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html> For scripting, instead of "log" you could use "saveFile" to get an output file for each structure pair. What you get in the Log or file looks like this: Ignore distances between atoms separated by 4 bonds or less Detect intra-residue distances: False Detect intra-molecule distances: True 3030 distances atom1 atom2 overlap distance 1gcn #1/A ARG 18 CZ 1zik #2/A LYS 15 O 4.767 0.233 1gcn #1/A LYS 12 O 1zik #2/A VAL 9 CA 4.568 0.432 1gcn #1/A ARG 18 CD 1zik #2/A LYS 16 CA 4.540 0.460 1gcn #1/A ALA 19 O 1zik #2/B LYS 15 CB 4.449 0.551 1gcn #1/A TRP 25 CE3 1zik #2/B GLU 22 CB 4.415 0.585 1gcn #1/A SER 8 OG 1zik #2/A LYS 3 CE 4.407 0.593 1gcn #1/A PHE 22 CE2 1zik #2/B HIS 18 N 4.392 0.608 1gcn #1/A LYS 12 NZ 1zik #2/A LEU 5 CB 4.356 0.644 1gcn #1/A LYS 12 CD 1zik #2/A LEU 5 O 4.335 0.665 1gcn #1/A GLN 20 CA 1zik #2/B LYS 15 CD 4.309 0.691 [... etc. ...] I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias

Chimera (not ChimeraX currently) has a "measure distance" command that gives the shortest distance given two sets of atoms and/or surfaces. However, I don't know whether it would be fast enough for your purposes. Also, Chimera is much slower in dealing with very large structures than ChimeraX. See: <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/measure.html#distanc...> Elaine
On Sep 28, 2021, at 11:35 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Elaine,
Thanks a lot for this. The models that I am analyzing are separated by distances in the range of 20 to >100 angstroms, for which the contacts command/interfaces becomes rather slow. Sounds like I might need a solution outside the Chimera universe.
Thanks for your help, Best, Matthias
Holen Sie sich Outlook für Android From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, September 28, 2021 5:19:17 PM To: Vorländer,Matthias Kopano <matthias.vorlaender@imp.ac.at> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Possible to measure the shortest distance between two models?
Hi Matthias, The "contacts" or "clashes" command gives all-by-all distances (and VDW overlaps) between two sets of atoms. You can write all the info to a file or to a log. It does not automatically only give you the shortest distance, but it sorts the output so that the shortest is first.
For example (these structures are nonphysically on top of each other, but work for illustrating the commands):
open 1zik open 1gcn contacts #1 restrict #2 distanceOnly 5 log true
...shows in the log all the pairwise distances between the two sets of atoms that are within 5 angstroms, with the shortest distance first.
See measurements: <https://rbvi.ucsf.edu/chimerax/docs/user/measurements.html>
Clashes or contacts command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html>
For scripting, instead of "log" you could use "saveFile" to get an output file for each structure pair. What you get in the Log or file looks like this:
Ignore distances between atoms separated by 4 bonds or less Detect intra-residue distances: False Detect intra-molecule distances: True
3030 distances atom1 atom2 overlap distance 1gcn #1/A ARG 18 CZ 1zik #2/A LYS 15 O 4.767 0.233 1gcn #1/A LYS 12 O 1zik #2/A VAL 9 CA 4.568 0.432 1gcn #1/A ARG 18 CD 1zik #2/A LYS 16 CA 4.540 0.460 1gcn #1/A ALA 19 O 1zik #2/B LYS 15 CB 4.449 0.551 1gcn #1/A TRP 25 CE3 1zik #2/B GLU 22 CB 4.415 0.585 1gcn #1/A SER 8 OG 1zik #2/A LYS 3 CE 4.407 0.593 1gcn #1/A PHE 22 CE2 1zik #2/B HIS 18 N 4.392 0.608 1gcn #1/A LYS 12 NZ 1zik #2/A LEU 5 CB 4.356 0.644 1gcn #1/A LYS 12 CD 1zik #2/A LEU 5 O 4.335 0.665 1gcn #1/A GLN 20 CA 1zik #2/B LYS 15 CD 4.309 0.691 [... etc. ...]
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Great, that might do the trick! Thanks a lot! :) Holen Sie sich Outlook für Android<https://aka.ms/AAb9ysg> ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, September 28, 2021 8:42:22 PM To: Vorländer,Matthias Kopano <matthias.vorlaender@imp.ac.at> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Possible to measure the shortest distance between two models? Chimera (not ChimeraX currently) has a "measure distance" command that gives the shortest distance given two sets of atoms and/or surfaces. However, I don't know whether it would be fast enough for your purposes. Also, Chimera is much slower in dealing with very large structures than ChimeraX. See: <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/measure.html#distanc...> Elaine
On Sep 28, 2021, at 11:35 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Elaine,
Thanks a lot for this. The models that I am analyzing are separated by distances in the range of 20 to >100 angstroms, for which the contacts command/interfaces becomes rather slow. Sounds like I might need a solution outside the Chimera universe.
Thanks for your help, Best, Matthias
Holen Sie sich Outlook für Android From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Tuesday, September 28, 2021 5:19:17 PM To: Vorländer,Matthias Kopano <matthias.vorlaender@imp.ac.at> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Possible to measure the shortest distance between two models?
Hi Matthias, The "contacts" or "clashes" command gives all-by-all distances (and VDW overlaps) between two sets of atoms. You can write all the info to a file or to a log. It does not automatically only give you the shortest distance, but it sorts the output so that the shortest is first.
For example (these structures are nonphysically on top of each other, but work for illustrating the commands):
open 1zik open 1gcn contacts #1 restrict #2 distanceOnly 5 log true
...shows in the log all the pairwise distances between the two sets of atoms that are within 5 angstroms, with the shortest distance first.
See measurements: <https://rbvi.ucsf.edu/chimerax/docs/user/measurements.html>
Clashes or contacts command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/clashes.html>
For scripting, instead of "log" you could use "saveFile" to get an output file for each structure pair. What you get in the Log or file looks like this:
Ignore distances between atoms separated by 4 bonds or less Detect intra-residue distances: False Detect intra-molecule distances: True
3030 distances atom1 atom2 overlap distance 1gcn #1/A ARG 18 CZ 1zik #2/A LYS 15 O 4.767 0.233 1gcn #1/A LYS 12 O 1zik #2/A VAL 9 CA 4.568 0.432 1gcn #1/A ARG 18 CD 1zik #2/A LYS 16 CA 4.540 0.460 1gcn #1/A ALA 19 O 1zik #2/B LYS 15 CB 4.449 0.551 1gcn #1/A TRP 25 CE3 1zik #2/B GLU 22 CB 4.415 0.585 1gcn #1/A SER 8 OG 1zik #2/A LYS 3 CE 4.407 0.593 1gcn #1/A PHE 22 CE2 1zik #2/B HIS 18 N 4.392 0.608 1gcn #1/A LYS 12 NZ 1zik #2/A LEU 5 CB 4.356 0.644 1gcn #1/A LYS 12 CD 1zik #2/A LEU 5 O 4.335 0.665 1gcn #1/A GLN 20 CA 1zik #2/B LYS 15 CD 4.309 0.691 [... etc. ...]
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

You can use Python in ChimeraX to find the shortest distance. Here is some example code closest.py to do that. https://rbvi.github.io/chimerax-recipes/closest/closest.html <https://rbvi.github.io/chimerax-recipes/closest/closest.html> If you open that Python code in ChimeraX it registers a command "closest" open 7LUP closest /A to /B maxDist 100 > Minimum distance 2.27 between /A LYS 45 NZ and /B ASP 522 OD1 Tom
On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear all,
I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance,
Best, Matthias
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>

Thanks Tom, this is awesome! Much appreciated! Best, Matthias Holen Sie sich Outlook für Android<https://aka.ms/AAb9ysg> ________________________________ From: Tom Goddard <goddard@sonic.net> Sent: Tuesday, September 28, 2021 8:54:48 PM To: Vorländer,Matthias Kopano <matthias.vorlaender@imp.ac.at> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Possible to measure the shortest distance between two models? You can use Python in ChimeraX to find the shortest distance. Here is some example code closest.py to do that. https://rbvi.github.io/chimerax-recipes/closest/closest.html If you open that Python code in ChimeraX it registers a command "closest" open 7LUP closest /A to /B maxDist 100
Minimum distance 2.27 between /A LYS 45 NZ and /B ASP 522 OD1
Tom On Sep 28, 2021, at 2:15 AM, Vorländer,Matthias Kopano via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Dear all, I am interested in measuring the shortest distance between two models (PDBs) without a priori knowledge of which atoms will be the closest ones. I am planning to do this for a large number of model pairs, therefore it would be great if this would be scriptable. Is this possible using ChimeraX? Thanks a lot in advance, Best, Matthias _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Tom Goddard
-
Vorländer,Matthias Kopano