Command-line tools
afrc-ensemble
Installing afrc also installs afrc-ensemble, which generates a 3D conformational ensemble (one bead per residue) from any of the package’s polymer models, writes it to disk, and reports how well it reproduces the model:
afrc-ensemble -s MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDI -n 5000 -o p53
This writes p53.pdb (topology and first conformation), p53.xtc (every conformation) and p53_report.txt. The PDB/XTC pair loads directly into mdtraj or SOURSOP; writing the XTC needs mdtraj (pip install "afrc[ensemble]").
Option |
Meaning |
|---|---|
|
Amino acid sequence (required). |
|
Number of conformations (default 1000). |
|
Polymer model to draw from (default |
|
Output prefix; writes |
|
Write a single multi-model PDB instead of a PDB/XTC pair (no mdtraj needed; at most 9999 conformations). |
|
Random seed. Without one a fresh seed is drawn and recorded in the report, so any run can be reproduced. |
|
Length per residue in Å: the bond length |
|
Characteristic ratio ( |
|
Persistence length in Å ( |
|
Size prefactor in Å ( |
|
Flory scaling exponent, between 0 and 1 ( |
A model parameter given for a model that does not use it (--lp with -m afrc, say) is an error.
Models
|
Model |
How the ensemble is generated |
|---|---|---|
|
Exactly: every inter-residue distance is Gaussian, so bead coordinates are drawn from the multivariate Gaussian those distances define. |
|
|
Exactly: bonds of length |
|
|
Exactly: bonds of length |
|
|
Each residue is split into short straight sub-segments that bend like a worm-like chain, finely enough that the mean-squared distances match the continuous chain to within 0.02% (chains that are flexible on the scale of a residue use a correlation between sub-segments that gets there with far fewer of them). Both options generate the same ensemble; they differ only in which analytical P(r) the report compares it with. |
|
|
A Gaussian approximation: the mean-squared distances, \((\texttt{prefactor}\,|i-j|^{\nu})^2\), are exact, but the distance distributions are Gaussian rather than the SAW’s and there is no excluded volume. Genuine self-avoiding conformations would need an explicit simulation. |
The report
The report (printed and saved) checks the ensemble against everything the model fixes exactly, each with a standard error estimated from the ensemble itself:
for every model, the mean-squared distance of every residue pair (in bands of sequence separation) and the root-mean-square \(R_g\) and first-to-last distance that follow from them;
for the AFRC, whose distances are Gaussian, also the mean distances, the Kirkwood-Riseman \(R_h\) and Kolmogorov-Smirnov tests of individual distance distributions;
for models with rigid geometry, exact structural checks: bond lengths (
fjc,frc), bond angles (frc) and finite extensibility (fjc,frc,wlc,wlc2).
A model-like ensemble passes every check (it fails beyond 5 standard errors); across thousands of simulated correct ensembles of every model, none was flagged, while for a 50-residue chain a 2% error in the chain’s size is always caught with 1000 conformations and a 1% error with 5000. The report also lists context that is not expected to match exactly - the model’s own radius of gyration and whole-chain end-to-end distance, and a comparison with its analytical end-to-end distribution, which for most models is an approximation - and model-specific notes, such as that the SAW ensembles are a Gaussian approximation. Ensembles of fewer than 100 conformations are reported but not assessed.
From Python, every model offers the same pieces: sample_conformations(), save_ensemble(), check_ensemble() (which returns the report) and get_mean_squared_distance_map().