helixmc.util.ribbon_twist¶
-
helixmc.util.
ribbon_twist
(dr, rb_vec, return_val_only=True, twist_center=0.0)¶ Compute the ribbon-twist (supercoiling twist) of a helix.
Parameters: dr : ndarray, shape (N,3)
Input delta_r vectors (dr[i] = r[i+1] - r[i]).
rb_vec : ndarray, shape (N+1,3)
The ribbon vectors for the helix, equals to
frame[:,:,1]
in the current setting. Must be normalized vectors.return_val_only : bool, optional
If True, return one float value for the overall twist of the system. Otherwise return the individual twists for each bp-step. Default set to True.
twist_center : float, optional
Fold the step twists to (center - pi, center + pi], default to 0.
Returns: twist : float or ndarray of shape (N)
The overall twist or the individual twists of the helix. See the ‘return_val_only’ parameter above.
Raises: ValueError
If dr.shape[0] != rb_vec.shape[0] + 1.
See also
writhe_fuller
- Compute the writhe of the helix using the Fuller approximated single integral.
writhe_exact
- Compute the writhe of the helix using the exact Gauss double integral.