conservation_view
Colors protein structures by evolutionary conservation using Shannon entropy. Highlights conserved (magenta/blue) and variable (cyan/green) regions from sequence alignment.
Instructions
Colors the structure by evolutionary conservation using Shannon entropy.
Runs a full pipeline: extracts the protein sequence from the loaded structure, submits it to an MMseqs2 server (ColabFold public API by default) for multiple sequence alignment, computes per-residue Shannon entropy, and maps the conservation scores onto the structure via the B-factor column and spectrum coloring.
Entropy scores are cached in memory by sequence, so changing the scale or re-running on the same protein does not require a repeat API call.
Magenta/blue = highly conserved (low entropy), white = moderate, cyan/green = highly variable (high entropy).
NOTE: The first call makes an external API call and may take 30 seconds to several minutes depending on the server and sequence length. Subsequent calls for the same sequence are instant.
Args: obj_name: PyMOL object name (e.g. "1ubq") selection: PyMOL selection to analyze (default "all") server_url: Override the MMseqs2 server URL (defaults to ColabFold public API, or MCPYMOL_MMSEQS_URL env var) use_env: Search environmental databases in addition to UniRef (default True, gives deeper MSAs) chain: Specific chain ID to analyze. If None, uses the first protein chain found. scale: Color scaling mode. "relative" (default) maps the color gradient to the actual min/max entropy range of this protein, maximizing visual contrast. "absolute" uses the full theoretical entropy range (0 to log2(20)), useful when comparing conservation across different proteins. force_refresh: If True, bypass the cache and re-fetch the MSA from the MMseqs2 server even if scores are cached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | ||
| scale | No | relative | |
| use_env | No | ||
| obj_name | Yes | ||
| selection | No | all | |
| server_url | No | ||
| force_refresh | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |