Skip to main content

Definition

The hydrophobic energy is the fraction of atoms belonging to hydrophobic residues within the selected group. Ehydrophobic=NhydrophobicNGE_{\mathrm{hydrophobic}} = \frac{N_{\mathrm{hydrophobic}}}{N_{G}}
  • NhydrophobicN_{\mathrm{hydrophobic}} is the count of atoms belonging to hydrophobic residues (V, I, L, F, M, W) in the group
  • NGN_G is the total atom count in the group
When mode is set to 'surface' or 'core', this fraction is additionally weighted by the mean normalized SASA of the hydrophobic atoms.

Parameters

oracle
FoldingOracle
required
The oracle to use for the energy term.
inheritable
bool
default:"True"
If a new residue is added next to a residue included in this energy term, this dictates whether that new residue could then be added to this energy term.
residues
list[Residue] | None
default:"None"
Which residues to include in the calculation. If not set, simply considers all residues by default.
mode
Literal['surface', 'core', 'all']
default:"'all'"
Selection of which atoms contribute to the hydrophobicity score: - ‘surface’: counts hydrophobic residues at the surface, weighted by normalised SASA - ‘core’: counts hydrophobic residues in the core, weighted by 1 - normalised SASA - ‘all’: counts all hydrophobic residues, no SASA weighting Normalisation uses max_sasa_values['S'] and the probe radius probe_radius_water.
surface_only
bool
default:"False"
Deprecated. Use mode='surface' instead.
core_only
bool
default:"False"
Deprecated. Use mode='core' instead.
weight
float
default:"1.0"
The weight of the energy term.
name
str | None
default:"None"
Optional name to append to the energy term name.

Methods

compute

Parameters
oracles_result
OraclesResultDict
required

Example

import bagel as bg

# Create the folding oracle
esmfold = bg.oracles.ESMFold()

# Penalize surface hydrophobic residues (default mode='all' counts everywhere)
hydrophobic = bg.energies.HydrophobicEnergy(
    oracle=esmfold,
    weight=5.0,
    mode="surface",
)

# Add to a state
state = bg.State(
    chains=[chain],
    energy_terms=[hydrophobic],
    name="my_state",
)