# PGSv2 Demo — Example Input Files

**Login:** ID `demo` | PW `GGP2026`

All input files here are based on a **synthetic GGP demo dataset** (104,038 animals, Demo GGP Terminal / South / North farms). No real company data.

---

## Button-by-Button Guide

### EVALUATION

| Button | What it does | Input file(s) | Where to load |
|--------|-------------|---------------|---------------|
| **1. Pedigree Maker** | Topological sort, recode, inbreeding | `01_Pedigree_Maker/pedi.csv` | Place in app root → Button 1 |
| **2. Growth Evaluation** | WOMBAT DF-REML: BF, D90, LEA | `02_Growth_Evaluation/growth.csv` | Place in app root → Button 2 |
| **3. Reproductive Eval** | WOMBAT repeatability: NBA | `03_Reproductive_Evaluation/farrow.csv` | Place in app root → Button 3 |
| **4. Piglet Uniformity** | WOMBAT repeatability: within-litter SD | `04_Piglet_Uniformity/farrow.csv` | Place in app root → Button 4 |
| **5. Solution Merge** | Merge EBV → selection index → report | Runs on Button 1–4 outputs | Button 5 (no extra file needed) |

> **Buttons 1–5:** `pedi.csv`, `growth.csv`, `farrow.csv` are already in `D:\PGSv2_demo\`.
> Just launch PGSv2_Eng.py and press buttons in order: 1 → 2 → 3 → 4 → 5.

---

### MANAGEMENT

| Button | What it does | Input file(s) | Upload via |
|--------|-------------|---------------|------------|
| **6. Boar Usage Monitor** | Per-boar mating count, overuse alert | `06_Boar_Usage_Monitor/Boar_Usage_Mating_Records_Input.xlsx` | Upload Excel button |
| **7. Boar Usage by Batch** | Weekly/batch boar usage chart | `07_Boar_Usage_by_Batch/Boar_Usage_by_Batch_Mating_Records_Input.xlsx` | Upload Excel button |
| **8. Inbreeding Calculator** | Sire × dam inbreeding matrix, DNM flags | `08_Inbreeding_Calculator/Pedigree_Input_for_Inbreeding.csv` + `Candidate_Boar_IDs_Input.xlsx` + `Candidate_Sow_IDs_Input.xlsx` | Upload 3 files |
| **9. Intact Male Selection** | Expected index from sow × boar | `09_Intact_Male_Selection/Due_List_Input.xlsx` + `Selection_List_Index_Input.xlsx` | Upload 2 files |
| **10. AI Center Dashboard** | Center-level EBV scores, radar chart | `10_AI_Center_Dashboard/AI_Center_File1_Input.xlsx` + `AI_Center_File2_Traits_Input.xlsx` | Upload 2 files |

---

## Quick Copy

Run `load_example.py` in `D:\PGSv2_demo\` to copy example files to the app root:

```
python load_example.py
```

Or copy manually: each subfolder above contains the exact file(s) to upload for that button.

---

## Demo Alert Highlights

| Button | What to look for |
|--------|-----------------|
| 6 | Overuse warning for 8 boars (threshold ≥ 30 matings) |
| 7 | Peak usage spike in specific weeks |
| 8 | `Do Not Mate` and `Caution` flags — full-sib (F=0.25), half-sib (F=0.125) pairs included |
| 9 | SowIndex/BoarIndex missing warnings; Expected Index range ~83–227 |
| 10 | High-scoring center vs. low-scoring center contrast visible in radar chart |
