dihedrals#
Functions#
|
Function to calculate the limited (0 to pi radian) dihedral angle between the points in arrays a,b,c and d. |
|
Function to calculate the sine and cosine of the dihedral between the points in arrays a,b,c and d. |
|
Calculate all dihedral angles between the atoms specified. |
Identify quadruples of bonded atoms (using RDKit) and calculate the corresponding proper bond torsion for each |
Module Contents#
- _dihedral_deg(atXYZ, a_index, b_index, c_index, d_index, full=False)#
Function to calculate the limited (0 to pi radian) dihedral angle between the points in arrays a,b,c and d.
if full=True, calculates the signed/full dihedral angle (up to +-pi radian) between the points in arrays a,b,c and d.
- Parameters:
- Returns:
The array of dihedral angels between the four input indices.
- Return type:
xr.DataArray | xr.Variable
- _dihedral_trig_(atXYZ, a_index, b_index, c_index, d_index, full=False)#
Function to calculate the sine and cosine of the dihedral between the points in arrays a,b,c and d.
- Parameters:
- Returns:
First the array of cosines and then the array of sines of the dihedral angle
- Return type:
tuple[xr.DataArray, xr.DataArray]
- dihedral(atXYZ: shnitsel.core.typedefs.AtXYZ, a_index: int, b_index: int, c_index: int, d_index: int, *, deg: Literal['trig'], full: bool = False) tuple[xarray.DataArray, xarray.DataArray]#
- dihedral(atXYZ: shnitsel.core.typedefs.AtXYZ, a_index: int, b_index: int, c_index: int, d_index: int, *, deg: bool = True, full: bool = False) xarray.DataArray
Calculate all dihedral angles between the atoms specified. The atoms specified need to be bonded in this sequence (a-b), (b-c), (c-d).
- Parameters:
atXYZ (AtXYZ) – A
DataArrayof coordinates, withatomanddirectiondimensionsa_index (int) – The four atom indices, where successive atoms should be bonded in this order.
b_index (int) – The four atom indices, where successive atoms should be bonded in this order.
c_index (int) – The four atom indices, where successive atoms should be bonded in this order.
d_index (int) – The four atom indices, where successive atoms should be bonded in this order.
deg (bool | Literal['trig'],optional) – Whether to return angles in degrees (True) or radians (False) or as cosine and sine (‘trig’), by default False
full (bool, optional) – Whether to return signed full dihedrals or unsigned (positive) dihedrals if False, by default False
- Returns:
A
DataArraycontaining dihedral angles (or the sin and cos thereof)- Return type:
xr.DataArray
- get_dihedrals(atXYZ_source: shnitsel.data.tree.node.TreeNode[Any, shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray], structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) shnitsel.data.tree.node.TreeNode[Any, xarray.DataArray]#
- get_dihedrals(atXYZ_source: shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray, structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) xarray.DataArray
Identify quadruples of bonded atoms (using RDKit) and calculate the corresponding proper bond torsion for each frame.
- Parameters:
atXYZ_source (TreeNode[Any, Trajectory | Frames | xr.Dataset | xr.DataArray] | Trajectory | Frames | xr.Dataset | xr.DataArray) – An
xarray.DataArrayof molecular coordinates, with dimensionsatomanddirectionor another source of positional data like a trajectory, a frameset, a dataset representing either of those or a tree structure holding such data.structure_selection (StructureSelection | StructureSelectionDescriptor, optional) – Object encapsulating feature selection on the structure whose positional information is provided in atXYZ. If this argument is omitted altogether, a default selection for all bonds within the structure is created.
deg (bool | Literal['trig'], optional) – Whether to return angles in degrees (as opposed to radians), by default True. Alternatively, return cos and sin (option trig) for each dihedral
signed – Whether the result should be returned with a sign or just as an absolute value in the range. Triggers calculation of ‘full’ i.e. signed dihedrals.
optional – Whether the result should be returned with a sign or just as an absolute value in the range. Triggers calculation of ‘full’ i.e. signed dihedrals.
- Returns:
An
xarray.DataArrayof bond torsions/dihedrals with dimension descriptor to index the dihedrals along.- Return type:
TreeNode[Any, xr.DataArray] | xr.DataArray