OpenBabel
Utility functions for OpenBabel.
Rings ¶
Rings()
A class for storing information about aromatic rings in a molecule.
This class stores the center and normal vectors for each aromatic ring in a molecule. It also stores the indices of the atoms in each ring and the index of the first atom in each ring.
Source code in lahuta/utils/ob.py
35 36 37 38 39 |
|
centers
property
¶
centers
Returns the centers of the rings.
Returns:
Type | Description |
---|---|
NDArray[float32]
|
NDArray[np.float32]: The centers of the rings. |
normals
property
¶
normals
Returns the normal vectors of the rings.
Returns:
Type | Description |
---|---|
NDArray[float32]
|
NDArray[np.float32]: The normal vectors of the rings. |
atoms
property
¶
atoms
Returns the atoms in the rings.
Returns:
Type | Description |
---|---|
NDArray[int32]
|
NDArray[np.int32]: The atoms in the rings. |
first_atom_idx
property
¶
first_atom_idx
Returns the index of the first atom in each ring.
Returns:
Type | Description |
---|---|
NDArray[int32]
|
NDArray[np.int32]: The index of the first atom in each ring. |
add_ring ¶
add_ring(ob_ring)
Add a ring to the Rings object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ob_ring |
ObRingType
|
The ring to be added. |
required |
Source code in lahuta/utils/ob.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
get_bonded_atoms ¶
get_bonded_atoms(mol)
Return an array of bonded atoms in a molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
MolType
|
The molecule for which to find bonded atoms. |
required |
Returns:
Type | Description |
---|---|
NDArray[int32]
|
NDArray[np.int32]: A numpy array containing the indices of bonded atoms. |
Source code in lahuta/utils/ob.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
enumerate_rings ¶
enumerate_rings(mol)
Enumerate the aromatic rings in a molecule.
This function takes a molecule as input and returns a Rings object containing information
about the aromatic rings in the molecule. It is used by atom-plane
and plane-plane
contact calculations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
MolType
|
The molecule for which to enumerate the rings. |
required |
Returns:
Name | Type | Description |
---|---|---|
Rings |
Rings
|
A Rings object containing information about the rings in the molecule. |
Source code in lahuta/utils/ob.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|