Skip to main content

Calculates single residue frustration, and mutational frustration of proteins.

Project description

Frustratometer

GitHub Actions Build Status codecov Documentation Status

A python implementation of the protein frustratometer.

XKCD depiction of frustration at the movies
XKCD comic showing a clasic example of frustration at the movie theather

The frustratometer is based on the principle of minimal frustration postulated by Wolynes et al. Proteins have evolved under a selective pressure to fold into a single native structure, which is energetically minimized by the evolutionary process, but also to not fold into the many possible incorrect glassy conformations, where the energy is maximized by the evolutionary process. In that principle it is expected that when we measure the energy of a correctly folded protein, most of the interactions between the amino acids will be minimized, compared to both a different amino acid in the same position (mutational) and the same amino acid in a different position (configurational). When this energy is minimized for a particular residue or interaction we define it to be minimally frustrated.

Under most circunstances amino acids are minimally frustrated in the protein, but pockets where amino acids are of interest for protein function can remain frustrated, as they become minimally frustrated when achieving the corresponding function. In short, a frustrated residue or interaction indicates that the particular amino acid would be minimized under a different environment, which reveals possible competing evolutionary pressures on its selection. We have identified that these pockets usually correspond to regions of functional importance, for example, that may form part of a catalitic domain, a hinge domain, or a binding region.

This principle of minimum frustration has been shown using the AWSEM forcefield but can be extended to any other forcefield, including atomistic forcefields, or energy models derived from coevolutionary analysis, such as DCA-based Potts models, as implemented here.

Installation

Using conda (recommended)

conda install -c conda-forge frustratometer

Using pip

pip install frustratometer

Note: openmm and pdbfixer are not available on PyPI and must be installed separately via conda:

conda install -c conda-forge openmm pdbfixer

From source

git clone https://github.com/HanaJaafari/Frustratometer
cd Frustratometer
conda install -c conda-forge --file requirements.txt
pip install -e .

There are additional packages that can be installed and are detailed in the documentation.

Usage

Loading Protein Structures

The Frustatometer package includes a prody based Structure class to load the structure and calculate the properties needed for the AWSEM and DCA Frustratometers.

import frustratometer

# Define the path to your PDB file
pdb_path = Path('data/my_protein.pdb')
# Load the structure
structure = frustratometer.Structure.full_pdb(pdb_path)
structure.sequence #The sequence of the structure

Creating an AWSEM Model Instance

After loading the structure, create an AWSEM model instance with the desired parameters. Here we provide some typical configurations that can be found elsewhere.

## Single residue frustration with electrostatics
model_singleresidue = frustratometer.AWSEM(structure, min_sequence_separation_contact=2) 
## Single residue frustration without electrostatics
model_singleresidue_noelectrostatics = frustratometer.AWSEM(structure, min_sequence_separation_contact=2, k_electrostatics=0) 
## Mutational/Configurational frustration with electrostatics
model_mutational = frustratometer.AWSEM(structure) 
## Mutational/Configurational frustration without electrostatics
model_mutational_noelectrostatics = frustratometer.AWSEM(structure, k_electrostatics=0)
## Mutational frustration with sequence separation of 12
model_mutational_seqsep12 = frustratometer.AWSEM(structure, min_sequence_separation_rho=13)
## Typical openAWSEM
model_openAWSEM = frustratometer.AWSEM(structure, min_sequence_separation_contact = 10, distance_cutoff_contact = None)

Creating a DCA Model Instance

After loading the structure, create a DCA model instance with the desired parameters. When creating a DCA model instance, you can provide an existing Potts model or a Potts model file (in Matlab format). Additionally, the Frustratometer can generate a Potts model for a given protein via the pydca package.

potts_model_file=Path('data/my_potts_model.mat')

## Using existing potts model file
model_dca = frustratometer.DCA.from_potts_model_file(structure,potts_model_file,distance_cutoff=4,sequence_cutoff=0)

Check the Accuracy of the Potts Model

In order to check the accuracy of the contacts predicted by the Potts model and true contacts from the protein's contact map, the receiver operator curve (ROC) can be generated. If the Potts model has high accuracy, the Area Under the Curve (AUC) of the ROC will be 1.

## Generate the ROC curve
model_dca.plot_roc()

##Calculate AUC of ROC curve
print(model_dca.auc())

Calculating Residue Densities

To calculate the density of residues in the structure.

calculated_densities = model_singleresidue.rho_r
print(calculated_densities)

Calculating Frustration Indices

Frustration indices can be calculated for single residues or mutationally. This measurement helps identify energetically favorable or unfavorable interactions within the protein structure.

Single Residue Frustration

# Calculate single residue AWSEM frustration
single_residue_AWSEM_frustration = model_singleresidue.frustration(kind='singleresidue')
print(single_residue_AWSEM_frustration)

# Calculate single residue DCA frustration
single_residue_DCA_frustration = dca_model.frustration(kind='singleresidue')
print(single_residue_DCA_frustration)

Single Residue Decoy Fluctuation

The frustratometer package also allows the quick calculation of the energies of all single residue and mutational decoys.

# Calculate single residue decoy AWSEM energy fluctuations
AWSEM_decoy_fluctuation = model_singleresidue.decoy_fluctuation(kind='singleresidue')
print(AWSEM_decoy_fluctuation)

# Calculate single residue decoy DCA energy fluctuations
DCA_decoy_fluctuation = dca_model.decoy_fluctuation(kind='singleresidue')
print(DCA_decoy_fluctuation)

Mutational Frustration

# Calculate mutational AWSEM frustration
mutational_AWSEM_frustration = model_mutational.frustration(kind='mutational')
print(mutational_AWSEM_frustration)

# Calculate mutational DCA frustration
mutational_DCA_frustration = dca_model.frustration(kind='mutational')
print(mutational_DCA_frustration)

Energy Calculations

You can calculate different energy contributions, including fields energy (pseudo one-body terms like burial), couplings energy (pseudo two-body terms like contact and electrostatics), and their combination to determine the native energy of the protein structure.

Fields Energy

AWSEM_fields_energy = model_openAWSEM.fields_energy()
print(AWSEM_fields_energy)

DCA_fields_energy = dca_model.fields_energy()
print(DCA_fields_energy)

Couplings Energy

AWSEM_couplings_energy = model_openAWSEM.couplings_energy()
print(AWSEM_couplings_energy)

DCA_couplings_energy = dca_model.couplings_energy()
print(DCA_couplings_energy)

Native Energy

Native energy can be considered as a combination of fields and couplings energy contributions.

AWSEM_native_energy = model_openAWSEM.native_energy()
print(AWSEM_native_energy)

DCA_native_energy = dca_model.native_energy()
print(DCA_native_energy)

Conclusion

The Frustratometer AWSEM package offers many functionalities for analyzing protein structures. By calculating residue densities, frustration indices, and various energy contributions, researchers can gain insights into the stability, energetics, and potentially functional aspects of protein conformations.

Other flavors

The frustratometer has been implemented in other ways by our group:

frustratometer-server

frustratometeR

AWSEM-MD

Atomistic

Copyright

Copyright (c) 2022-2024, Carlos Bueno, Hana Jaafari

Acknowledgements

Carlos Bueno was supported by the MolSSI Software Fellowship, under the mentorship of Jessica Nash. We thank AMD (Advanced Micro Devices, Inc.) for the donation of high-performance computing hardware and HPC resources. This project is also supported by the Center for Theoretical Biological Physics (NSF Grants PHY-2019745 and PHY-1522550), with additional support from the D.R. Bullard Welch Chair at Rice University (Grant No. C-0016 to PGW). Project skeleton based on the [Computational Molecular Science Python Cookiecutter] (https://github.com/molssi/cookiecutter-cms) version 1.6.

References

Atilio O Rausch, Maria I Freiberger, Cesar O Leonetti, Diego M Luna, Leandro G Radusky, Peter G Wolynes, Diego U Ferreiro, R Gonzalo Parra, FrustratometeR: an R-package to compute local frustration in protein structures, point mutants and MD simulations, Bioinformatics, 2021;, btab176, https://doi.org/10.1093/bioinformatics/btab176

Ferreiro DU, Komives EA, Wolynes PG. Frustration, function and folding. Curr Opin Struct Biol. 2018;48: 68–73. doi:10.1016/j.sbi.2017.09.006. PubMed PMID: 29101782

Parra RG, Schafer NP, Radusky LG, Tsai M-Y, Guzovsky AB, Wolynes PG, et al. Protein Frustratometer 2: a tool to localize energetic frustration in protein molecules, now with electrostatics. Nucleic Acids Res. 2016;44: W356-60. doi:10.1093/nar/gkw304. PubMed PMID: 27131359

Wolynes PG. Evolution, energy landscapes and the paradoxes of protein folding. Biochimie. 2015;119: 218–230. doi:10.1016/j.biochi.2014.12.007. PubMed PMID: 25530262

Ferreiro DU, Komives E a., Wolynes PG. Frustration in Biomolecules. Q Rev Biophys. 2013;47: 1–97. doi:10.1017/S0033583514000092. PubMed PMID: 25225856

Jenik M, Parra RG, Radusky LG, Turjanski A, Wolynes PG, Ferreiro DU. Protein frustratometer: A tool to localize energetic frustration in protein molecules. Nucleic Acids Res. 2012;40: 348–351. doi:10.1093/nar/gks447. PubMed PMID: 22645321

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frustratometer-0.3.2.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frustratometer-0.3.2-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file frustratometer-0.3.2.tar.gz.

File metadata

  • Download URL: frustratometer-0.3.2.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for frustratometer-0.3.2.tar.gz
Algorithm Hash digest
SHA256 e20d3b84584449b2caea6c7dcdc3676c07c7abc3114cc49713d7b19c4207e229
MD5 e949a64ccdeacb3b688e9c18d1ffe116
BLAKE2b-256 7b18657dff23324df665da02a2b3fdf1da99e8de82f6b007170015fc443266d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for frustratometer-0.3.2.tar.gz:

Publisher: publish-to-pypi.yml on cabb99/Frustratometer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frustratometer-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: frustratometer-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for frustratometer-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02929f1e39a241dc72e01108aa6eb46d80e6e03a9079e9d39b8f350a46ecdf84
MD5 f416641aad06a51fe82e0e91e160691b
BLAKE2b-256 ef7e92759b99ac4e23897e360c6df7f695e7a7717457878cf090a5dd94948726

See more details on using hashes here.

Provenance

The following attestation bundles were made for frustratometer-0.3.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on cabb99/Frustratometer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page