Worm-like chain (Zhou)
Usage examples and full code reference for
WormLikeChain. For the underlying theory, see
Worm-like chain (Zhou).
Quick start
from afrc.polymer_models.wlc import WormLikeChain
# defaults: persistence length lp = 3.0 A, segment size aa_size = 3.8 A
model = WormLikeChain('MASNDYTQQATQSYGAYPTQPGQGYSQQSSQPYG')
model.get_mean_end_to_end_distance()
model.get_root_mean_squared_end_to_end_distance()
# full end-to-end distribution (distances, probabilities)
r, p = model.get_end_to_end_distribution()
Explore the effect of chain stiffness by varying the persistence length:
for lp in (2.0, 3.0, 4.0):
wlc = WormLikeChain('MASNDYTQQATQSYG', lp=lp)
print(lp, wlc.get_mean_end_to_end_distance())
See also the demo/demo_WormLikeChain.ipynb notebook for a worked, plotted example.
Code reference
- class afrc.polymer_models.wlc.WormLikeChain(seq, p_of_r_resolution=0.05, lp=3.0, aa_size=3.8)
This class generates an object that returns polymer statistics consistent with the Worm-like chain model as implemented by Zhou (2004).
This model should be basically identical to the O’Brien model (WormLikeChain2) but show better numerical stability at large contour lengths. Unlike the O’Brien model this model does not provide an estimation of the mean Rg.
Zhou, H.-X. (2004). Polymer models of protein stability, folding, and interactions. Biochemistry, 43(8), 2141–2154.
- __init__(seq, p_of_r_resolution=0.05, lp=3.0, aa_size=3.8)
Method to create a WormLikeChain 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 number of residues)
p_of_r_resolution (float) – Bin width for bulding probability distributions. In Angstroms.
lp (float) – Persistence length. We use a default of 3 but 4 is also used a lot in the literature.
aa_size (float) – Size of one amino acid (called ‘b’ in the literature). 3.8 is the generally acceptable value used.
- get_end_to_end_distribution()
Defines the end-to-end distribution based on the Worm-like chain (WLC).
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\)). As calculated from the Worm-like chain (WLC) model as defined by Zhou [Zhou2004].
Note mean here is calculated by integrating over P(r) vs r.
- Returns:
Value equal to the mean end-to-end distance
- Return type:
float
- get_root_mean_squared_end_to_end_distance()
Returns the mean end-to-end distance (\(R_e\)). As calculated from the Worm-like chain (WLC) model as defined by Zhou [Zhou2004].
Note mean here is calculated by taking the square root after integrating over P(r) vs r^2.
- Returns:
Value equal to the root-mean-squared end-to-end distance
- Return type:
float