Cavity & windows¶
Pore sphere and window size of a finite cage, used by host-guest docking: cage_isomer_builder.utils.cavity.
Cavity and window geometry of a finite cage, from its atoms.
- :func:
pore_sphere: the largest sphere that fits inside the cage, i.e. the point whose clearance to the nearest atom surface (distance minus the atom's van der Waals radius) is largest, found by maximising that clearance from the cage's centroid. This is the "optimised pore diameter" used by cage-analysis codes such as pywindow (Miklitz & Jelfs). - :func:
largest_window: the widest opening out of the cavity. Rays are cast from the pore centre in many directions; a ray that leaves the cage without crossing any atom passes through an opening, and the narrowest clearance along it is that opening's free radius. The widest such opening, as a diameter, is returned. Straight rays give a lower bound on a window's free size (a guest could also pass at an angle).
Van der Waals radii are Bondi's where defined, else Alvarez (2013), which also covers the metals.
vdw_radius ¶
Van der Waals radii (Angstrom): Bondi where defined, else Alvarez, else 2.0.
Examples:
>>> from cage_isomer_builder.utils.cavity import vdw_radius
>>> vdw_radius([1, 6, 40]).tolist() # H, C (Bondi), Zr (Alvarez)
[1.2, 1.7, 2.52]
Source code in cage_isomer_builder/utils/cavity.py
pore_sphere ¶
Centre and diameter of the largest sphere inside a finite cage.
The clearance (distance to the nearest atom surface) is maximised from
start (default: the centroid of the atoms), staying within the
sphere that is free at the start, so the search cannot leave the cage
through a window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atoms
|
Atoms
|
Finite structure ( |
required |
start
|
array - like
|
Where to start the search. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
centre |
(ndarray, shape(3))
|
|
diameter |
float
|
Zero or negative if the start point is inside an atom (no cavity). |
Examples:
>>> from ase.build import molecule
>>> from cage_isomer_builder.utils.cavity import pore_sphere
>>> centre, diameter = pore_sphere(molecule("C60"))
>>> round(diameter, 2) # 2 * (3.51 A cage radius - 1.70 A for C)
3.62
Source code in cage_isomer_builder/utils/cavity.py
largest_window ¶
Free diameter of the widest opening out of a finite cage's cavity (see the module docstring), or None if no straight ray escapes (a closed cage such as C60).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atoms
|
Atoms
|
|
required |
centre
|
array - like
|
Default: :func: |
None
|
n_directions
|
int
|
Number of ray directions (evenly spread over the sphere). |
2000
|
step
|
float
|
Sampling step along each ray (Angstrom). |
0.1
|
Examples:
>>> from ase.build import molecule
>>> from cage_isomer_builder.utils.cavity import largest_window
>>> print(largest_window(molecule("C60"))) # closed: no way out
None