# aminforqani/dg-engram-snrnaseq architecture

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

- Interactive diagram: https://gitdiagram.com/aminforqani/dg-engram-snrnaseq
- Repository: https://github.com/aminforqani/dg-engram-snrnaseq

## Overview

This repository is an R-based reanalysis of mouse dentate-gyrus single-nucleus RNA-seq data, comparing engram and non-engram neurons. Its documented workflow loads and filters libraries, removes doublets, explores clustering, integrates samples, annotates cells, then performs granule-cell activity-gene and differential-expression analyses before generating figures. The graph follows the README’s stated script order and documented capabilities. Source excerpts were unavailable, so relationships rely on README statements; output-file links are included only where the README identifies them.

Main entry points: [`05_annotation.R`](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/05_annotation.R) (Cell annotation), [`01_load_data.R`](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/01_load_data.R) (Load and QC), [`02_doublets.R`](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/02_doublets.R) (Doublet removal), [`03_clustering.R`](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/03_clustering.R) (Exploratory clustering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_load["Load and QC<br/>[01_load_data.R]"]
  node_doublets["Doublet removal<br/>[02_doublets.R]"]
end

subgraph group_analysis["Cell analysis"]
  node_explore["Exploratory clustering<br/>[03_clustering.R]"]
  node_integrate["Harmony integration<br/>[04_integration.R]"]
  node_annotate["Cell annotation<br/>[05_annotation.R]"]
  node_granule["Granule activity analysis"]
  node_de["Engram differential expression<br/>[07_engram_DE.R]"]
end

subgraph group_outputs["Results and figures"]
  node_figures["Figures<br/>[08_figures.R]"]
  node_annotations_file["Cell annotations"]
  node_de_all["All DE results"]
  node_de_robust["Robust DE results"]
  node_figure_files["Analysis figures"]
end

node_geo(("GEO dataset"))

node_geo -->|"provides data"| node_load
node_load -->|"runs before"| node_doublets
node_doublets -->|"runs before"| node_explore
node_explore -->|"runs before"| node_integrate
node_integrate -->|"runs before"| node_annotate
node_annotate -->|"runs before"| node_granule
node_granule -->|"runs before"| node_de
node_de -->|"runs before"| node_figures
node_annotate -->|"records labels"| node_annotations_file
node_figures -->|"generates figures"| node_figure_files

click node_load "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/01_load_data.R"
click node_doublets "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/02_doublets.R"
click node_explore "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/03_clustering.R"
click node_integrate "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/04_integration.R"
click node_annotate "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/05_annotation.R"
click node_granule "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/06_engram_granule.R"
click node_de "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/07_engram_DE.R"
click node_figures "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/08_figures.R"
click node_annotations_file "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/cell_annotations.csv"
click node_de_all "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/granule_engram_DE_all.csv"
click node_de_robust "https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/granule_engram_DE_robust.csv"
click node_figure_files "https://github.com/aminforqani/dg-engram-snrnaseq/tree/main/figures"

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_load,node_doublets toneBlue
class node_explore,node_integrate,node_annotate,node_granule,node_de toneAmber
class node_figures,node_annotations_file,node_de_all,node_de_robust,node_figure_files toneMint
class node_geo toneIndigo
```

## Components

### Data preparation

- [Load and QC](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/01_load_data.R): `01_load_data.R`
- [Doublet removal](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/02_doublets.R): `02_doublets.R`

### Cell analysis

- [Exploratory clustering](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/03_clustering.R): `03_clustering.R`
- [Harmony integration](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/04_integration.R): `04_integration.R`
- [Cell annotation](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/05_annotation.R): `05_annotation.R`
- [Granule activity analysis](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/06_engram_granule.R): `06_engram_granule.R`
- [Engram differential expression](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/07_engram_DE.R): `07_engram_DE.R`

### Results and figures

- [Figures](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/08_figures.R): `08_figures.R`
- [Cell annotations](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/cell_annotations.csv): `results/cell_annotations.csv`
- [All DE results](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/granule_engram_DE_all.csv): `results/granule_engram_DE_all.csv`
- [Robust DE results](https://github.com/aminforqani/dg-engram-snrnaseq/blob/main/results/granule_engram_DE_robust.csv): `results/granule_engram_DE_robust.csv`
- [Analysis figures](https://github.com/aminforqani/dg-engram-snrnaseq/tree/main/figures): `figures`

### Other components

- **GEO dataset**

## Connections

- GEO dataset → Load and QC: provides data (evidence: `README.md`)
- Load and QC → Doublet removal: runs before (evidence: `README.md`)
- Doublet removal → Exploratory clustering: runs before (evidence: `README.md`)
- Exploratory clustering → Harmony integration: runs before (evidence: `README.md`)
- Harmony integration → Cell annotation: runs before (evidence: `README.md`)
- Cell annotation → Granule activity analysis: runs before (evidence: `README.md`)
- Granule activity analysis → Engram differential expression: runs before (evidence: `README.md`)
- Engram differential expression → Figures: runs before (evidence: `README.md`)
- Cell annotation → Cell annotations: records labels (evidence: `README.md`)
- Figures → Analysis figures: generates figures (evidence: `README.md`)
