Contacts Plugin Reference
For a task-oriented setup and run workflow, see Polymer-Protein Contacts Analysis: Quick Start.
Configuration Reference
Contacts plugin settings live under plugins.contacts in comparison.yaml.
Core analysis fields (ContactsSettings)
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
MDAnalysis selection for polymer atoms |
|
|
|
MDAnalysis selection for protein atoms |
|
|
|
Contact distance cutoff in Angstroms |
|
|
|
Optional polymer residue-name filter |
|
|
|
Protein grouping mode: |
|
|
|
Compute residence-time statistics |
Binding preference and partition fields
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Enable binding-preference enrichment pipeline |
|
|
|
Relative SASA threshold for surface exposure |
|
|
|
Optional enzyme PDB path for SASA computation |
|
|
|
Include default AA-class groups |
|
|
|
Custom residue groups, e.g. |
|
|
|
Named partitions of |
|
|
|
Custom polymer type mappings by selection |
|
|
|
Polymer chain ID used for auto-detection |
|
|
|
Deprecated backward-compatibility field (ignored) |
Comparison output fields
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
FDR alpha for Benjamini-Hochberg correction |
|
|
|
Minimum Cohen’s d to flag/highlight |
|
|
|
Number of top residues shown in console output |
Validation notes
groupingmust be one ofaa_class,secondary_structure, ornonefdr_alphamust be between 0 and 1If
protein_partitionsis provided,protein_groupsmust also be providedPartition group names must exist in
protein_groupsResidues cannot overlap across groups within the same partition
Output Files
Contacts results are written under each condition’s analysis directory.
<projects_directory>/
└── analysis/
└── <condition>/
└── contacts/
├── run_1/
│ ├── result.json
│ └── contacts_eq10ns_cut4.5_s<fingerprint>_rep1.json
├── run_2/
│ └── ...
├── run_3/
│ └── ...
├── aggregated/
│ └── result.json
└── contacts_aggregated_eq10ns_cut4.5_s<fingerprint>_reps1-3.json
Depending on cache history and plugin version, legacy file names may also
exist (for example contacts_rep1.json).
Per-replicate JSON structure (ContactResult)
Representative structure:
{
"analysis_type": "contacts",
"residue_contacts": [
{
"protein_resid": 77,
"protein_resname": "SER",
"protein_group": "polar",
"segment_contacts": [
{
"polymer_resname": "SBM",
"polymer_resid": 403,
"polymer_chain_idx": 0,
"events": [{"start_frame": 120, "duration": 9}]
}
],
"statistical_inefficiency": 2.41,
"n_effective": 3733.6
}
],
"n_frames": 9000,
"timestep_ps": 10.0,
"criteria_label": "any_atom_4.5A",
"criteria_cutoff": 4.5,
"start_frame": 1000,
"schema_version": 2,
"metadata": {
"target_selector": "protein",
"query_selector": "chainID C",
"algorithm": "capped_distance"
}
}
Aggregated JSON structure (AggregatedContactResult)
Representative structure:
{
"analysis_type": "contacts_aggregated",
"n_replicates": 3,
"total_frames_per_replicate": [9000, 9000, 9000],
"timestep_ps": 10.0,
"criteria_label": "any_atom_4.5A",
"criteria_cutoff": 4.5,
"coverage_mean": 0.740,
"coverage_sem": 0.011,
"mean_contact_fraction": 0.180,
"mean_contact_fraction_sem": 0.004,
"group_stats": {
"aromatic": [0.242, 0.013],
"polar": [0.168, 0.009]
},
"residence_time_by_polymer_type": {
"SBM": [9.60, 0.53],
"EGM": [8.14, 0.56]
},
"residue_stats": [
{
"protein_resid": 77,
"protein_group": "polar",
"contact_fraction_mean": 0.211,
"contact_fraction_sem": 0.016,
"contact_fraction_per_replicate": [0.201, 0.232, 0.200],
"by_polymer_type": {"SBM": [0.173, 0.012]},
"residence_time_by_polymer_type": {"SBM": [7.2, 0.8]}
}
],
"metadata": {"aggregation_method": "mean_sem"}
}
Plot Types
Contacts plots are generated through the comparison plotting workflow
(polyzymd compare plot-all ...) and controlled by plot_settings.contacts.
Plot outputs
Output stem |
Description |
Gate setting |
|---|---|---|
|
Per-residue contact-fraction profile across conditions |
|
|
Per-residue profile split by polymer type (when multiple polymer types exist) |
|
|
Per-residue mean residence-time profile (ns) |
|
|
Per-residue residence-time profile by polymer type |
|
|
Contact-fraction grouped bars by amino-acid class |
|
|
Contact-fraction grouped bars by user-defined partition |
|
|
Residence-time grouped bars by amino-acid class |
|
|
Residence-time grouped bars by user-defined partition |
|
|
Coverage-enrichment bars by AA class |
|
|
Coverage-enrichment heatmap |
|
|
Coverage-enrichment bars for user partition elements |
|
|
Binding-preference enrichment bars |
|
|
Binding-preference enrichment heatmap |
|
Contacts plot settings
Field |
Default |
Description |
|---|---|---|
|
|
Enable binding-preference heatmap |
|
|
Enable binding-preference bars |
|
|
Enable system-coverage heatmap |
|
|
Enable system-coverage bars |
|
|
Enable user partition bar plots |
|
|
Enable per-residue contact-fraction profiles |
|
|
Enable per-residue residence-time profiles |
|
|
Enable contact-fraction AA-class bars |
|
|
Enable contact-fraction partition bars |
|
|
Enable residence-time AA-class bars |
|
|
Enable residence-time partition bars |
|
|
Residues marked with vertical lines on profile plots |
|
|
Optional threshold line on contact-fraction profile |
Figure-size and error-display fields are also available per plot type (for
example figsize_contact_fraction_profile,
show_contact_fraction_profile_error, figsize_enrichment_bars).
For global plotting keys (style, dpi, output format), see
Comparison and Plotting Reference and comparison.yaml Schema Reference.
Common CLI Options
Option |
Default |
Description |
|---|---|---|
|
|
Path to comparison config |
|
|
Equilibration time to skip |
|
off |
Ignore cache and recompute |
|
|
Output format ( |
|
(none) |
Write formatted output to file |
|
off |
Suppress INFO logs |
|
off |
Enable DEBUG logging |
Typical run command:
polyzymd compare run contacts -f comparison.yaml --eq-time 10ns
Troubleshooting
“No polymer atoms selected”
Cause: polymer_selection does not match any atoms.
Fix:
Verify chain and residue naming in your topology
Start with
polymer_selection: "chainID C"and narrow incrementallyRun with
--debugto inspect selection behavior
“Selection matched no atoms” (protein or polymer)
Cause: Selection syntax is valid but does not match this topology.
Fix:
Check residue numbering and atom/residue naming
Validate that your topology and trajectory belong together
Missing replicate data / replicate skipped
Message: Skipping replicate N: trajectory data not found.
Cause: Missing files or incomplete simulation output for that replicate.
Fix:
Confirm replicate output paths in the condition config
Re-run after simulation completion
Analysis continues with available replicates
“protein_partitions requires protein_groups to be defined”
Cause: Partition references were configured without group definitions.
Fix: Add protein_groups and reference those names in
protein_partitions.
Unexpected cache reuse after changing settings
Cause: Cached files from prior runs are still present.
Fix:
Re-run with
--recomputeOr clear the relevant
analysis/<condition>/contacts/directory
Slow runtime
Cause: Large trajectories and large selections.
Fix:
Increase
--eq-timeto skip equilibration framesRestrict
polymer_selectionand/orprotein_selectionUse cached results for repeated report generation