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 aggregate residence-time summaries and plots |
Set compute_residence_times: false to skip aggregate residence-time summaries
and residence-time plotters. Per-replicate contact events remain stored because
they are the compressed representation used for contact fractions and
contacts-derived analyses. The setting is validated through the canonical
contacts detection fingerprint recorded in replicate and condition artifacts.
Partition fields
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Custom residue groups, e.g. |
|
|
|
Named partitions of |
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
│ └── sidecars/
│ └── contact_events.npz
├── run_2/
│ └── ...
├── run_3/
│ └── ...
├── aggregated/
│ ├── result.json
│ └── sidecars/
│ └── contact_profiles.npz
Legacy standalone JSON filenames from pre-artifact contacts runs are no longer loaded by the v1.3 contacts workflow. Recompute contacts to produce canonical artifact-store outputs.
Per-replicate JSON structure (ReplicateArtifact)
Representative structure:
{
"analysis_name": "contacts",
"replicate": 1,
"payload": {
"metrics": {"coverage": 0.74, "mean_contact_fraction": 0.18},
"event_sidecar": "sidecars/contact_events.npz",
"n_contact_events": 1240,
"n_frames_used": 9000
},
"sidecars": [{"path": "sidecars/contact_events.npz", "metadata": {"kind": "contact_events"}}],
"metadata": {
"contacts_detection_fingerprint": "...",
"equilibration": "10ns"
}
}
Aggregated JSON structure (ConditionArtifact)
Representative structure:
{
"analysis_name": "contacts",
"condition_label": "PEGylated",
"replicates": [1, 2, 3],
"payload": {
"metrics": {
"coverage": {"values": [0.73, 0.75, 0.74], "mean": 0.74, "sem": 0.01},
"mean_contact_fraction": {"values": [0.17, 0.19, 0.18], "mean": 0.18, "sem": 0.01}
},
"residue_stats": [
{
"protein_resid": 77,
"protein_group": "polar",
"contact_fraction_mean": 0.211,
"contact_fraction_per_replicate": [0.201, 0.232, 0.200]
}
],
"profile_sidecar": "sidecars/contact_profiles.npz",
"residence_time_by_polymer_type": {
"SBM": {"mean_ns": 9.60, "sem_ns": 0.53}
}
},
"metadata": {
"contacts_detection_fingerprint": "...",
"compute_residence_times": true,
"equilibration": "10ns"
}
}
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 |
|
Contacts plot settings
Field |
Default |
Description |
|---|---|---|
|
|
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 and
show_contact_fraction_profile_error).
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