# dc-analysis/dclab architecture

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

- Interactive diagram: https://gitdiagram.com/dc-analysis/dclab
- Repository: https://github.com/dc-analysis/dclab

## Overview

dclab is a Python library for post-measurement analysis of real-time deformability cytometry (RT-DC) datasets. The principal workflow is to open a measurement, expose its events and metadata, derive or select features, filter and analyze events, then write or export results. The tree and README support format handling, scientific analysis, and data-management capabilities; sampled excerpts confirm KDE, polygon filtering, caching, basin support, and writing. Some subsystem wiring is inferred from module roles and documented capabilities; uncertain call relationships are omitted.

Main entry points: [`dclab/rtdc_dataset/core.py`](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/core.py) (RTDC dataset), [`dclab/rtdc_dataset`](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset) (Dataset formats), [`dclab/rtdc_dataset/fmt_dcor`](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_dcor) (Remote formats), [`dclab/rtdc_dataset/load.py`](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/load.py) (Dataset loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Dataset access"]
  node_loader["Dataset loader<br/>[load.py]"]
  node_formats["Dataset formats"]
  node_hdf5["HDF5 format"]
  node_hierarchy["Hierarchical format"]
  node_tdms["TDMS format"]
  node_remote["Remote formats"]
end

subgraph group_model["Dataset model"]
  node_dataset["RTDC dataset<br/>[core.py]"]
  node_config["Metadata and config<br/>[config.py]"]
  node_basins["Basin features"]
end

subgraph group_analysis["Analysis"]
  node_featuredefs["Feature definitions<br/>[feat_logic.py]"]
  node_features["Feature calculations"]
  node_filter["Event filtering<br/>[filter.py]"]
  node_polygon["Polygon selection<br/>[polygon_filter.py]"]
  node_kde["Density contours<br/>[base.py]"]
  node_statistics["Statistics and models<br/>[statistics.py]"]
  node_isoelastics["Isoelasticity lines<br/>[__init__.py]"]
  node_cache[("Analysis cache<br/>[caches.py]")]
end

subgraph group_management["Data management"]
  node_writer["Dataset writer<br/>[writer.py]"]
  node_export["Dataset export<br/>[export.py]"]
  node_cli["Dataset commands"]
end

subgraph group_integration["Integrations"]
  node_dcor(("DCOR service"))
  node_r(("R lme4 runtime"))
end

node_analyst(("Analyst or client"))

node_analyst -->|"opens dataset"| node_loader
node_loader -->|"selects format"| node_formats
node_formats -->|"dispatches"| node_hdf5
node_formats -->|"dispatches"| node_hierarchy
node_formats -->|"dispatches"| node_tdms
node_formats -->|"dispatches"| node_remote
node_hdf5 -->|"provides events"| node_dataset
node_hierarchy -->|"provides events"| node_dataset
node_tdms -->|"provides events"| node_dataset
node_remote -->|"provides events"| node_dataset
node_dataset -->|"exposes metadata"| node_config
node_dataset -->|"provides features"| node_basins
node_dataset -->|"uses definitions"| node_featuredefs
node_dataset -->|"computes features"| node_features
node_dataset -->|"filters events"| node_filter
node_filter -->|"supports polygon selection"| node_polygon
node_dataset -->|"supplies event data"| node_kde
node_kde -->|"caches results"| node_cache
node_analyst -->|"requests analysis"| node_statistics
node_analyst -->|"requests lines"| node_isoelastics
node_dataset -->|"provides data"| node_writer
node_dataset -->|"provides data"| node_export
node_analyst -->|"runs commands"| node_cli
node_cli -->|"writes datasets"| node_writer
node_remote -.->|"requests remote data"| node_dcor
node_analyst -.->|"runs mixed models"| node_r

click node_loader "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/load.py"
click node_formats "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset"
click node_hdf5 "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_hdf5"
click node_hierarchy "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_hierarchy"
click node_tdms "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_tdms"
click node_remote "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_dcor"
click node_dataset "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/core.py"
click node_config "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/config.py"
click node_basins "https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/feat_basin"
click node_featuredefs "https://github.com/dc-analysis/dclab/blob/master/dclab/definitions/feat_logic.py"
click node_features "https://github.com/dc-analysis/dclab/tree/master/dclab/features"
click node_filter "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/filter.py"
click node_polygon "https://github.com/dc-analysis/dclab/blob/master/dclab/polygon_filter.py"
click node_kde "https://github.com/dc-analysis/dclab/blob/master/dclab/kde/base.py"
click node_statistics "https://github.com/dc-analysis/dclab/blob/master/dclab/statistics.py"
click node_isoelastics "https://github.com/dc-analysis/dclab/blob/master/dclab/isoelastics/__init__.py"
click node_cache "https://github.com/dc-analysis/dclab/blob/master/dclab/cached/caches.py"
click node_writer "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/writer.py"
click node_export "https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/export.py"
click node_cli "https://github.com/dc-analysis/dclab/tree/master/dclab/cli"

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_loader,node_formats,node_hdf5,node_hierarchy,node_tdms,node_remote,node_analyst toneBlue
class node_dataset,node_config,node_basins toneAmber
class node_featuredefs,node_features,node_filter,node_polygon,node_kde,node_statistics,node_isoelastics,node_cache toneMint
class node_writer,node_export,node_cli toneRose
class node_dcor,node_r toneIndigo
```

## Components

### Dataset access

- [Dataset loader](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/load.py): `dclab/rtdc_dataset/load.py`
- [Dataset formats](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset): `dclab/rtdc_dataset`
- [HDF5 format](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_hdf5): `dclab/rtdc_dataset/fmt_hdf5`
- [Hierarchical format](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_hierarchy): `dclab/rtdc_dataset/fmt_hierarchy`
- [TDMS format](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_tdms): `dclab/rtdc_dataset/fmt_tdms`
- [Remote formats](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/fmt_dcor): `dclab/rtdc_dataset/fmt_dcor`

### Dataset model

- [RTDC dataset](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/core.py): `dclab/rtdc_dataset/core.py`
- [Metadata and config](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/config.py): `dclab/rtdc_dataset/config.py`
- [Basin features](https://github.com/dc-analysis/dclab/tree/master/dclab/rtdc_dataset/feat_basin): `dclab/rtdc_dataset/feat_basin`

### Analysis

- [Feature definitions](https://github.com/dc-analysis/dclab/blob/master/dclab/definitions/feat_logic.py): `dclab/definitions/feat_logic.py`
- [Feature calculations](https://github.com/dc-analysis/dclab/tree/master/dclab/features): `dclab/features`
- [Event filtering](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/filter.py): `dclab/rtdc_dataset/filter.py`
- [Polygon selection](https://github.com/dc-analysis/dclab/blob/master/dclab/polygon_filter.py): `dclab/polygon_filter.py`
- [Density contours](https://github.com/dc-analysis/dclab/blob/master/dclab/kde/base.py): `dclab/kde/base.py`
- [Statistics and models](https://github.com/dc-analysis/dclab/blob/master/dclab/statistics.py): `dclab/statistics.py`
- [Isoelasticity lines](https://github.com/dc-analysis/dclab/blob/master/dclab/isoelastics/__init__.py): `dclab/isoelastics/__init__.py`
- [Analysis cache](https://github.com/dc-analysis/dclab/blob/master/dclab/cached/caches.py): `dclab/cached/caches.py`

### Data management

- [Dataset writer](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/writer.py): `dclab/rtdc_dataset/writer.py`
- [Dataset export](https://github.com/dc-analysis/dclab/blob/master/dclab/rtdc_dataset/export.py): `dclab/rtdc_dataset/export.py`
- [Dataset commands](https://github.com/dc-analysis/dclab/tree/master/dclab/cli): `dclab/cli`

### Integrations

- **DCOR service**
- **R lme4 runtime**

### Other components

- **Analyst or client**

## Connections

- Analyst or client → Dataset loader: opens dataset
- Dataset loader → Dataset formats: selects format
- Dataset formats → HDF5 format: dispatches
- Dataset formats → Hierarchical format: dispatches
- Dataset formats → TDMS format: dispatches
- Dataset formats → Remote formats: dispatches
- HDF5 format → RTDC dataset: provides events
- Hierarchical format → RTDC dataset: provides events
- TDMS format → RTDC dataset: provides events
- Remote formats → RTDC dataset: provides events
- RTDC dataset → Metadata and config: exposes metadata
- RTDC dataset → Basin features: provides features
- RTDC dataset → Feature definitions: uses definitions
- RTDC dataset → Feature calculations: computes features
- RTDC dataset → Event filtering: filters events
- Event filtering → Polygon selection: supports polygon selection
- RTDC dataset → Density contours: supplies event data
- Density contours → Analysis cache: caches results
- Analyst or client → Statistics and models: requests analysis
- Analyst or client → Isoelasticity lines: requests lines
- RTDC dataset → Dataset writer: provides data
- RTDC dataset → Dataset export: provides data
- Analyst or client → Dataset commands: runs commands
- Dataset commands → Dataset writer: writes datasets
- Remote formats → DCOR service: requests remote data
- Analyst or client → R lme4 runtime: runs mixed models
