# fmenardo/treemmer architecture

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

- Interactive diagram: https://gitdiagram.com/fmenardo/treemmer
- Repository: https://github.com/fmenardo/treemmer

## Overview

Treemmer is a command-line tool for reducing phylogenetic tree datasets while retaining diversity. A user supplies a Newick tree and chooses a stopping target such as a tip count or relative tree length; the tool prunes the tree and can report or plot relative tree-length decay. The v0.3 script also exposes metadata-based protection, random pruning, polytomy handling, and clade-selection options. The repository is a small, script-based tool rather than a layered application; the excerpts show both runtime scripts, but do not establish all internal call relationships.

Main entry points: [`Treemmer_v0.3.py`](https://github.com/fmenardo/treemmer/blob/master/Treemmer_v0.3.py) (Treemmer v0.3), [`Treemmer.py`](https://github.com/fmenardo/treemmer/blob/master/Treemmer.py) (Legacy Treemmer)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_tree_input["Newick tree"]
node_treemmer_v03["Treemmer v0.3<br/>[Treemmer_v0.3.py]"]
node_treemmer_legacy["Legacy Treemmer<br/>[Treemmer.py]"]
node_reduced_tree["Reduced tree"]
node_rtl_plot["RTL plot"]

node_user -->|"runs"| node_treemmer_v03
node_tree_input -->|"supplies tree"| node_treemmer_v03
node_treemmer_v03 -->|"prunes to target"| node_reduced_tree
node_treemmer_v03 -->|"plots decay"| node_rtl_plot
node_user -.->|"runs"| node_treemmer_legacy
node_tree_input -.->|"supplies tree"| node_treemmer_legacy

click node_treemmer_v03 "https://github.com/fmenardo/treemmer/blob/master/Treemmer_v0.3.py"
click node_treemmer_legacy "https://github.com/fmenardo/treemmer/blob/master/Treemmer.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_user toneBlue
class node_tree_input,node_reduced_tree,node_rtl_plot toneIndigo
class node_treemmer_v03,node_treemmer_legacy toneTeal
```

## Components

### Other components

- **User**
- **Newick tree**
- [Treemmer v0.3](https://github.com/fmenardo/treemmer/blob/master/Treemmer_v0.3.py): `Treemmer_v0.3.py`
- [Legacy Treemmer](https://github.com/fmenardo/treemmer/blob/master/Treemmer.py): `Treemmer.py`
- **Reduced tree**
- **RTL plot**

## Connections

- User → Treemmer v0.3: runs (evidence: `README.md`)
- Newick tree → Treemmer v0.3: supplies tree (evidence: `README.md`)
- Treemmer v0.3 → Reduced tree: prunes to target (evidence: `README.md`)
- Treemmer v0.3 → RTL plot: plots decay (evidence: `README.md`)
- User → Legacy Treemmer: runs
- Newick tree → Legacy Treemmer: supplies tree
