# lcbio/cabsflex_standalone architecture

> Architecture diagram of the GitHub repository lcbio/cabsflex_standalone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lcbio/cabsflex_standalone
- Repository: https://github.com/lcbio/cabsflex_standalone

## Overview

CABS-flex is a command-line protein modeling and simulation framework for protein flexibility, de novo peptide modeling, and flexible peptide–protein docking. The principal user workflow is to provide structure and run options, prepare a protein or peptide complex, run the CABS simulation, then analyze trajectories and produce structural outputs. The graph emphasizes the job orchestrator and documented modeling branches. Source-index references support several implementation links; unsampled details and optional external-tool wiring are not inferred.

Main entry points: [`CABS/core/job.py`](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/job.py) (Job Orchestrator), [`CABS/structures/protein.py`](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/protein.py) (Protein Complex), [`CABS/io/optparser.py`](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/io/optparser.py) (Options Parser), [`CABS/reconstruction/cg2all.py`](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/cg2all.py) (All-Atom Reconstruction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command Line"]
  node_parser["Options Parser<br/>[optparser.py]"]
  node_logger["Logging<br/>[logger.py]"]
  node_job["Job Orchestrator<br/>[job.py]"]
  node_config["Configuration<br/>[config_loader.py]"]
end

subgraph group_model["Model Preparation"]
  node_protein["Protein Complex<br/>[protein.py]"]
  node_pdb["Structure I/O<br/>[pdblib.py]"]
  node_atoms["Atom Model<br/>[atom.py]"]
  node_vectors["3D Geometry<br/>[vector3d.py]"]
  node_secondary["Secondary Structure<br/>[secstrpredictor.py]"]
  node_initialization["Peptide Initialization<br/>[randinit.py]"]
end

subgraph group_simulation["Simulation"]
  node_engine["CABS Engine<br/>[cabs.py]"]
  node_trajectory["Trajectory<br/>[trajectory.py]"]
end

subgraph group_analysis["Analysis"]
  node_clustering["Trajectory Clustering<br/>[cluster.py]"]
  node_contactmap["Contact Maps<br/>[cmap.py]"]
  node_plots["Analysis Plots<br/>[plots.py]"]
  node_restraints["Restraint Analysis<br/>[restraints.py]"]
  node_align["Structure Alignment<br/>[align.py]"]
end

subgraph group_outputs["Reconstruction Outputs"]
  node_ca2all["CA Reconstruction<br/>[ca2all.py]"]
  node_cg2all["All-Atom Reconstruction<br/>[cg2all.py]"]
  node_trajectory_rebuild["Trajectory Reconstruction"]
  node_movie["Trajectory Movies<br/>[movie_script.py]"]
  node_pymol["PyMOL Visualization<br/>[pymol.py]"]
  node_chimerax["ChimeraX Visualization<br/>[chimerax.py]"]
end

node_user(("Researcher"))
node_reconstruction_tool["CG2All Tool"]

node_user -->|"sets options"| node_parser
node_parser -->|"configures run"| node_job
node_parser -->|"loads settings"| node_config
node_parser -->|"reports options"| node_logger
node_job -->|"logs progress"| node_logger
node_job -->|"prepares structures"| node_protein
node_protein -->|"loads structures"| node_pdb
node_protein -->|"builds atom models"| node_atoms
node_protein -->|"uses geometry"| node_vectors
node_protein -->|"predicts structure"| node_secondary
node_protein -->|"initializes peptides"| node_initialization
node_job -->|"runs simulation"| node_engine
node_engine -->|"records frames"| node_trajectory
node_job -->|"processes trajectories"| node_trajectory
node_job -->|"clusters results"| node_clustering
node_job -->|"analyzes contacts"| node_contactmap
node_contactmap -->|"plots maps"| node_plots
node_job -->|"creates plots"| node_plots
node_job -->|"handles restraints"| node_restraints
node_job -->|"aligns structures"| node_align
node_job -->|"reconstructs structures"| node_ca2all
node_job -->|"rebuilds atoms"| node_cg2all
node_job -->|"rebuilds frames"| node_trajectory_rebuild
node_trajectory_rebuild -->|"uses reconstruction"| node_cg2all
node_cg2all -->|"dispatches conversion"| node_reconstruction_tool
node_job -.->|"prepares visualization"| node_movie
node_job -.->|"exports visualization"| node_pymol
node_job -.->|"exports visualization"| node_chimerax

click node_parser "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/io/optparser.py"
click node_logger "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/io/logger.py"
click node_job "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/job.py"
click node_config "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/config_loader.py"
click node_protein "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/protein.py"
click node_pdb "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/pdblib.py"
click node_atoms "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/atom.py"
click node_vectors "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/vector3d.py"
click node_secondary "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/prediction/secstrpredictor.py"
click node_initialization "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/prediction/randinit.py"
click node_engine "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/cabs.py"
click node_trajectory "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/trajectory.py"
click node_clustering "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/cluster.py"
click node_contactmap "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/cmap.py"
click node_plots "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/plots.py"
click node_restraints "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/restraints.py"
click node_align "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/align.py"
click node_ca2all "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/ca2all.py"
click node_cg2all "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/cg2all.py"
click node_trajectory_rebuild "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/cg2all_trajectory.py"
click node_movie "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/movie_script.py"
click node_pymol "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/pymol.py"
click node_chimerax "https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/chimerax.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parser,node_logger,node_job,node_config toneBlue
class node_protein,node_pdb,node_atoms,node_vectors,node_secondary,node_initialization toneAmber
class node_engine,node_trajectory toneMint
class node_clustering,node_contactmap,node_plots,node_restraints,node_align toneRose
class node_ca2all,node_cg2all,node_trajectory_rebuild,node_movie,node_pymol,node_chimerax,node_user,node_reconstruction_tool toneIndigo
```

## Components

### Command Line

- [Options Parser](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/io/optparser.py): `CABS/io/optparser.py`
- [Logging](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/io/logger.py): `CABS/io/logger.py`
- [Job Orchestrator](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/job.py): `CABS/core/job.py`
- [Configuration](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/config_loader.py): `CABS/config_loader.py`

### Model Preparation

- [Protein Complex](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/protein.py): `CABS/structures/protein.py`
- [Structure I/O](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/pdblib.py): `CABS/structures/pdblib.py`
- [Atom Model](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/atom.py): `CABS/structures/atom.py`
- [3D Geometry](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/structures/vector3d.py): `CABS/structures/vector3d.py`
- [Secondary Structure](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/prediction/secstrpredictor.py): `CABS/prediction/secstrpredictor.py`
- [Peptide Initialization](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/prediction/randinit.py): `CABS/prediction/randinit.py`

### Simulation

- [CABS Engine](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/cabs.py): `CABS/core/cabs.py`
- [Trajectory](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/core/trajectory.py): `CABS/core/trajectory.py`

### Analysis

- [Trajectory Clustering](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/cluster.py): `CABS/analysis/cluster.py`
- [Contact Maps](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/cmap.py): `CABS/analysis/cmap.py`
- [Analysis Plots](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/plots.py): `CABS/analysis/plots.py`
- [Restraint Analysis](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/analysis/restraints.py): `CABS/analysis/restraints.py`
- [Structure Alignment](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/align.py): `CABS/utils/align.py`

### Reconstruction Outputs

- [CA Reconstruction](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/ca2all.py): `CABS/reconstruction/ca2all.py`
- [All-Atom Reconstruction](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/cg2all.py): `CABS/reconstruction/cg2all.py`
- [Trajectory Reconstruction](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/reconstruction/cg2all_trajectory.py): `CABS/reconstruction/cg2all_trajectory.py`
- [Trajectory Movies](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/movie_script.py): `CABS/utils/movie_script.py`
- [PyMOL Visualization](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/pymol.py): `CABS/utils/pymol.py`
- [ChimeraX Visualization](https://github.com/lcbio/cabsflex_standalone/blob/main/CABS/utils/chimerax.py): `CABS/utils/chimerax.py`

### Other components

- **Researcher**
- **CG2All Tool**

## Connections

- Researcher → Options Parser: sets options (evidence: `README.md`)
- Options Parser → Job Orchestrator: configures run (evidence: `CABS/__main__.py`)
- Options Parser → Configuration: loads settings (evidence: `CABS/io/optparser.py`)
- Options Parser → Logging: reports options (evidence: `CABS/io/optparser.py`)
- Job Orchestrator → Logging: logs progress (evidence: `CABS/core/job.py`)
- Job Orchestrator → Protein Complex: prepares structures (evidence: `CABS/core/job.py`)
- Protein Complex → Structure I/O: loads structures (evidence: `CABS/structures/protein.py`)
- Protein Complex → Atom Model: builds atom models (evidence: `CABS/structures/protein.py`)
- Protein Complex → 3D Geometry: uses geometry (evidence: `CABS/structures/protein.py`)
- Protein Complex → Secondary Structure: predicts structure (evidence: `CABS/structures/protein.py`)
- Protein Complex → Peptide Initialization: initializes peptides (evidence: `CABS/structures/protein.py`)
- Job Orchestrator → CABS Engine: runs simulation (evidence: `CABS/core/job.py`)
- CABS Engine → Trajectory: records frames (evidence: `CABS/core/cabs.py`)
- Job Orchestrator → Trajectory: processes trajectories (evidence: `CABS/core/job.py`)
- Job Orchestrator → Trajectory Clustering: clusters results (evidence: `CABS/core/job.py`)
- Job Orchestrator → Contact Maps: analyzes contacts (evidence: `CABS/core/job.py`)
- Contact Maps → Analysis Plots: plots maps (evidence: `CABS/analysis/cmap.py`)
- Job Orchestrator → Analysis Plots: creates plots (evidence: `CABS/core/job.py`)
- Job Orchestrator → Restraint Analysis: handles restraints (evidence: `CABS/core/job.py`)
- Job Orchestrator → Structure Alignment: aligns structures (evidence: `CABS/core/job.py`)
- Job Orchestrator → CA Reconstruction: reconstructs structures (evidence: `CABS/core/job.py`)
- Job Orchestrator → All-Atom Reconstruction: rebuilds atoms (evidence: `CABS/core/job.py`)
- Job Orchestrator → Trajectory Reconstruction: rebuilds frames (evidence: `CABS/core/job.py`)
- Trajectory Reconstruction → All-Atom Reconstruction: uses reconstruction (evidence: `CABS/reconstruction/cg2all_trajectory.py`)
- All-Atom Reconstruction → CG2All Tool: dispatches conversion (evidence: `CABS/reconstruction/cg2all.py`)
- Job Orchestrator → Trajectory Movies: prepares visualization (evidence: `CABS/core/job.py`)
- Job Orchestrator → PyMOL Visualization: exports visualization (evidence: `CABS/core/job.py`)
- Job Orchestrator → ChimeraX Visualization: exports visualization (evidence: `CABS/core/job.py`)
