Scripts: maxdist.py
| File maxdist.py, 443 bytes (added by , 10 years ago) |
|---|
| Line | |
|---|---|
| 1 | # Report maximum distance between two atoms among selected atoms |
| 2 | |
| 3 | from chimera import selection |
| 4 | atoms = selection.currentAtoms() |
| 5 | |
| 6 | distances = [] |
| 7 | for a1 in atoms: |
| 8 | for a2 in atoms: |
| 9 | d = a1.xformCoord().distance(a2.xformCoord()) |
| 10 | distances.append((d, a1, a2)) |
| 11 | |
| 12 | d, a1, a2 = max(distances) |
| 13 | print('Maximum distance between pairs of atoms among %d atoms is %.2f for %s and %s' |
| 14 | % (len(atoms), d, a1.oslIdent(), a2.oslIdent())) |
![[Chimera Issue Tracking System]](/trac/chimera/chrome/site/chimera_logo.png)