Skip to main content

Documentation Status codecov Build Status PyPI - Version Downloads status License: GPL v2 Google Colab doi

About Alphafold Analysis

AF Analysis Logo

af-analysis is a python package for the analysis of AlphaFold protein structure predictions. This package is designed to simplify and streamline the process of working with protein structures generated by:

Source code repository: https://github.com/samuelmurail/af_analysis

Statement of Need

AlphaFold 2 and its derivatives have revolutionized protein structure prediction, achieving remarkable accuracy. Analyzing the abundance of resulting structural models can be challenging and time-consuming. Existing tools often require separate scripts for calculating various quality metrics (pDockQ, pDockQ2, LIS score) and assessing model diversity. af-analysis addresses these challenges by providing a unified and user-friendly framework for in-depth analysis of AlphaFold 2 results.

Main features

  • Import AlphaFold or ColabFold prediction directories as pandas DataFrames for efficient data handling.
  • Calculate and add additional structural quality metrics to the DataFrame, including:
    • pDockQ
    • pDockQ2
    • LIS score (cLIS and iLIS scores)
    • ipSAE (and the ipTM matrix derived from PAE)
  • Visualize predicted protein models.
  • Cluster generated models to identify diverse conformations.
  • Select the best models based on defined criteria.
  • Add your custom metrics to the DataFrame for further analysis.

Installation

  • af-analysis is available on PyPI and can be installed using pip:
pip install af_analysis
  • You can install last version from the github repo:
pip install git+https://github.com/samuelmurail/af_analysis.git@main
  • AF-Analysis can also be installed easily through github:
git clone https://github.com/samuelmurail/af_analysis
cd af_analysis
pip install .

Optional GUI (Flask)

You can install and launch the GUI with:

pip install "af-analysis[gui]"
af_analysis_gui

Then open http://127.0.0.1:5000 in your browser. The GUI allows loading result folders, viewing tables, selecting models, and plotting pLDDT/PAE.

  • For developers, you can install the package in editable mode:
git clone https://github.com/samuelmurail/af_analysis
cd af_analysis
pip install -e .

Conda environment

A conda environment file is provided to create an environment with all dependencies:

conda env create -f environment.yml
conda activate af_analysis

Documentation

The complete documentation is available at ReadTheDocs.

  • A notebook showing the basic usage of the af_analysis library can be found here.

  • Alternatively you can test is directly on Google colab:

    Google Colab

Usage

Importing data

Create the Data object, giving the path of the directory containing the results of the alphafold2/colabfold run.

import af_analysis
my_data = af_analysis.Data('MY_AF_RESULTS_DIR')

In most cases, the Data object will automatically detect the format of the results (AlphaFold 2, AlphaFold 3, ColabFold). If needed, you can specify the format using the format argument:

my_data = af_analysis.Data('MY_AF_RESULTS_DIR', format='afpulldown')

Extracted data are available in the df attribute of the Data object.

my_data.df

Analysis

  • The analysis package contains several function to add metrics like pdockQ and pdockQ2:
from af_analysis import analysis
analysis.pdockq(my_data)
analysis.pdockq2(my_data)

Docking Analysis

  • The docking package contains several function to add metrics like LIS Score and ipSAE:
from af_analysis import docking
docking.LIS_pep(my_data)
docking.ipSAE(my_data)

Plots

  • At first approach the user can visualize the pLDDT, PAE matrix and the model scores. The show_info() function displays the scores of the models, as well as the pLDDT plot and PAE matrix in a interactive way.
Interactive Visualization
  • plot msa, plddt and PAE:
my_data.plot_msa()
my_data.plot_plddt([0,1])
best_model_index = my_data.df['ranking_confidence'].idxmax()
my_data.plot_pae(best_model_index)
  • show 3D structure (nglview package required):
my_data.show_3d(my_data.df['ranking_confidence'].idxmax())

GUI

af-analysis includes an optional web-based graphical user interface (GUI) built with Flask. It allows you to load result folders, browse model tables, select models, and plot pLDDT and PAE interactively — without writing any code.

Model structures can also be visualized in 3D using Mol* directly in the browser. The GUI is designed to be user-friendly and accessible to researchers who may not be comfortable with command-line tools.

pdockq2, LIS score, and ipSAE can also be calculated directly from the GUI, allowing users to quickly assess the quality of their models and make informed decisions about which ones to focus on for further analysis.

AF Analysis GUI

Install and launch the GUI with:

pip install "af-analysis[gui]"
af_analysis_gui

Then open http://127.0.0.1:5000 in your browser.

Dependencies

af_analysis requires the following dependencies:

  • pdb_cpp
  • pandas
  • numpy
  • tqdm
  • seaborn
  • cmcrameri
  • nglview
  • ipywidgets
  • mdanalysis

as well as the optional dependencies for the GUI:

  • Flask
  • plotly

Contributing

af-analysis is an open-source project and contributions are welcome. If you find a bug or have a feature request, please open an issue on the GitHub repository at https://github.com/samuelmurail/af_analysis. If you would like to contribute code, please fork the repository and submit a pull request.

Authors

See also the list of contributors who participated in this project.

Release a new package version - Only for maintainers

To release a new version of the package, follow these steps:

  1. Commit the changes and push to GitHub:
git add .
git commit -m "Update of ..."
git push origin main
  1. Update the version number in using bump-my-version:
bump-my-version bump <part>

where <part> is one of major, minor, or patch depending on the type of release.

  1. Commit the changes and push to GitHub:
git add .
git commit -m "Bump version to x.y.z"
git push origin main
  1. Create the pypi package and upload it:
make release

Remember that a valid .pypirc file must be present in your home directory with the correct credentials.

Citing this work

If you use the code of this package, please cite:

  • Reguei A and Murail S. Af-analysis: a Python package for Alphafold analysis.
    Journal of Open Source Software (2025) doi: 10.21105/joss.07577
@Article{reguei_af-analysis_2025,
	title = {Af-analysis: a {Python} package for {Alphafold} analysis},
	volume = {10},
	issn = {2475-9066},
	shorttitle = {Af-analysis},
	url = {https://joss.theoj.org/papers/10.21105/joss.07577},
	doi = {10.21105/joss.07577},
	language = {en},
	number = {107},
	urldate = {2025-03-14},
	journal = {Journal of Open Source Software},
	author = {Reguei, Alaa and Murail, Samuel},
	month = mar,
	year = {2025},
	pages = {7577},
}

License

This project is licensed under the GNU General Public License version 2 - see the LICENSE file for details.

References

TODO

  • check with the original implementation of pDockQ2 that the results are the same
  • Same for LIS/LIA

Metadata

Release files for af-analysis 0.2.1

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

Source distribution (sdist)

Source distribution for af-analysis 0.2.1
File Size Uploaded Provenance
af_analysis-0.2.1.tar.gz 2.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for af-analysis 0.2.1
File Interpreter ABI Platform
af_analysis-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 MB

Release files / af_analysis-0.2.1.tar.gz

Download URL af_analysis-0.2.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
bd868295bafb6101e6eeaeef1e4596eb3f88be7c729b00ca508a4c2600724781
BLAKE2b-256 checksum
How to use checksums
7e7f2927c7900cdc7d0ab024bdb03759b32cf00332dd99847bbb69d9d47db4ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / af_analysis-0.2.1-py3-none-any.whl

Download URL af_analysis-0.2.1-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b1bf0e6e1515424c3510d1c2e7bb8a2d17d5b06d6b4414012d67e9287d352158
BLAKE2b-256 checksum
How to use checksums
c1eba5bf14740d1e0c9df99e63a1e557194b59f30f2d5c930dfdce8fc5bc816a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for af-analysis 0.2.1

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.

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