Skip to main content

AFRC logo

afrc

The Analytical Flory Random Coil — a sequence-specific reference model for unfolded and intrinsically disordered proteins.

PyPI version Supported Python versions Documentation status License: LGPL v3


Overview

afrc implements the Analytical Flory Random Coil (AFRC): a closed-form, sequence-specific polymer model that reports the dimensions a polypeptide would adopt if it behaved as an ideal chain in a theta solvent (scaling exponent of 0.5, no finite-size effects). Given only an amino acid sequence, it instantly returns:

  • mean end-to-end distance, radius of gyration and hydrodynamic radius (Kirkwood-Riseman or Nygaard et al.), plus the full end-to-end and radius of gyration distributions
  • the mean distance and distance distribution between any pair of residues, as well as distance maps and internal scaling profiles
  • inter-residue contact fractions and contact maps
  • expected paramagnetic relaxation enhancement (PRE) profiles

The AFRC is a reference (null) model, not a predictor of real dimensions. Real unfolded-state dimensions depend on sequence-encoded chain-chain and chain-solvent interactions that the AFRC deliberately omits. Deviations of a simulation or experiment from the AFRC therefore report directly on those interactions, and normalizing to the AFRC puts chains of different length and composition on a common footing.

The package also ships a family of classic analytical polymer models with a common interface, so you can compare one sequence against several reference models.

Installation

afrc requires Python 3.10 or later (tested through Python 3.14) and depends only on NumPy and SciPy.

pip install afrc

Quick start

from afrc import AnalyticalFRC

# create an AnalyticalFRC object from a sequence
P = AnalyticalFRC('MEEPQSDPSVEPPLSQETFSDLWKLLPENNVLSPLPSQAMDDLMLSPDDI')

# ensemble-average dimensions (Angstroms)
mean_rg  = P.get_mean_radius_of_gyration()
mean_e2e = P.get_mean_end_to_end_distance()
mean_rh  = P.get_mean_hydrodynamic_radius()

# full probability distributions, returned as (distances, probabilities)
rg_r,  rg_p  = P.get_radius_of_gyration_distribution()
re_r,  re_p  = P.get_end_to_end_distribution()

# distribution of the distance between two specific residues (indices start at 0)
d_r, d_p = P.get_interresidue_distance_distribution(4, 20)

# whole-chain maps
distance_map = P.get_distance_map()
contact_map  = P.get_contact_map(15.0)   # contact fractions at a 15 A threshold

Polymer models included

Every model takes an amino acid sequence and exposes a common interface (get_end_to_end_distribution, get_mean_end_to_end_distance, ...), so they can be swapped in and compared directly.

Model Import Description
Analytical Flory Random Coil from afrc import AnalyticalFRC Sequence-specific ideal (theta-state) chain; the reference null model.
Freely jointed chain from afrc.polymer_models.fjc import FreelyJointedChain Ideal chain with finite extensibility (non-Gaussian Kuhn–Grün).
Freely rotating chain from afrc.polymer_models.frc import FreelyRotatingChain Ideal chain with a tunable characteristic ratio (stiffness).
Worm-like chain (Zhou) from afrc.polymer_models.wlc import WormLikeChain Semiflexible chain parameterized by a persistence length.
Worm-like chain (O'Brien) from afrc.polymer_models.wlc2 import WormLikeChain2 Semiflexible chain; exact finite extensibility, also gives Rg.
Self-avoiding walk from afrc.polymer_models.saw import SAW Good-solvent (excluded-volume) chain at a fixed scaling exponent.
nu-dependent SAW from afrc.polymer_models.nudep_saw import NuDepSAW Excluded-volume chain with a tunable Flory scaling exponent.

The full mathematical formalism, parameters and usage examples for each model are in the documentation.

Google Colab

Use the AFRC (and the other polymer models) directly in a Google Colab notebook.

Documentation

Full documentation — a theory section (formalism, parameters, references) and an application section (usage examples and code reference) for every model — is hosted at afrc.readthedocs.io. Worked, plotted examples for each model are in the demo/ directory, and the release history is in changelog.md.

Citation

If you use the AFRC in your work, please cite:

Alston, J. J., Ginell, G. M., Soranno, A., & Holehouse, A. S. (2023). The Analytical Flory Random Coil is a simple-to-use reference model for unfolded and disordered proteins. The Journal of Physical Chemistry B, 127(21), 4746–4760. https://doi.org/10.1021/acs.jpcb.3c01619

Help and contributing

If you find a bug or have a feature request, please open an issue on GitHub. To run the test suite, install from a clone of the repository with the test extras (pip install -e ".[test]") and run pytest.

Authors

The AFRC was developed by Garrett Ginell, Jhullian Alston, and Alex Holehouse in the Holehouse Lab.

License

Distributed by the Holehouse Lab under the GNU Lesser General Public License (LGPL v3).

References

  • Alston, J. J., Ginell, G. M., Soranno, A., & Holehouse, A. S. (2023). The Analytical Flory Random Coil is a simple-to-use reference model for unfolded and disordered proteins. J. Phys. Chem. B, 127(21), 4746–4760.
  • Flory, P. J. (1969). Statistical Mechanics of Chain Molecules. Wiley-Interscience.
  • Mao, A. H., Lyle, N., & Pappu, R. V. (2013). Describing sequence–ensemble relationships for intrinsically disordered proteins. Biochemical Journal, 449(2), 307–318.

Metadata

Release files for afrc 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for afrc 0.4.3
File Size Uploaded Provenance
afrc-0.4.3.tar.gz 61.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for afrc 0.4.3
File Interpreter ABI Platform
afrc-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 140.2 kB

Release files / afrc-0.4.3.tar.gz

Download URL afrc-0.4.3.tar.gz
Size 61.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3f150813f96d84a8aa1978372f41e9837588904a92426c834990fa2c1b07e92d
BLAKE2b-256 checksum
How to use checksums
b092095a4c58e23c95c5cb80322a9e00c5290661965d1274d0a132c5746c2665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / afrc-0.4.3-py3-none-any.whl

Download URL afrc-0.4.3-py3-none-any.whl
Size 78.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ce20fca569f9251c3f50d89d36be32478ef44d8671e8aecf21925c7cbdcf662
BLAKE2b-256 checksum
How to use checksums
11f7a75c14e896847a34fbbbcb45e1859bcd56d78b0ab2da6be23d8405553927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for afrc 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page