# sanamparajuli/phytofam architecture

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

- Interactive diagram: https://gitdiagram.com/sanamparajuli/phytofam
- Repository: https://github.com/sanamparajuli/phytofam

## Overview

PhytoFam is a Nextflow DSL2 pipeline that identifies plant gene-family members and produces an unrooted maximum-likelihood phylogeny. The documented workflow scans a proteome with HMMER, deduplicates isoforms, confirms domains, annotates orthology with BLAST, then aligns, trims, and infers a tree. Reference proteins support BLAST; optional outgroup sequences join the alignment. The README documents these stages and outputs; source excerpts were unavailable, so internal calls and the role of utils.nf cannot be verified.

Main entry points: [`blast.nf`](https://github.com/sanamparajuli/phytofam/blob/main/blast.nf) (BLAST orthology), [`muscle.nf`](https://github.com/sanamparajuli/phytofam/blob/main/muscle.nf) (Sequence alignment), [`hmmer.nf`](https://github.com/sanamparajuli/phytofam/blob/main/hmmer.nf) (HMMER scan and dedup), [`interproscan.nf`](https://github.com/sanamparajuli/phytofam/blob/main/interproscan.nf) (Domain confirmation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline"]
  node_main["Workflow entry<br/>[main.nf]"]
  node_utils["Pipeline utilities<br/>[utils.nf]"]
end

subgraph group_discovery["Candidate Discovery"]
  node_hmmer["HMMER scan and dedup<br/>[hmmer.nf]"]
end

subgraph group_evidence["Evidence Analysis"]
  node_interpro["Domain confirmation<br/>[interproscan.nf]"]
  node_blast["BLAST orthology<br/>[blast.nf]"]
end

subgraph group_phylogeny["Phylogeny"]
  node_muscle["Sequence alignment<br/>[muscle.nf]"]
  node_trimal["Alignment trimming<br/>[trimal.nf]"]
  node_iqtree["Tree inference<br/>[iqtree.nf]"]
end

node_researcher(("Researcher"))
node_proteome["Target proteome"]
node_reference["Reference proteins"]
node_outgroup["Optional outgroup"]
node_results["Pipeline results"]

node_researcher -->|"runs"| node_main
node_proteome -->|"scanned by"| node_hmmer
node_hmmer -->|"candidates"| node_interpro
node_interpro -->|"confirmed candidates"| node_blast
node_reference -->|"orthology reference"| node_blast
node_blast -->|"annotated candidates"| node_muscle
node_outgroup -.->|"optional sequences"| node_muscle
node_muscle -->|"alignment"| node_trimal
node_trimal -->|"trimmed alignment"| node_iqtree
node_iqtree -->|"tree outputs"| node_results

click node_main "https://github.com/sanamparajuli/phytofam/blob/main/main.nf"
click node_utils "https://github.com/sanamparajuli/phytofam/blob/main/utils.nf"
click node_hmmer "https://github.com/sanamparajuli/phytofam/blob/main/hmmer.nf"
click node_interpro "https://github.com/sanamparajuli/phytofam/blob/main/interproscan.nf"
click node_blast "https://github.com/sanamparajuli/phytofam/blob/main/blast.nf"
click node_muscle "https://github.com/sanamparajuli/phytofam/blob/main/muscle.nf"
click node_trimal "https://github.com/sanamparajuli/phytofam/blob/main/trimal.nf"
click node_iqtree "https://github.com/sanamparajuli/phytofam/blob/main/iqtree.nf"

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_main,node_utils toneBlue
class node_hmmer toneAmber
class node_interpro,node_blast toneMint
class node_muscle,node_trimal,node_iqtree toneRose
class node_researcher,node_proteome,node_reference,node_outgroup,node_results toneIndigo
```

## Components

### Pipeline

- [Workflow entry](https://github.com/sanamparajuli/phytofam/blob/main/main.nf): `main.nf`
- [Pipeline utilities](https://github.com/sanamparajuli/phytofam/blob/main/utils.nf): `utils.nf`

### Candidate Discovery

- [HMMER scan and dedup](https://github.com/sanamparajuli/phytofam/blob/main/hmmer.nf): `hmmer.nf`

### Evidence Analysis

- [Domain confirmation](https://github.com/sanamparajuli/phytofam/blob/main/interproscan.nf): `interproscan.nf`
- [BLAST orthology](https://github.com/sanamparajuli/phytofam/blob/main/blast.nf): `blast.nf`

### Phylogeny

- [Sequence alignment](https://github.com/sanamparajuli/phytofam/blob/main/muscle.nf): `muscle.nf`
- [Alignment trimming](https://github.com/sanamparajuli/phytofam/blob/main/trimal.nf): `trimal.nf`
- [Tree inference](https://github.com/sanamparajuli/phytofam/blob/main/iqtree.nf): `iqtree.nf`

### Other components

- **Researcher**
- **Target proteome**
- **Reference proteins**
- **Optional outgroup**
- **Pipeline results**

## Connections

- Researcher → Workflow entry: runs (evidence: `README.md`)
- Target proteome → HMMER scan and dedup: scanned by (evidence: `README.md`)
- HMMER scan and dedup → Domain confirmation: candidates (evidence: `README.md`)
- Domain confirmation → BLAST orthology: confirmed candidates (evidence: `README.md`)
- Reference proteins → BLAST orthology: orthology reference (evidence: `README.md`)
- BLAST orthology → Sequence alignment: annotated candidates (evidence: `README.md`)
- Optional outgroup → Sequence alignment: optional sequences (evidence: `README.md`)
- Sequence alignment → Alignment trimming: alignment (evidence: `README.md`)
- Alignment trimming → Tree inference: trimmed alignment (evidence: `README.md`)
- Tree inference → Pipeline results: tree outputs (evidence: `README.md`)
