helixmc.random_step.RandomStepSimple¶
-
class
helixmc.random_step.
RandomStepSimple
(params=None, params_cov=None, params_avg=None, gaussian_sampling=True)¶ Simple random bp-step generator. Pick random datasets from database or sample from a multivariate Gaussian built from the database.
Parameters: params : ndarray, shape (N,6), optional
Input base-pair step parameters. Usually obtained by analyzing the structures in PDB. Must be specified if params_cov and params_avg is not being input, or if gaussian_sampling is set to False. Order = [Shift, Slide, Rise, Tilt, Roll, Twist] Distance in unit of Å, angle in unit of radians.
params_cov : ndarray, shape (6,6), optional
Covariance matrix of the multivariate Gaussian for step parameters. Used for Gaussian sampling.
params_avg : ndarray, shape (6,6), optional
Averages of the multivariate Gaussian for step parameters. Used for Gaussian sampling.
gaussian_sampling : bool, optional
Whether to sample assuming a multivariate Gaussian. Default is True.
Raises: ValueError
If params is not specified, and either params_avg and params_cov are not specified. If params is not specified, but gaussian_sampling is set to False.
See also
RandomStepBase
- Base class for Random bp-step generator, for inheritence only.
RandomStepAgg
- Random bp-step generator by aggregrating multiple independent bp-step generators.
Attributes
gaussian_sampling (bool) See the Parameters section. params_avg (ndarray) See the Parameters section. params_cov (ndarray) See the Parameters section. params (ndarray) See the Parameters section. Return None if not specified at init. -
__call__
()¶ Draw one random bp-step parameter set from the distribution.
Returns: params: ndarray, shape (6)
Randomly generated bp-step parameter set.
o : ndarray, shape (3)
Corresponding bp-center for the 2nd bp of the bp-step (1st bp is at origin and oriented with the coordinate frame).
R : ndarray, shape (3,3)
Corresponding frame for the 2nd bp of the bp-step.
-
__init__
(params=None, params_cov=None, params_avg=None, gaussian_sampling=True)¶
-
classmethod
load_gaussian_params
(filename)¶ Load a single Gaussian parameter file from disk.
Parameters: filename : str
Name of the Gaussian parameter file, in .npy or plain text format. First row is the mean parameters and the following six rows represents the covariance matrix. The routine will look for helixmc/data/ if the file is not found in current folder. Order = [Shift, Slide, Rise, Tilt, Roll, Twist] Distance in unit of Å, angle in unit of radians.
Returns: random_step : RandomStepSimple
Random step generator corresponds to the input file.
-
classmethod
load_params
(filename, gaussian_sampling=True)¶ Load a simple bp-step parameter file from disk.
Parameters: filename : str
Name of the parameter file, in .npy or text format. It should be a (N * 6) numpy array. Each row contains the 6 step parameters. The routine will look for helixmc/data/ if the file is not found in current folder. Order = [Shift, Slide, Rise, Tilt, Roll, Twist] Distance in unit of Å, angle in unit of radians.
gaussian_sampling : bool, optional
Whether to sample assuming a multivariate Gaussian.
Returns: random_step : RandomStepSimple
Random step generator corresponds to the input file.