# insightsengineering/hermes architecture

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

- Interactive diagram: https://gitdiagram.com/insightsengineering/hermes
- Repository: https://github.com/insightsengineering/hermes

## Overview

hermes is an R package for preprocessing, analyzing, and reporting RNA-seq data. Its documented capabilities span importing counts into a ready-to-analyze format, gene annotation, QC, filtering, normalization, visualization, PCA, differential expression, and templated QC reporting. The graph groups these stages around the HermesData representation and analysis tools. No source excerpts were provided, so implementation links and call ownership cannot be verified; dashed edges indicate documented capabilities or integrations, not confirmed runtime sequencing.

Main entry points: [`R/HermesData-class.R`](https://github.com/insightsengineering/hermes/blob/main/R/HermesData-class.R) (HermesData model), [`R/data.R`](https://github.com/insightsengineering/hermes/blob/main/R/data.R) (Count import), [`R/connections.R`](https://github.com/insightsengineering/hermes/blob/main/R/connections.R) (Gene annotation), [`R/quality.R`](https://github.com/insightsengineering/hermes/blob/main/R/quality.R) (QC flags)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and annotation"]
  node_import["Count import<br/>[data.R]"]
  node_hermesdata["HermesData model<br/>[HermesData-class.R]"]
  node_annotation["Gene annotation<br/>[connections.R]"]
end

subgraph group_preprocess["Preprocessing and QC"]
  node_quality["QC flags<br/>[quality.R]"]
  node_filter["Data filtering"]
  node_normalize["Normalization<br/>[normalization.R]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_plots["Descriptive plots<br/>[draw_barplot.R]"]
  node_pca["PCA<br/>[pca.R]"]
  node_differential["Differential expression<br/>[differential.R]"]
  node_report["QC report template<br/>[template.yaml]"]
end

node_user(("Analyst"))
node_biomart["BioMart"]

node_user -.->|"imports counts"| node_import
node_import -.->|"creates ready format"| node_hermesdata
node_hermesdata -.->|"annotates genes"| node_annotation
node_annotation -.->|"queries annotation"| node_biomart
node_hermesdata -.->|"adds QC flags"| node_quality
node_hermesdata -.->|"filters dataset"| node_filter
node_hermesdata -.->|"normalizes counts"| node_normalize
node_hermesdata -.->|"produces plots"| node_plots
node_hermesdata -.->|"performs PCA"| node_pca
node_hermesdata -.->|"analyzes expression"| node_differential
node_quality -.->|"reports QC"| node_report

click node_import "https://github.com/insightsengineering/hermes/blob/main/R/data.R"
click node_hermesdata "https://github.com/insightsengineering/hermes/blob/main/R/HermesData-class.R"
click node_annotation "https://github.com/insightsengineering/hermes/blob/main/R/connections.R"
click node_quality "https://github.com/insightsengineering/hermes/blob/main/R/quality.R"
click node_filter "https://github.com/insightsengineering/hermes/blob/main/R/HermesData-methods.R"
click node_normalize "https://github.com/insightsengineering/hermes/blob/main/R/normalization.R"
click node_plots "https://github.com/insightsengineering/hermes/blob/main/R/draw_barplot.R"
click node_pca "https://github.com/insightsengineering/hermes/blob/main/R/pca.R"
click node_differential "https://github.com/insightsengineering/hermes/blob/main/R/differential.R"
click node_report "https://github.com/insightsengineering/hermes/blob/main/inst/rmarkdown/templates/qc_report/template.yaml"

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_import,node_hermesdata,node_annotation toneBlue
class node_quality,node_filter,node_normalize toneAmber
class node_plots,node_pca,node_differential,node_report toneMint
class node_user,node_biomart toneIndigo
```

## Components

### Data and annotation

- [Count import](https://github.com/insightsengineering/hermes/blob/main/R/data.R): `R/data.R`
- [HermesData model](https://github.com/insightsengineering/hermes/blob/main/R/HermesData-class.R): `R/HermesData-class.R`
- [Gene annotation](https://github.com/insightsengineering/hermes/blob/main/R/connections.R): `R/connections.R`

### Preprocessing and QC

- [QC flags](https://github.com/insightsengineering/hermes/blob/main/R/quality.R): `R/quality.R`
- [Data filtering](https://github.com/insightsengineering/hermes/blob/main/R/HermesData-methods.R): `R/HermesData-methods.R`
- [Normalization](https://github.com/insightsengineering/hermes/blob/main/R/normalization.R): `R/normalization.R`

### Analysis and reporting

- [Descriptive plots](https://github.com/insightsengineering/hermes/blob/main/R/draw_barplot.R): `R/draw_barplot.R`
- [PCA](https://github.com/insightsengineering/hermes/blob/main/R/pca.R): `R/pca.R`
- [Differential expression](https://github.com/insightsengineering/hermes/blob/main/R/differential.R): `R/differential.R`
- [QC report template](https://github.com/insightsengineering/hermes/blob/main/inst/rmarkdown/templates/qc_report/template.yaml): `inst/rmarkdown/templates/qc_report/template.yaml`

### Other components

- **Analyst**
- **BioMart**

## Connections

- Analyst → Count import: imports counts (evidence: `README.md`)
- Count import → HermesData model: creates ready format (evidence: `README.md`)
- HermesData model → Gene annotation: annotates genes (evidence: `README.md`)
- Gene annotation → BioMart: queries annotation (evidence: `README.md`)
- HermesData model → QC flags: adds QC flags (evidence: `README.md`)
- HermesData model → Data filtering: filters dataset (evidence: `README.md`)
- HermesData model → Normalization: normalizes counts (evidence: `README.md`)
- HermesData model → Descriptive plots: produces plots (evidence: `README.md`)
- HermesData model → PCA: performs PCA (evidence: `README.md`)
- HermesData model → Differential expression: analyzes expression (evidence: `README.md`)
- QC flags → QC report template: reports QC (evidence: `README.md`)
