Freely rotating chain
Usage examples and full code reference for
FreelyRotatingChain. For the underlying theory, see
Freely rotating chain.
Quick start
from afrc.polymer_models.frc import FreelyRotatingChain
# defaults: bond length b = 3.8 A, characteristic ratio c_inf = 2.0
model = FreelyRotatingChain('MASNDYTQQATQSYGAYPTQPGQGYSQQSSQPYG')
model.get_mean_end_to_end_distance()
model.get_root_mean_squared_end_to_end_distance()
model.get_mean_radius_of_gyration()
r, p = model.get_end_to_end_distribution()
samples = model.sample_end_to_end_distribution(n=1000)
Tune the stiffness via the characteristic ratio (c_inf = 1 recovers the freely jointed
chain; larger values give a stiffer, more extended ideal chain):
flexible = FreelyRotatingChain('MASNDYTQQATQSYG', c_inf=1.0)
stiff = FreelyRotatingChain('MASNDYTQQATQSYG', c_inf=4.0)
flexible.get_root_mean_squared_end_to_end_distance()
stiff.get_root_mean_squared_end_to_end_distance()
See also the demo/demo_FreelyRotatingChain.ipynb notebook for a worked, plotted example.
Code reference
- class afrc.polymer_models.frc.FreelyRotatingChain(seq, p_of_r_resolution=0.05, b=3.8, c_inf=2.0)
This class generates an object that returns polymer statistics consistent with a freely rotating chain (FRC) of
Nbonds of lengthbwith a fixed bond angle and unrestricted (free) torsion angles.The freely rotating chain is an ideal chain: like the Analytical Flory Random Coil it has Gaussian end-to-end statistics with a true scaling exponent of 0.5, but its size is set by a single stiffness parameter - the characteristic ratio \(C_\infty\). The mean-squared end-to-end distance follows the exact finite-N freely-rotating-chain result
⟨R²⟩ = C∞·N·b² − 2 b² α (1 − α^N) / (1 − α)², α = (C∞ − 1)/(C∞ + 1),
where α is the cosine of the angle between successive bonds. Setting
c_inf = 1(α = 0) recovers the freely jointed chain, whilec_inf = 2corresponds to a tetrahedral backbone angle. Note that a freely rotating chain cannot reproduce the much larger characteristic ratio of a real polypeptide (\(C_\infty \approx 9\)), which arises from hindered/restricted rotation - use the Analytical Flory Random Coil for that.This is a composition-independent model: the sequence is used only to set the number of bonds. It is included as an additional reference model.
[1] Flory, P. J. (1969). Statistical Mechanics of Chain Molecules. Wiley-Interscience.
[2] Rubinstein, M., & Colby, R. H. (2003). Polymer Physics. Oxford University Press.
- __init__(seq, p_of_r_resolution=0.05, b=3.8, c_inf=2.0)
Method to create a FreelyRotatingChain object. Seq should be a valid upper-case amino acid sequence and p_of_r_resolution defines the resolution (in angstroms) to be used for distributions.
By default p_of_r_resolution is taken from the config.py file in the afrc package which defines the resolution at 0.05 A.
- Parameters:
seq (str) – Amino acid sequence (used only to calculate the number of bonds).
p_of_r_resolution (float) – Bin width for building probability distributions. In Angstroms.
b (float) – Bond (segment) length, in Angstroms. The default of 3.8 A corresponds to the Cα-Cα distance, i.e. one virtual bond per residue.
c_inf (float) – Characteristic ratio \(C_\infty\), a dimensionless measure of chain stiffness defined as \((1 + \alpha)/(1 - \alpha)\) where α is the cosine of the angle between successive bonds.
c_inf = 1recovers the freely jointed chain;c_inf = 2corresponds to a tetrahedral bond angle. Must be > 0.
- get_end_to_end_distribution()
Defines the end-to-end distribution based on the freely rotating chain (FRC).
The freely rotating chain is an ideal chain, so the distribution is Gaussian, but its size is set by the characteristic ratio. This is a composition independent model for which the end-to-end distance depends solely on the number of amino acids. It is included here as an additional reference model.
- Returns:
A 2-pair tuple of numpy arrays where the first is the distance (in Angstroms) and the second array is the probability of that distance.
- Return type:
tuple of arrays
- get_mean_end_to_end_distance()
Returns the mean end-to-end distance (\(R_e\)) for the freely rotating chain.
The mean is computed by integrating over the \(P(r)\) vs. \(r\) distribution (i.e. \(\sum r \cdot P(r)\)), consistent with the convention used by the other models in this package.
- Returns:
Value equal to the mean end-to-end distance.
- Return type:
float
- get_mean_radius_of_gyration()
Returns the mean radius of gyration (\(R_g\)) for the freely rotating chain.
For an ideal chain the radius of gyration is related to the root-mean-square end-to-end distance by \(R_g = \sqrt{\langle R_e^2 \rangle / 6}\), and this relationship is used here.
- Returns:
Value equal to the mean radius of gyration.
- Return type:
float
- get_root_mean_squared_end_to_end_distance()
Returns the root-mean-square end-to-end distance (\(\sqrt{\langle R_e^2 \rangle}\)) for the freely rotating chain.
The value is computed by taking the square root after integrating over \(P(r)\) vs. \(r^2\). In the long-chain limit this approaches \(\sqrt{C_\infty}\, b\sqrt{N}\).
- Returns:
Value equal to the root-mean-square end-to-end distance.
- Return type:
float
- sample_end_to_end_distribution(n=1000)
Subsamples from the end-to-end distance distribution to generate an uncorrelated ‘trajectory’ of points. Useful for creating a sized-match sample to compare with simulation data.
- Parameters:
n (int) – Number of random values to sample (default = 1000)
- Returns:
Returns an n-length array with n independent values (floats)
- Return type:
np.ndarray