Plugins
RCV can be extended with two kinds of plugins. Place the plugin file in the plugins folder of
the RCV user data folder and restart RCV. Plugins appear in the Plugins menu, as tabs in the right
panel, or as new metrics in the energy panel.
| System | Plugin folder |
|---|---|
| Windows | %APPDATA%\RCV\plugins |
| macOS | ~/Library/Application Support/RCV/plugins |
| Linux | ~/.local/share/rcv/plugins |
Available plugins
| Plugin | Type | Description |
|---|---|---|
| Distance tracker | Built-in | Measure distances between residues and follow them across conformations; each distance becomes a metric. |
| Similarity matrix | Built-in | Pairwise RMSD matrix of all conformations in the ensemble. |
| Tertiary contacts | Python | Counts tertiary contacts and the 5′–3′ end distance for each conformation. Example plugin. |
Have you written a plugin that others could use? Tell us on the Feedback page and we will list it here.
Writing an interface plugin (JavaScript)
An interface plugin is an ES module whose default export has an activate(api) function.
The API gives read-only access to the current ensemble and selection, events (ensemble,
conformation, morph, selection, …), panels, menu items,
overlays, colour schemes and metrics.
// my-plugin.js
export default {
id: 'my-plugin',
name: 'My plugin',
version: '1.0',
description: 'Short description shown in the Plugins menu.',
activate(api) {
api.metrics.register({
key: 'n_residues', label: 'Residues', unit: '', lower_is_better: null,
description: 'Number of residues (example).',
compute: (ens, k) => ens.residues.length,
});
},
};
Writing an analysis plugin (Python)
An analysis plugin defines a PLUGIN dictionary and a compute(sequence, residues)
function that returns one value per metric. residues is a list (5′ to 3′) of
{atom_name: xyz} dictionaries after superposition.
# end_distance.py
import numpy as np
PLUGIN = {
'id': 'end_distance',
'name': 'End distance',
'metrics': [{'key': 'end_to_end', 'label': "5'-3' distance", 'unit': 'Å',
'lower_is_better': None, 'description': "C4'-C4' distance of the chain ends."}],
}
def compute(sequence, residues):
a, b = residues[0].get("C4'"), residues[-1].get("C4'")
if a is None or b is None:
return {'end_to_end': None}
return {'end_to_end': round(float(np.linalg.norm(a - b)), 2)}
The plugin API is version 3 (RCV 0.6 added console commands, annotations, the active palette, surface and
transparency control and chart export; 0.6.1 added per-ensemble metrics and plugin state saved in
.rcv files); plugins written for versions 1 and 2 keep working. The complete
plugin developer guide explains everything; the built-in plugins in
src/rcv/static/plugins
are complete examples.