> ## 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.

# PyRosetta SAP

> Penalize surface aggregation propensity (SAP) of one chain of an attached structure

![PyRosetta SAP](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-sap/hero.png)

> [!NOTE]
>
> **License:** PyRosetta is licensed under Custom (PyRosetta Software License) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://www.pyrosetta.org/home/licensing-pyrosetta) 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/pyrosetta/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/structure-scoring/pyrosetta.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/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/protein_structure/structure_developability_constraint.py#L246)

@articlechaudhury2010pyrosetta

```bibtex theme={null}
@article{chaudhury2010pyrosetta,
  title={PyRosetta: a script-based interface for implementing molecular modeling algorithms using Rosetta},
  author={Chaudhury, Sidhartha and Lyskov, Sergey and Gray, Jeffrey J},
  journal={Bioinformatics},
  volume={26},
  number={5},
  pages={689--691},
  year={2010},
  publisher={Oxford University Press},
  doi={10.1093/bioinformatics/btq007}
}
```

&#x20;Copy citation

Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Score one chain's SAP score (lower is more soluble).

`chain` is cut out of the attached structure (`Structure.select_chain`) and SAP is
computed on that chain alone, so other chains add no residues and no burial context.
The SAP score is mapped to `min(1, sap / max_sap_score)`.

## API Reference

ConfigPyRosettaSAPConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/protein_structure/structure_developability_constraint.py#L204)

Config for the PyRosetta SAP (aggregation propensity) constraint.

**chain** `string`

Chain to score in the attached structure; None uses the chain matching the input.

**max\_sap\_score** `number` (default: 50.0)

SAP score mapped to the worst score 1.0 (score = min(1, sap / max\_sap\_score)).

**pyrosetta\_config** `PyRosettaSAPConfig`

PyRosetta SAP configuration.

ReturnsConstraintOutput

Per-proposal score in `[0, 1]` with
`sap_score` / `sap_chain` metadata.

## Usage

```python python icon="python" theme={null}
>>> from proto_language.core import Constraint, Segment
>>> protein = Segment(length=80, sequence_type="protein")
>>> sap = Constraint(
...     inputs=[protein],
...     function=pyrosetta_sap_constraint,
...     function_config={"max_sap_score": 40.0},
... )
```

## Metadata

| Property | Value |
| - | - |
| Key | `pyrosetta-sap` |
| Function | `pyrosetta_sap_constraint` |
| Category | `protein_structure` |
| Mode | `discrete` |
| Uses GPU | `False` |
| Supported Types | `protein` |


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