# benilton/wcs-rio architecture

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

- Interactive diagram: https://gitdiagram.com/benilton/wcs-rio
- Repository: https://github.com/benilton/wcs-rio

## Overview

##### Project Type and Purpose
- It provides helper scripts (in R and Python/Jupyter), input data files, and Quarto notebooks that render an HTML website (in the `docs/` folder).

##### Key Architectural Components
a. Data Sources
- GSM4339769_C141_filtered_feature_bc_matrix.h5 (primary HDF5 data)
- degs_c2xc0.csv.gz (precomputed CSV data)
- data_source.txt (data provenance notes)
b. Analysis Code
- R scripts: `helpers_wcs.R`, `setup_wcs.R`
- Quarto R Markdown (`*.qmd`): `de_annot.qmd`, `norm_clust.qmd`
- Python/Jupyter notebook: `de_annot.ipynb`
c. Build & Rendering Engine
- Quarto (configured via `_quarto.yml`)
- Site assets (CSS, reveal.js plugins in `docs/site_libs/`)
d. Output Website
- Static HTML files (`docs/*.html`)
- Static assets (`docs/style.css`, JS, fonts)
e. Version Control & Deployment
- Git repo (managed by `.gitignore`, `.nojekyll`)
- Deployed via GitHub Pages or similar (serving `docs/`)

##### Component Interactions & Data Flow
- Raw Data → Analysis Code
→ Intermediate Results (CSV, R objects, etc.)
→ Quarto Rendering
→ Static HTML + Assets in `docs/`
→ Served as a website (e.g., GitHub Pages)

##### Architectural Patterns & Principles
- Workflow Pipeline: data ingestion → processing → documentation
- Separation of concerns:
- Data layer (files)
- Compute layer (scripts & notebooks)
- Presentation layer (Quarto → HTML)
- Reproducibility: All steps and dependencies declared in scripts and `_quarto.yml`.

- Clear labels on all components (Data, Scripts, Renderer, Output)
- Callouts for key config files (`_quarto.yml`, `.gitignore`) and deployment target (GitHub Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        DS1["GSM4339769_C141_filtered_feature_bc_matrix.h5"]:::data
        DS2["degs_c2xc0.csv.gz"]:::data
        DS3["data_source.txt"]:::data
    end

    %% Compute Layer
    subgraph "Compute Layer"
        R1["helpers_wcs.R"]:::compute
        R2["setup_wcs.R"]:::compute
        Q1["de_annot.qmd"]:::compute
        Q2["norm_clust.qmd"]:::compute
        NB["de_annot.ipynb"]:::compute
    end

    %% Render Layer
    subgraph "Render Layer"
        QRT["Quarto Renderer\n(_quarto.yml, docs/site_libs/, docs/style.css)"]:::render
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        HTML1["docs/index.html"]:::deploy
        HTML2["docs/de_annot.html"]:::deploy
        HTML3["docs/norm_clust.html"]:::deploy
        Search["docs/search.json"]:::deploy
    end

    %% Deployment
    subgraph "Deployment"
        GH["GitHub Pages\n(.gitignore, .nojekyll)"]:::deploy
    end

    %% Connections
    DS1 -->|"reads"| R1
    DS2 -->|"reads"| R1
    DS3 -->|"reads"| R1
    R1 -->|"generates"| R2
    R2 -->|"generates"| Q1
    R2 -->|"generates"| Q2
    NB -->|"generates"| Q1
    NB -->|"generates"| Q2
    Q1 -->|"renders"| QRT
    Q2 -->|"renders"| QRT
    QRT -->|"outputs"| HTML1
    QRT -->|"outputs"| HTML2
    QRT -->|"outputs"| HTML3
    QRT -->|"outputs"| Search
    HTML1 -->|"served by"| GH
    HTML2 -->|"served by"| GH
    HTML3 -->|"served by"| GH
    Search -->|"served by"| GH

    %% Click Events
    click DS1 "https://github.com/benilton/wcs-rio/blob/main/GSM4339769_C141_filtered_feature_bc_matrix.h5"
    click DS2 "https://github.com/benilton/wcs-rio/blob/main/degs_c2xc0.csv.gz"
    click DS3 "https://github.com/benilton/wcs-rio/blob/main/data_source.txt"
    click R1 "https://github.com/benilton/wcs-rio/blob/main/helpers_wcs.R"
    click R2 "https://github.com/benilton/wcs-rio/blob/main/setup_wcs.R"
    click Q1 "https://github.com/benilton/wcs-rio/blob/main/de_annot.qmd"
    click Q2 "https://github.com/benilton/wcs-rio/blob/main/norm_clust.qmd"
    click NB "https://github.com/benilton/wcs-rio/blob/main/de_annot.ipynb"
    click QRT "https://github.com/benilton/wcs-rio/blob/main/_quarto.yml"
    click QRT "https://github.com/benilton/wcs-rio/tree/main/docs/site_libs/"
    click QRT "https://github.com/benilton/wcs-rio/blob/main/docs/style.css"
    click HTML1 "https://github.com/benilton/wcs-rio/blob/main/docs/index.html"
    click HTML2 "https://github.com/benilton/wcs-rio/blob/main/docs/de_annot.html"
    click HTML3 "https://github.com/benilton/wcs-rio/blob/main/docs/norm_clust.html"
    click Search "https://github.com/benilton/wcs-rio/blob/main/docs/search.json"
    click GH "https://github.com/benilton/wcs-rio/blob/main/.gitignore"
    click GH "https://github.com/benilton/wcs-rio/blob/main/.nojekyll"
    click GH "https://github.com/benilton/wcs-rio/blob/main/docs/.nojekyll"

    %% Styles
    classDef data fill:#cfe2f3,stroke:#2f5597,color:#2f5597;
    classDef compute fill:#d9ead3,stroke:#38761d,color:#38761d;
    classDef render fill:#fce5cd,stroke:#e69138,color:#e69138;
    classDef deploy fill:#d9d2e9,stroke:#674ea7,color:#674ea7;
```
