# lucivargas/prs_calibration_la architecture

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

- Interactive diagram: https://gitdiagram.com/lucivargas/prs_calibration_la
- Repository: https://github.com/lucivargas/prs_calibration_la

## Overview

PRS_calibration_LA is a workflow for calibrating polygenic risk scores using local ancestry. The numbered scripts suggest stages for checking inputs, obtaining and processing score/variant data, applying reference and target scores, matching local ancestry to PRS, and calculating simulation and summary outputs. The tree and README do not show which script invokes another, so the graph preserves these stages without asserting execution links. Source excerpts were unavailable; relationships and implementation details could not be verified.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Workflow setup"]
  node_runner["Workflow entry<br/>[calibrate_prs.sh]"]
  node_config["Configuration<br/>[config.yml]"]
end

subgraph group_inputs["Input preparation"]
  node_requirements["Check requirements"]
  node_target_check["Check target<br/>[02_check_target.R]"]
  node_download["Download score"]
  node_extract["Extract variants"]
  node_overlap["Find overlaps"]
end

subgraph group_scoring["PRS processing"]
  node_gwas["Process GWAS"]
  node_filter["Filter data<br/>[06_filter_data.sh]"]
  node_reference_score["Apply reference PRS<br/>[07_apply_pgs_ref.R]"]
  node_target_score["Apply target PRS"]
end

subgraph group_analysis["Calibration analysis"]
  node_match["Match LAI to PRS"]
  node_simulations["Run simulations<br/>[10_simulations.R]"]
  node_average["Average LAI<br/>[11_average_lai.R]"]
  node_percentiles["Calculate percentiles"]
  node_utilities["R utilities<br/>[utils.R]"]
end

node_operator(("Workflow operator"))

click node_runner "https://github.com/lucivargas/prs_calibration_la/blob/main/calibrate_prs.sh"
click node_config "https://github.com/lucivargas/prs_calibration_la/blob/main/config.yml"
click node_requirements "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/01_check_requirements.sh"
click node_target_check "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/02_check_target.R"
click node_download "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/03_download_score.sh"
click node_extract "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/04_extract_variants.sh"
click node_overlap "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/05_find_overlapping_variants.R"
click node_gwas "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/06_01_process_gwas.R"
click node_filter "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/06_filter_data.sh"
click node_reference_score "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/07_apply_pgs_ref.R"
click node_target_score "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/08_apply_pgs_target.R"
click node_match "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/09_match_lai_to_prs.R"
click node_simulations "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/10_simulations.R"
click node_average "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/11_average_lai.R"
click node_percentiles "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/11_calculate_percentiles.R"
click node_utilities "https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/utils.R"

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_runner,node_config toneBlue
class node_requirements,node_target_check,node_download,node_extract,node_overlap toneAmber
class node_gwas,node_filter,node_reference_score,node_target_score toneMint
class node_match,node_simulations,node_average,node_percentiles,node_utilities toneRose
class node_operator toneIndigo
```

## Components

### Workflow setup

- [Workflow entry](https://github.com/lucivargas/prs_calibration_la/blob/main/calibrate_prs.sh): `calibrate_prs.sh`
- [Configuration](https://github.com/lucivargas/prs_calibration_la/blob/main/config.yml): `config.yml`

### Input preparation

- [Check requirements](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/01_check_requirements.sh): `Functions/01_check_requirements.sh`
- [Check target](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/02_check_target.R): `Functions/02_check_target.R`
- [Download score](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/03_download_score.sh): `Functions/03_download_score.sh`
- [Extract variants](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/04_extract_variants.sh): `Functions/04_extract_variants.sh`
- [Find overlaps](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/05_find_overlapping_variants.R): `Functions/05_find_overlapping_variants.R`

### PRS processing

- [Process GWAS](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/06_01_process_gwas.R): `Functions/06_01_process_gwas.R`
- [Filter data](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/06_filter_data.sh): `Functions/06_filter_data.sh`
- [Apply reference PRS](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/07_apply_pgs_ref.R): `Functions/07_apply_pgs_ref.R`
- [Apply target PRS](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/08_apply_pgs_target.R): `Functions/08_apply_pgs_target.R`

### Calibration analysis

- [Match LAI to PRS](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/09_match_lai_to_prs.R): `Functions/09_match_lai_to_prs.R`
- [Run simulations](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/10_simulations.R): `Functions/10_simulations.R`
- [Average LAI](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/11_average_lai.R): `Functions/11_average_lai.R`
- [Calculate percentiles](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/11_calculate_percentiles.R): `Functions/11_calculate_percentiles.R`
- [R utilities](https://github.com/lucivargas/prs_calibration_la/blob/main/Functions/utils.R): `Functions/utils.R`

### Other components

- **Workflow operator**
