Utils Traj#
traj
#
| FUNCTION | DESCRIPTION |
|---|---|
distances |
Compute pairwise distances between atoms given by selection. |
fraction_of_native_contacts |
Compute the fraction of native contacts [1]. |
Functions#
distances(traj: md.Trajectory, selection: str = 'all', stride: int = 1) -> torch.Tensor
#
Compute pairwise distances between atoms given by selection.
Selects atoms using the topology's select_atom_indices and forms
all unique pairs whose residues are separated by more than stride
residues. Distances are computed via mdtraj.compute_distances.
For selection semantics, see: https://mdtraj.org/1.9.3/atom_selection.html.
| PARAMETER | DESCRIPTION |
|---|---|
traj
|
The trajectory to compute distances.
TYPE:
|
selection
|
Atom selection string passed to
TYPE:
|
stride
|
Minimum residue separation between atom pairs. Pairs whose
residues are separated by
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Pairwise distances for each frame of the trajectory. |
Source code in spectre/utils/traj.py
fraction_of_native_contacts(traj: md.Trajectory, native: md.Trajectory, beta: float = 50.0, gamma: float = 1.5, native_cutoff: float = 0.8, selection: str = 'alpha', stride: int = 3)
#
Compute the fraction of native contacts [1].
| PARAMETER | DESCRIPTION |
|---|---|
traj
|
The trajectory to do the computation.
TYPE:
|
native
|
The 'native state'. This can be an entire trajecory, or just a single frame. Only the first conformation is used.
TYPE:
|
beta
|
Beta constant in 1/nm units.
TYPE:
|
gamma
|
Gamma constant.
TYPE:
|
native_cutoff
|
Cutoff distance for native contacts in nanometers.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Fraction of native contacts in each frame. |