# non5911/pca_gene_expression architecture

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

- Interactive diagram: https://gitdiagram.com/non5911/pca_gene_expression
- Repository: https://github.com/non5911/pca_gene_expression

## Overview

This educational notebook reproduces two PCA-primer figures from breast-cancer gene-expression data. Its documented workflow selects XBP1 and GATA3 expression and ER labels for a scatter plot, then performs PCA in the two-gene space and projects samples onto PC1. The README documents the inputs, tasks, and outputs; no notebook source excerpts were available, so relationships below reflect that documentation rather than inspected code.

Main entry points: [`PCA_Gene_Expression.ipynb`](https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb) (Gene extraction), [`data/filtered.tsv.gz`](https://github.com/non5911/pca_gene_expression/blob/main/data/filtered.tsv.gz) (Expression matrix), [`data/columns.tsv.gz`](https://github.com/non5911/pca_gene_expression/blob/main/data/columns.tsv.gz) (Gene mapping), [`data/class.tsv`](https://github.com/non5911/pca_gene_expression/blob/main/data/class.tsv) (ER labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Expression analysis"]
  node_gene_extract["Gene extraction"]
  node_scatter["Gene scatter"]
  node_pca_projection["PC1 projection"]
end

subgraph group_inputs["Study data"]
  node_expression["Expression matrix<br/>[filtered.tsv.gz]"]
  node_gene_map["Gene mapping<br/>[columns.tsv.gz]"]
  node_er_labels["ER labels<br/>[class.tsv]"]
end

subgraph group_outputs["Figures"]
  node_figure_1a["Figure 1a"]
  node_figure_1c["Figure 1c"]
end

node_analyst(("Notebook user"))

node_analyst -->|"runs notebook"| node_gene_extract
node_gene_extract -->|"extracts expression"| node_expression
node_gene_extract -->|"maps gene IDs"| node_gene_map
node_gene_extract -->|"uses ER labels"| node_er_labels
node_gene_extract -->|"plots genes"| node_scatter
node_scatter -->|"produces plot"| node_figure_1a
node_gene_extract -->|"provides gene space"| node_pca_projection
node_pca_projection -->|"produces projection"| node_figure_1c

click node_gene_extract "https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb"
click node_scatter "https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb"
click node_pca_projection "https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb"
click node_expression "https://github.com/non5911/pca_gene_expression/blob/main/data/filtered.tsv.gz"
click node_gene_map "https://github.com/non5911/pca_gene_expression/blob/main/data/columns.tsv.gz"
click node_er_labels "https://github.com/non5911/pca_gene_expression/blob/main/data/class.tsv"

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_gene_extract,node_scatter,node_pca_projection,node_analyst toneBlue
class node_expression,node_gene_map,node_er_labels toneAmber
class node_figure_1a,node_figure_1c toneMint
```

## Components

### Expression analysis

- [Gene extraction](https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb): `PCA_Gene_Expression.ipynb`
- [Gene scatter](https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb): `PCA_Gene_Expression.ipynb`
- [PC1 projection](https://github.com/non5911/pca_gene_expression/blob/main/PCA_Gene_Expression.ipynb): `PCA_Gene_Expression.ipynb`

### Study data

- [Expression matrix](https://github.com/non5911/pca_gene_expression/blob/main/data/filtered.tsv.gz): `data/filtered.tsv.gz`
- [Gene mapping](https://github.com/non5911/pca_gene_expression/blob/main/data/columns.tsv.gz): `data/columns.tsv.gz`
- [ER labels](https://github.com/non5911/pca_gene_expression/blob/main/data/class.tsv): `data/class.tsv`

### Figures

- **Figure 1a**
- **Figure 1c**

### Other components

- **Notebook user**

## Connections

- Notebook user → Gene extraction: runs notebook (evidence: `README.md`)
- Gene extraction → Expression matrix: extracts expression (evidence: `README.md`)
- Gene extraction → Gene mapping: maps gene IDs (evidence: `README.md`)
- Gene extraction → ER labels: uses ER labels (evidence: `README.md`)
- Gene extraction → Gene scatter: plots genes (evidence: `README.md`)
- Gene scatter → Figure 1a: produces plot (evidence: `README.md`)
- Gene extraction → PC1 projection: provides gene space (evidence: `README.md`)
- PC1 projection → Figure 1c: produces projection (evidence: `README.md`)
