# ucd-softmatterlab/npcoronapredict architecture

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

- Interactive diagram: https://gitdiagram.com/ucd-softmatterlab/npcoronapredict
- Repository: https://github.com/ucd-softmatterlab/npcoronapredict

## Overview

NPCoronaPredict predicts nanoparticle–biomolecule corona composition through a coarse-grained adsorption calculation followed by kinetic Monte Carlo. Its documented unified workflow maps UnitedAtom adsorption energies to CoronaKMC rate constants; the repository also includes nanoparticle and protein preparation tools and graphical interfaces. The main UnitedAtom entry point visibly loads configuration, targets, and surface PMFs. Pipeline links follow the README; unsampled scripts and GUI command targets are not inferred beyond the evidence shown.

Main entry points: [`src/main.cpp`](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/main.cpp) (Adsorption engine), [`NPCoronaPredict.py`](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPCoronaPredict.py) (Unified pipeline), [`RunUA.py`](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/RunUA.py) (UnitedAtom runner), [`BuildCoronaParams.py`](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/BuildCoronaParams.py) (Rate parameter mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Model preparation"]
  node_proteinprep["Protein preparation"]
  node_npgen["Nanoparticle generation"]
end

subgraph group_ua["UnitedAtom adsorption"]
  node_unified["Unified pipeline<br/>[NPCoronaPredict.py]"]
  node_uaentry["UnitedAtom runner<br/>[RunUA.py]"]
  node_uacore["Adsorption engine<br/>[main.cpp]"]
  node_config["Configuration and inputs<br/>[Config.h]"]
  node_pdb["Protein structure reader<br/>[PDBFile.h]"]
  node_npfile["Nanoparticle reader<br/>[NPFile.h]"]
  node_potentials["Interaction potentials<br/>[Potentials.h]"]
  node_surface["Surface PMFs<br/>[Surface.h]"]
  node_energyavg["Surface energy averaging"]
end

subgraph group_corona["Corona prediction"]
  node_rateparams["Rate parameter mapping"]
  node_kmc["Corona KMC<br/>[CoronaKMC.py]"]
  node_ratesolver["Rate solver"]
  node_stats["Corona statistics<br/>[CoronaStats.py]"]
  node_results["Corona composition<br/>[GetCoronaStats.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_designer["Nanoparticle designer<br/>[mainwindow.cpp]"]
  node_gui["Prediction GUI<br/>[mainwindow.cpp]"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs pipeline"| node_unified
node_unified -->|"runs UnitedAtom"| node_uaentry
node_uaentry -.->|"invokes"| node_uacore
node_uacore -->|"loads configuration"| node_config
node_uacore -->|"reads structures"| node_pdb
node_uacore -->|"reads nanoparticle"| node_npfile
node_uacore -->|"uses potentials"| node_potentials
node_uacore -->|"loads surface PMFs"| node_surface
node_unified -->|"maps energies"| node_rateparams
node_rateparams -->|"supplies rates"| node_kmc
node_kmc -->|"predicts abundances"| node_results
node_researcher -.->|"prepares targets"| node_proteinprep
node_researcher -->|"generates particles"| node_npgen
node_researcher -.->|"designs particles"| node_designer
node_researcher -.->|"runs prediction"| node_gui
node_gui -.->|"launches calculation"| node_uaentry
node_researcher -.->|"averages surfaces"| node_energyavg
node_researcher -.->|"solves rates"| node_ratesolver
node_researcher -.->|"analyzes corona"| node_stats

click node_proteinprep "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/PreprocessProteins.py"
click node_npgen "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPGenerator/GenerateNanoparticle.py"
click node_designer "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPDesigner/src/mainwindow.cpp"
click node_gui "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPCoronaPredict-GUI/src/mainwindow.cpp"
click node_unified "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPCoronaPredict.py"
click node_uaentry "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/RunUA.py"
click node_uacore "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/main.cpp"
click node_config "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Config.h"
click node_pdb "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/PDBFile.h"
click node_npfile "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/NPFile.h"
click node_potentials "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Potentials.h"
click node_surface "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Surface.h"
click node_energyavg "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/MultiSurfaceAverage.py"
click node_rateparams "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/BuildCoronaParams.py"
click node_kmc "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaKMC.py"
click node_ratesolver "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaRateSolver.py"
click node_stats "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaStats.py"
click node_results "https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/GetCoronaStats.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_proteinprep,node_npgen toneBlue
class node_unified,node_uaentry,node_uacore,node_config,node_pdb,node_npfile,node_potentials,node_surface,node_energyavg toneAmber
class node_rateparams,node_kmc,node_ratesolver,node_stats,node_results toneMint
class node_designer,node_gui toneRose
class node_researcher toneIndigo
```

## Components

### Model preparation

- [Protein preparation](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/PreprocessProteins.py): `PreprocessProteins.py`
- [Nanoparticle generation](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPGenerator/GenerateNanoparticle.py): `NPGenerator/GenerateNanoparticle.py`

### UnitedAtom adsorption

- [Unified pipeline](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPCoronaPredict.py): `NPCoronaPredict.py`
- [UnitedAtom runner](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/RunUA.py): `RunUA.py`
- [Adsorption engine](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/main.cpp): `src/main.cpp`
- [Configuration and inputs](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Config.h): `src/Config.h`
- [Protein structure reader](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/PDBFile.h): `src/PDBFile.h`
- [Nanoparticle reader](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/NPFile.h): `src/NPFile.h`
- [Interaction potentials](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Potentials.h): `src/Potentials.h`
- [Surface PMFs](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/src/Surface.h): `src/Surface.h`
- [Surface energy averaging](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/MultiSurfaceAverage.py): `MultiSurfaceAverage.py`

### Corona prediction

- [Rate parameter mapping](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/BuildCoronaParams.py): `BuildCoronaParams.py`
- [Corona KMC](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaKMC.py): `CoronaKMC.py`
- [Rate solver](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaRateSolver.py): `CoronaRateSolver.py`
- [Corona statistics](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/CoronaStats.py): `CoronaStats.py`
- [Corona composition](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/GetCoronaStats.py): `GetCoronaStats.py`

### User interfaces

- [Nanoparticle designer](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPDesigner/src/mainwindow.cpp): `NPDesigner/src/mainwindow.cpp`
- [Prediction GUI](https://github.com/ucd-softmatterlab/npcoronapredict/blob/main/NPCoronaPredict-GUI/src/mainwindow.cpp): `NPCoronaPredict-GUI/src/mainwindow.cpp`

### Other components

- **Researcher**

## Connections

- Researcher → Unified pipeline: runs pipeline
- Unified pipeline → UnitedAtom runner: runs UnitedAtom
- UnitedAtom runner → Adsorption engine: invokes
- Adsorption engine → Configuration and inputs: loads configuration (evidence: `src/main.cpp`)
- Adsorption engine → Protein structure reader: reads structures (evidence: `src/main.cpp`)
- Adsorption engine → Nanoparticle reader: reads nanoparticle (evidence: `src/main.cpp`)
- Adsorption engine → Interaction potentials: uses potentials (evidence: `src/main.cpp`)
- Adsorption engine → Surface PMFs: loads surface PMFs (evidence: `src/main.cpp`)
- Unified pipeline → Rate parameter mapping: maps energies
- Rate parameter mapping → Corona KMC: supplies rates
- Corona KMC → Corona composition: predicts abundances
- Researcher → Protein preparation: prepares targets
- Researcher → Nanoparticle generation: generates particles (evidence: `NPGenerator/GenerateNanoparticle.py`)
- Researcher → Nanoparticle designer: designs particles
- Researcher → Prediction GUI: runs prediction
- Prediction GUI → UnitedAtom runner: launches calculation
- Researcher → Surface energy averaging: averages surfaces
- Researcher → Rate solver: solves rates
- Researcher → Corona statistics: analyzes corona
