# lamalab-org/polymetrix architecture

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

- Interactive diagram: https://gitdiagram.com/lamalab-org/polymetrix
- Repository: https://github.com/lamalab-org/polymetrix

## Overview

PolyMetriX is a polymer-informatics library for preparing datasets, representing polymer structures, calculating descriptors, comparing polymer–molecule mixtures, and supporting train/test splitting. A typical workflow loads curated glass-transition data or supplies pSMILES, computes polymer-level features, and uses the resulting features and labels for modeling. The graph includes the documented comparison and splitting capabilities. Some implementation details are unsampled; those capabilities are shown without guessing their internal call paths.

Main entry points: [`scripts/data_main.py`](https://github.com/lamalab-org/polymetrix/blob/main/scripts/data_main.py) (Feature data preparation), [`src/polymetrix/featurizers/sidechain_backbone_featurizer.py`](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/sidechain_backbone_featurizer.py) (Polymer part features), [`src/polymetrix/datasets/curated_tg_dataset.py`](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/datasets/curated_tg_dataset.py) (Curated Tg dataset), [`src/polymetrix/featurizers/molecule.py`](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/molecule.py) (Molecule featurizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and splitting"]
  node_dataset["Curated Tg dataset"]
  node_dataset_base["Dataset interface<br/>[dataset.py]"]
  node_splitters["Dataset splitters<br/>[splitters.py]"]
  node_data_prep["Feature data preparation<br/>[data_main.py]"]
end

subgraph group_structure["Chemical structures"]
  node_polymer["Polymer model<br/>[polymer.py]"]
  node_molecule["Molecule model<br/>[molecule.py]"]
end

subgraph group_features["Feature calculation"]
  node_calculator["Feature calculator base<br/>[base_featurizer.py]"]
  node_chemical["Chemical descriptors"]
  node_polymer_features["Polymer part features"]
  node_multiple["Combined featurizer"]
  node_molecule_features["Molecule featurizer<br/>[molecule.py]"]
end

subgraph group_comparison["Mixture comparison"]
  node_comparator["Polymer–molecule comparator<br/>[comparator.py]"]
end

node_user(("Researcher"))
node_zenodo[("Dataset hosting")]

node_user -->|"loads"| node_dataset
node_dataset -->|"downloads CSV"| node_zenodo
node_dataset -->|"implements"| node_dataset_base
node_splitters -->|"reads labels"| node_dataset_base
node_user -->|"runs"| node_data_prep
node_data_prep -->|"parses pSMILES"| node_polymer
node_data_prep -->|"selects descriptors"| node_chemical
node_data_prep -->|"selects polymer features"| node_polymer_features
node_data_prep -->|"combines features"| node_multiple
node_polymer_features -->|"extracts polymer parts"| node_polymer
node_chemical -->|"extends"| node_calculator
node_polymer_features -->|"uses"| node_calculator
node_molecule_features -->|"uses"| node_calculator
node_multiple -->|"invokes"| node_polymer_features
node_user -->|"compares mixture"| node_comparator
node_comparator -->|"uses polymer features"| node_polymer_features
node_comparator -->|"uses molecule features"| node_molecule_features
node_molecule_features -->|"featurizes"| node_molecule

click node_dataset "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/datasets/curated_tg_dataset.py"
click node_dataset_base "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/datasets/dataset.py"
click node_splitters "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/splitters/splitters.py"
click node_data_prep "https://github.com/lamalab-org/polymetrix/blob/main/scripts/data_main.py"
click node_polymer "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/polymer.py"
click node_molecule "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/molecule.py"
click node_calculator "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/base_featurizer.py"
click node_chemical "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/chemical_featurizer.py"
click node_polymer_features "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/sidechain_backbone_featurizer.py"
click node_multiple "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/multiple_featurizer.py"
click node_comparator "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/comparator.py"
click node_molecule_features "https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/molecule.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_dataset,node_dataset_base,node_splitters,node_data_prep toneBlue
class node_polymer,node_molecule,node_zenodo toneAmber
class node_calculator,node_chemical,node_polymer_features,node_multiple,node_molecule_features toneMint
class node_comparator toneRose
class node_user toneIndigo
```

## Components

### Data and splitting

- [Curated Tg dataset](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/datasets/curated_tg_dataset.py): `src/polymetrix/datasets/curated_tg_dataset.py`
- [Dataset interface](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/datasets/dataset.py): `src/polymetrix/datasets/dataset.py`
- [Dataset splitters](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/splitters/splitters.py): `src/polymetrix/splitters/splitters.py`
- [Feature data preparation](https://github.com/lamalab-org/polymetrix/blob/main/scripts/data_main.py): `scripts/data_main.py`

### Chemical structures

- [Polymer model](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/polymer.py): `src/polymetrix/featurizers/polymer.py`
- [Molecule model](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/molecule.py): `src/polymetrix/featurizers/molecule.py`

### Feature calculation

- [Feature calculator base](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/base_featurizer.py): `src/polymetrix/featurizers/base_featurizer.py`
- [Chemical descriptors](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/chemical_featurizer.py): `src/polymetrix/featurizers/chemical_featurizer.py`
- [Polymer part features](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/sidechain_backbone_featurizer.py): `src/polymetrix/featurizers/sidechain_backbone_featurizer.py`
- [Combined featurizer](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/multiple_featurizer.py): `src/polymetrix/featurizers/multiple_featurizer.py`
- [Molecule featurizer](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/molecule.py): `src/polymetrix/featurizers/molecule.py`

### Mixture comparison

- [Polymer–molecule comparator](https://github.com/lamalab-org/polymetrix/blob/main/src/polymetrix/featurizers/comparator.py): `src/polymetrix/featurizers/comparator.py`

### Other components

- **Researcher**
- **Dataset hosting**

## Connections

- Researcher → Curated Tg dataset: loads (evidence: `README.md`)
- Curated Tg dataset → Dataset hosting: downloads CSV (evidence: `src/polymetrix/datasets/curated_tg_dataset.py`)
- Curated Tg dataset → Dataset interface: implements (evidence: `src/polymetrix/datasets/curated_tg_dataset.py`)
- Dataset splitters → Dataset interface: reads labels (evidence: `src/polymetrix/splitters/splitters.py`)
- Researcher → Feature data preparation: runs (evidence: `scripts/data_main.py`)
- Feature data preparation → Polymer model: parses pSMILES (evidence: `scripts/data_main.py`)
- Feature data preparation → Chemical descriptors: selects descriptors (evidence: `scripts/data_main.py`)
- Feature data preparation → Polymer part features: selects polymer features (evidence: `scripts/data_main.py`)
- Feature data preparation → Combined featurizer: combines features (evidence: `scripts/data_main.py`)
- Polymer part features → Polymer model: extracts polymer parts (evidence: `src/polymetrix/featurizers/sidechain_backbone_featurizer.py`)
- Chemical descriptors → Feature calculator base: extends (evidence: `src/polymetrix/featurizers/chemical_featurizer.py`)
- Polymer part features → Feature calculator base: uses (evidence: `src/polymetrix/featurizers/sidechain_backbone_featurizer.py`)
- Molecule featurizer → Feature calculator base: uses (evidence: `src/polymetrix/featurizers/molecule.py`)
- Combined featurizer → Polymer part features: invokes (evidence: `src/polymetrix/featurizers/multiple_featurizer.py`)
- Researcher → Polymer–molecule comparator: compares mixture (evidence: `README.md`)
- Polymer–molecule comparator → Polymer part features: uses polymer features (evidence: `README.md`)
- Polymer–molecule comparator → Molecule featurizer: uses molecule features (evidence: `README.md`)
- Molecule featurizer → Molecule model: featurizes (evidence: `src/polymetrix/featurizers/molecule.py`)
