> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Minimum Free Energy

> Drive a sequence toward more-negative (or less-negative) ViennaRNA minimum free energy.

![Minimum Free Energy](https://proto-bio.github.io/proto-assets/images/constraint/mfe/hero.png)

> [!NOTE]
>
> **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms.

This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.

***

&#x20;Tools Used Tools Used  Source Source  Cite Cite

![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/structure-prediction/viennarna.md)

![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678)

evo-design/proto-language

&#x20;View source

[Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/mfe_constraint.py#L73)

@articlelorenz2011viennarna

```bibtex theme={null}
@article{lorenz2011viennarna,
  title={ViennaRNA Package 2.0},
  author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L},
  journal={Algorithms for Molecular Biology},
  volume={6},
  number={1},
  pages={26},
  year={2011},
  publisher={BioMed Central},
  doi={10.1186/1748-7188-6-26}
}
```

&#x20;Copy citation

Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Score sequences by ViennaRNA minimum free energy.

## API Reference

ConfigMFEConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/mfe_constraint.py#L26)

Configuration for the minimum-free-energy (MFE) constraint.

**direction** `enum` (default: min)

'min' rewards more-negative MFE (more stable); 'max' rewards less structure.

Options: `min`, `max`

**sigmoid\_center** `number` (default: -30.0)

MFE (kcal/mol) mapped to energy 0.5; length-dependent, tune per sequence length.

**sigmoid\_scale** `number` (default: 10.0)

Positive float32-safe width of the sigmoid transform in kcal/mol; larger is gentler.

**temperature** `number` (default: 37.0)

ViennaRNA folding temperature in Celsius.

ReturnsConstraintOutput

One result per sequence. `score` is in `[0.0, 1.0]` (lower is
better in the requested direction); `metadata` carries the raw `mfe` (kcal/mol)
and the ViennaRNA dot-bracket `structure`.

## Usage

```python python icon="python" theme={null}
from proto_language.core import Constraint
from proto_language.constraint import mfe_constraint, MFEConfig

constraint = Constraint(
    inputs=[segment],
    function=mfe_constraint,
    function_config=MFEConfig(
        # Configure parameters here
    ),
)

scores = constraint.evaluate()
```

## Metadata

| Property | Value |
| - | - |
| Key | `mfe` |
| Function | `mfe_constraint` |
| Category | `rna_secondary_structure` |
| Mode | `discrete` |
| Uses GPU | `False` |
| Supported Types | `dna`, `rna` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.