Kinematics#
Fold forests, move maps, and kinematic coordinate operations.
tmol.FoldForest, tmol.EdgeType, tmol.MoveMap, and
tmol.CartesianMoveMap are imported from the top-level package and
documented in Top-level API.
Kinematic trees, fold forests, move maps, and coordinate transforms.
- class tmol.kinematics.BondDOFTypes(*values)[source]#
Bases:
IntEnumIndices of bond dof types within KinDOF.raw.
- class tmol.kinematics.JumpDOFTypes(*values)[source]#
Bases:
IntEnumIndices of jump dof types within KinDOF.raw.
- class tmol.kinematics.PoseStackKinematicsModule(pose_stack: PoseStack, fold_forest: FoldForest)[source]#
Bases:
Moduletorch.autograd compatible forward kinematic operator for PoseStack.
Perform forward (dof to coordinate) kinematics within torch.autograd compute graph. Provides support for forward kinematics over of a subset of source dofs, as specified by the provided DOFMetadata entries.
The kinematic system maps between the natm x 9 internal coordinate frame and the natm x 3 coordinate frame. Some of this natm x 9 array is unused or is redundant but this is not known by the kinematic module.
See KinDOF for a description of the internal coordinate representation.
This class should not be altered after construction. Build it and use it and throw it away. Do not update.
- forward(dofs)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- tmol.kinematics.inverseKin(kinforest: KinForest, coords: Tensor[slice(None, None, None), 3], requires_grad=False) KinDOF[source]#
xyzs -> HTs, dofs - “backward” kinematics
- tmol.kinematics.set_named_torsions(pose_stack: PoseStack, poses, blocks, names, values, degrees: bool = True, fold_forest=None) PoseStack[source]#
Set named torsions, returning a new PoseStack.
poses,blocks,namesandvaluesare either all scalars or equal-length sequences; a batch is applied in one kinematic pass. Movement follows the fold forest, so which side of each bond stays fixed depends on it;reasonable_fold_forestroots each chain at its first residue.