ProteinPool
The protein pool is generated by creating protein shapes using input parameter distributions for alpha (the concavity of the shapes) and num_points (the number of points used in shape hull generation). This file is saved as .pkl and loaded in DatasetGenerator to compute interactions.
- class Dock2D.DatasetGeneration.ProteinPool.ParamDistribution(**kwargs)
- __init__(**kwargs)
Unzip alpha (shape concavity) and number of points (number of points used to generate shape hulls) parameter distributions, then normalize probabilities.
- Parameters
kwargs (list of tuples [(alpha, prob), ...] or [(num_points, prob), ...]) – parameter distributions for alpha and num_points
- extract_params(param_name)
Extracts parameters and associated probabilities e.g. [(alpha, prob),…] or [(num_points, prob),…] from parameter distributions used in protein shape pool generation.
- Parameters
param_name ([str](alpha or num_points)) – alpha or num_points.
- Returns
two separate tuples of values and probabilities
- normalize(param_name)
Normalize probabilities from parameter distribution.
- Parameters
param_name – name of parameter to normalize
- Returns
alpha and num_points normalized probabilities
- class Dock2D.DatasetGeneration.ProteinPool.ProteinPool(proteins)
- __init__(proteins)
- Parameters
proteins – protein shape pools generated
- classmethod generate(num_proteins, params, size=50)
Generate protein shapes to be used in protein pool by randomly sampling alpha and num_points using their associated probabilities from param parameter distributions.
- Parameters
num_proteins – number of proteins to generate in the pool
params – parameters used in shape generation, list of tuples [(alpha, prob),…] or [(num_points, prob),…]
size – size of the box to generate a shape within.
- Returns
protein pool shapes and corresponding individual shape parameters
- classmethod load(filename)
Load protein pool .pkl
- Parameters
filename – protein pool filename.pkl
- Returns
protein pool
- save(filename)
Save protein pool shapes and corresponding params to .pkl
- Parameters
filename – protein pool filename.pkl