numpy_utils¶
-
pyrosetta.toolbox.numpy_utils.
calc_dihedral
(c)¶ Compute a dihedral angle from four points in space.
- Args:
- c (np.mat): Coordinates of four points in space (atoms)
- Returns:
- The dihedral angle as a float
-
pyrosetta.toolbox.numpy_utils.
get_coordinates_from_pose
(p, resNo=1)¶ Pack atomic coordinates in a single residue into a numpy matrix.
- Args:
- p (Pose): Pose from coordinates will be extracted resNo (int): the pose-numbered residue of interest
- Returns:
- Set of coordinates (np.mat) for the atoms in the Pose
-
pyrosetta.toolbox.numpy_utils.
numpy_to_rosetta
(np_arr)¶ Pack values in a numpy data structure into the analogous Rosetta data structure.
- Args:
- np_arry (np.mat or np.array): One- (1 x 3) or two-dimensional (3 x 3)
- numpy matrix
- Returns:
- The values in the appropriate Rosetta container
- (numeric.xyzVector_double_t or numeric.xyzMatrix_double_t)
-
pyrosetta.toolbox.numpy_utils.
rigid_transform_3D
(A, B)¶ Compute the translation and rotation to optimally superpose two sets of points using singular value decomposition.
- Args:
A (np.mat): A set of points B (np.mat): A set of points (must have a one-to-one correspondence
to the points in A)- Returns:
- Rotation matrix (np.mat) and translation vector (np.array) to
- optimally superpose A onto B
-
pyrosetta.toolbox.numpy_utils.
rotate_pose
(p, R)¶ Apply a rotation matrix to all of the coordinates in a Pose.
- Args:
- p (Pose): The Pose instance to manipulate R (np.mat): A rotation matrix to apply to the Pose coordinates
- Returns:
- None. The input Pose is manipulated.
-
pyrosetta.toolbox.numpy_utils.
translate_pose
(p, t)¶ Apply a translation to all of the coordinates in a Pose.
- Args:
- p (Pose): The Pose instance to manipulate t (np.array): A vector to add to the Pose coordinates
- Returns:
- None. The input Pose is manipulated.