# segatalab/metaml architecture

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

- Interactive diagram: https://gitdiagram.com/segatalab/metaml
- Repository: https://github.com/segatalab/metaml

## Overview

MetAML is a command-line toolkit for predicting microbiome phenotypes and assessing microbiome–phenotype associations. A user can select samples and features from a profile, run classification or regression with model/feature selection and cross-validation, then inspect metrics and feature-importance visualizations. The repository also includes marker-to-clade conversion and plotting utilities. The README documents cross-study analysis and public metagenome profiles; the excerpts do not establish how cross-study orchestration is implemented, so that capability is represented without guessed internal links.

Main entry points: [`classification.py`](https://github.com/segatalab/metaml/blob/master/classification.py) (Evaluation results), [`dataset_selection.py`](https://github.com/segatalab/metaml/blob/master/dataset_selection.py) (Dataset selection), [`tools/plot_barchart.py`](https://github.com/segatalab/metaml/blob/master/tools/plot_barchart.py) (Feature bar chart), [`tools/plot_correlation.py`](https://github.com/segatalab/metaml/blob/master/tools/plot_correlation.py) (Abundance correlation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Profiles and data"]
  node_profiles[("Metagenome profiles")]
  node_selection["Dataset selection"]
end

subgraph group_analysis["Prediction analysis"]
  node_classification["Classification<br/>[classification.py]"]
  node_classification_tm["Classification variant"]
  node_regression["Regression<br/>[regression_dev.py]"]
  node_metrics["Evaluation results<br/>[classification.py]"]
end

subgraph group_tools["Interpretation tools"]
  node_marker_conversion["Marker conversion<br/>[markers2clades.py]"]
end

subgraph group_visuals["Result visualization"]
  node_barchart["Feature bar chart<br/>[plot_barchart.py]"]
  node_correlation["Abundance correlation"]
  node_roc["ROC curves<br/>[plot_roccurves.py]"]
  node_heatmap["Annotated heatmap"]
end

node_user(("Analyst"))
node_plots["Plots"]

node_user -->|"selects data"| node_selection
node_user -.->|"runs prediction"| node_classification
node_user -.->|"runs prediction"| node_classification_tm
node_user -.->|"runs regression"| node_regression
node_profiles -.->|"supplies profiles"| node_selection
node_selection -.->|"prepares profiles"| node_classification
node_classification -->|"writes metrics"| node_metrics
node_classification -.->|"writes estimates"| node_roc
node_metrics -->|"reads importance"| node_marker_conversion
node_metrics -->|"reads results"| node_barchart
node_metrics -->|"reads importance"| node_correlation
node_metrics -.->|"plots results"| node_heatmap
node_roc -->|"produces curves"| node_plots
node_barchart -->|"produces chart"| node_plots
node_correlation -->|"produces scatter"| node_plots
node_heatmap -->|"produces heatmap"| node_plots

click node_profiles "https://github.com/segatalab/metaml/tree/master/data"
click node_selection "https://github.com/segatalab/metaml/blob/master/dataset_selection.py"
click node_classification "https://github.com/segatalab/metaml/blob/master/classification.py"
click node_classification_tm "https://github.com/segatalab/metaml/blob/master/classification_thomas-manghi.py"
click node_regression "https://github.com/segatalab/metaml/blob/master/regression_dev.py"
click node_metrics "https://github.com/segatalab/metaml/blob/master/classification.py"
click node_marker_conversion "https://github.com/segatalab/metaml/blob/master/tools/markers2clades.py"
click node_barchart "https://github.com/segatalab/metaml/blob/master/tools/plot_barchart.py"
click node_correlation "https://github.com/segatalab/metaml/blob/master/tools/plot_correlation.py"
click node_roc "https://github.com/segatalab/metaml/blob/master/tools/plot_roccurves.py"
click node_heatmap "https://github.com/segatalab/metaml/blob/master/tools/plot_annotatedheatmap.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_profiles,node_selection toneBlue
class node_classification,node_classification_tm,node_regression,node_metrics toneAmber
class node_marker_conversion toneMint
class node_barchart,node_correlation,node_roc,node_heatmap toneRose
class node_user,node_plots toneIndigo
```

## Components

### Profiles and data

- [Metagenome profiles](https://github.com/segatalab/metaml/tree/master/data): `data`
- [Dataset selection](https://github.com/segatalab/metaml/blob/master/dataset_selection.py): `dataset_selection.py`

### Prediction analysis

- [Classification](https://github.com/segatalab/metaml/blob/master/classification.py): `classification.py`
- [Classification variant](https://github.com/segatalab/metaml/blob/master/classification_thomas-manghi.py): `classification_thomas-manghi.py`
- [Regression](https://github.com/segatalab/metaml/blob/master/regression_dev.py): `regression_dev.py`
- [Evaluation results](https://github.com/segatalab/metaml/blob/master/classification.py): `classification.py`

### Interpretation tools

- [Marker conversion](https://github.com/segatalab/metaml/blob/master/tools/markers2clades.py): `tools/markers2clades.py`

### Result visualization

- [Feature bar chart](https://github.com/segatalab/metaml/blob/master/tools/plot_barchart.py): `tools/plot_barchart.py`
- [Abundance correlation](https://github.com/segatalab/metaml/blob/master/tools/plot_correlation.py): `tools/plot_correlation.py`
- [ROC curves](https://github.com/segatalab/metaml/blob/master/tools/plot_roccurves.py): `tools/plot_roccurves.py`
- [Annotated heatmap](https://github.com/segatalab/metaml/blob/master/tools/plot_annotatedheatmap.py): `tools/plot_annotatedheatmap.py`

### Other components

- **Analyst**
- **Plots**

## Connections

- Analyst → Dataset selection: selects data (evidence: `dataset_selection.py`)
- Analyst → Classification: runs prediction (evidence: `README.md`)
- Analyst → Classification variant: runs prediction (evidence: `README.md`)
- Analyst → Regression: runs regression (evidence: `README.md`)
- Metagenome profiles → Dataset selection: supplies profiles (evidence: `README.md`)
- Dataset selection → Classification: prepares profiles
- Classification → Evaluation results: writes metrics (evidence: `classification.py`)
- Classification → ROC curves: writes estimates
- Evaluation results → Marker conversion: reads importance (evidence: `tools/markers2clades.py`)
- Evaluation results → Feature bar chart: reads results (evidence: `tools/plot_barchart.py`)
- Evaluation results → Abundance correlation: reads importance (evidence: `tools/plot_correlation.py`)
- Evaluation results → Annotated heatmap: plots results
- ROC curves → Plots: produces curves (evidence: `tools/plot_roccurves.py`)
- Feature bar chart → Plots: produces chart (evidence: `tools/plot_barchart.py`)
- Abundance correlation → Plots: produces scatter (evidence: `tools/plot_correlation.py`)
- Annotated heatmap → Plots: produces heatmap (evidence: `tools/plot_annotatedheatmap.py`)
