# pranavathiyani/amrfold architecture

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

- Interactive diagram: https://gitdiagram.com/pranavathiyani/amrfold
- Repository: https://github.com/pranavathiyani/amrfold

## Overview

AMRfold is a notebook-based workflow for finding antimicrobial-resistance proteins in bacterial proteomes using structure-informed search. Its main path prepares a curated, nonredundant AMR query set, converts query sequences to ProstT5 3Di tokens, searches a target proteome with Foldseek, filters hits, then annotates and analyzes them before producing reports and result files. Documented side branches provide sequence-, HMM-, and embedding-based comparisons, human-homolog screening, structural validation, enrichment, and visualization. The repository contains no source excerpts, so relationships and capabilities here rely on the README; notebook internals were not inspected.

Main entry points: [`notebooks/AMRfold_Complete_v3.2.ipynb`](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb) (AMRfold workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and queries"]
  node_amr_sources[("CARD and SwissProt")]
  node_query_db[("Curated AMR queries")]
  node_target_structures[("AFDB target structures")]
  node_external_annotations[("UniProt, GOA, KEGG")]
end

subgraph group_search["Search and comparison"]
  node_notebook["AMRfold workflow"]
  node_prostt5["ProstT5 tokens"]
  node_foldseek["Foldseek search"]
  node_hit_filters["Hit filtering"]
  node_sequence_search["MMseqs2 and DIAMOND"]
  node_hmm_search["AMRFinderPlus HMM"]
  node_esm2_search["ESM2 calibration"]
  node_human_screen["Human homolog screen"]
end

subgraph group_analysis["Hit interpretation"]
  node_annotation["AMR annotation"]
  node_domain_analysis["Domain analysis"]
  node_functional_analysis["Enrichment analysis"]
  node_structural_validation["Structure validation"]
  node_umap["UMAP analysis"]
  node_method_comparison["Method comparison"]
end

subgraph group_outputs["Results and reporting"]
  node_result_files["Tables and provenance"]
  node_visualizations["Figures and reports"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs"| node_notebook
node_amr_sources -->|"curated into"| node_query_db
node_query_db -->|"encoded by"| node_prostt5
node_prostt5 -->|"provides tokens"| node_foldseek
node_target_structures -->|"searched against"| node_foldseek
node_foldseek -->|"produces hits"| node_hit_filters
node_notebook -->|"runs comparison"| node_sequence_search
node_notebook -->|"runs comparison"| node_hmm_search
node_notebook -->|"runs comparison"| node_esm2_search
node_notebook -->|"screens hits"| node_human_screen
node_hit_filters -->|"passes hits"| node_annotation
node_annotation -->|"annotates domains"| node_domain_analysis
node_notebook -->|"downloads mappings"| node_external_annotations
node_annotation -->|"supports enrichment"| node_functional_analysis
node_hit_filters -->|"validates hits"| node_structural_validation
node_hit_filters -->|"embeds hits"| node_umap
node_notebook -->|"compares methods"| node_method_comparison
node_method_comparison -->|"saves results"| node_result_files
node_functional_analysis -->|"saves mappings"| node_result_files
node_umap -->|"feeds figures"| node_visualizations
node_notebook -->|"generates reports"| node_visualizations

click node_notebook "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_query_db "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_prostt5 "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_foldseek "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_hit_filters "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_sequence_search "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_hmm_search "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_esm2_search "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_human_screen "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_annotation "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_domain_analysis "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_functional_analysis "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_structural_validation "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_umap "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_method_comparison "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_result_files "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"
click node_visualizations "https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb"

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_amr_sources,node_query_db,node_target_structures,node_external_annotations toneBlue
class node_notebook,node_prostt5,node_foldseek,node_hit_filters,node_sequence_search,node_hmm_search,node_esm2_search,node_human_screen toneAmber
class node_annotation,node_domain_analysis,node_functional_analysis,node_structural_validation,node_umap,node_method_comparison toneMint
class node_result_files,node_visualizations toneRose
class node_researcher toneIndigo
```

## Components

### Inputs and queries

- **CARD and SwissProt**
- [Curated AMR queries](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- **AFDB target structures**
- **UniProt, GOA, KEGG**

### Search and comparison

- [AMRfold workflow](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [ProstT5 tokens](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Foldseek search](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Hit filtering](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [MMseqs2 and DIAMOND](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [AMRFinderPlus HMM](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [ESM2 calibration](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Human homolog screen](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`

### Hit interpretation

- [AMR annotation](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Domain analysis](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Enrichment analysis](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Structure validation](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [UMAP analysis](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Method comparison](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`

### Results and reporting

- [Tables and provenance](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`
- [Figures and reports](https://github.com/pranavathiyani/amrfold/blob/main/notebooks/AMRfold_Complete_v3.2.ipynb): `notebooks/AMRfold_Complete_v3.2.ipynb`

### Other components

- **Researcher**

## Connections

- Researcher → AMRfold workflow: runs (evidence: `README.md`)
- CARD and SwissProt → Curated AMR queries: curated into (evidence: `README.md`)
- Curated AMR queries → ProstT5 tokens: encoded by (evidence: `README.md`)
- ProstT5 tokens → Foldseek search: provides tokens (evidence: `README.md`)
- AFDB target structures → Foldseek search: searched against (evidence: `README.md`)
- Foldseek search → Hit filtering: produces hits (evidence: `README.md`)
- AMRfold workflow → MMseqs2 and DIAMOND: runs comparison (evidence: `README.md`)
- AMRfold workflow → AMRFinderPlus HMM: runs comparison (evidence: `README.md`)
- AMRfold workflow → ESM2 calibration: runs comparison (evidence: `README.md`)
- AMRfold workflow → Human homolog screen: screens hits (evidence: `README.md`)
- Hit filtering → AMR annotation: passes hits (evidence: `README.md`)
- AMR annotation → Domain analysis: annotates domains (evidence: `README.md`)
- AMRfold workflow → UniProt, GOA, KEGG: downloads mappings (evidence: `README.md`)
- AMR annotation → Enrichment analysis: supports enrichment (evidence: `README.md`)
- Hit filtering → Structure validation: validates hits (evidence: `README.md`)
- Hit filtering → UMAP analysis: embeds hits (evidence: `README.md`)
- AMRfold workflow → Method comparison: compares methods (evidence: `README.md`)
- Method comparison → Tables and provenance: saves results (evidence: `README.md`)
- Enrichment analysis → Tables and provenance: saves mappings (evidence: `README.md`)
- UMAP analysis → Figures and reports: feeds figures (evidence: `README.md`)
- AMRfold workflow → Figures and reports: generates reports (evidence: `README.md`)
