Hop atlas home · Overview · Changelog · Architecture · Adding_Data · Introgression · Ribbon · Dosage · Phylogeny · Bundle · Ingest · Ingest_Gbs · Ingest_Wgs · Ingest_Grasdi · Ingest_Rnaseq · Ingest_Assembly

Rendered from hop_atlas/components/DOSAGE.md (2026-10-13)

Dosage atlas (chromosome dosage explorer): how it is built and how to update it

Status: living document, started 2026-10-08. All dosage products are tentative. Part of: the hop atlas web app (hop_atlas/README.md). Served: port 8900, together with the introgression and ribbon atlases. :8906 was retired on 2026-10-08. - Main page: http://10.112.218.205:8900/dosage_atlas/ (redirects to START_HERE.html; cohort views at #ratio). - OSU sex-chromosome panel: …/dosage_atlas/sexpanel/START_HERE.html#sex - Pilgrim genotype-only companion: …/dosage_atlas/pilgrim/index.html

Home: scratch_plots/dosage_atlas/ is self-contained (292 MB). - It was moved out of sync/ on 2026-10-08, at the PI's request. - The former sync/ folders are archived byte-for-byte (with checksum manifests) in /data/hop_data/hop_atlas/dosage_sources/. .MOVED.txt pointers mark their old places.

Tools (hop_atlas/tools/): - atlas_deploy.py (profile dosage) - relocate_dosage.py - check_dosage_http.py

Short answer: can a new cohort or reference go from SRA/BAM to the dosage atlas by following written instructions?

No. - Rebuilding, relocating, testing and deploying the current atlas is scripted (§5). - Everything upstream (manifests, alignment per reference, read counting, allele balance, clade calls) exists only as dated "documentation of what was run", with cohort and reference lists hard-coded in about five places (§2). - Adding a cohort has no documented procedure. - Generic code: the reusable packages annevo_eval/methods/autosomal_dosage (hop_adosage) and annevo_eval/methods/sexchrom_dosage were merged into main in 029bf81 (2026-10-08); the served atlas is not yet built from them.

1. What is shown, and the home layout

Path in dosage_atlas/ Content Came from (now archived)
START_HERE.html, index.html (redirect), app.js, cn.js, assets_cn/ (83 MB), scripts/, figs/, tables/, validation/ v2 page, copy-number assets, builder and test copies sync/2026-10-04/dosage_explorer_v2
v1/assets/ (Plotly, sample_metadata.js, family_*, <pop>__<ref>.js), v1/README.md v1 assets the v2 page loads sync/2026-09-28/dosage_explorer
sexpanel/ OSU sex-chromosome panel sync/2026-10-05/dosage_explorer_v2_sexpanel
pilgrim/index.html Pilgrim companion sync/2026-10-07/pilgrim_in_atlases/dosage_companion
docs/family_shared_site_dosage_README.md the README the page links to sync/2026-09-28/family_shared_site_dosage/README.md (the old relative link was already broken)

2. Build chain (each stage is a dated record with hard-coded paths)

# Stage Record Produces
1 manifests, read-start counts, allele balance from existing 21110M VCFs sync/2026-09-24/per_chromosome_dosage/PIPELINE.sh first per-chromosome tables
2 references (Saaz, HL1012 principal hap1; others existing); 895-sample manifest (00d_build_manifest.py); Lepton pbrun fq2bam per reference (lepton/submit_pcd.py); count_one_v2.sh; ab_hist.py sync/2026-09-25/per_chromosome_dosage_multiref/PIPELINE.sh /data/hop_data/per_chromosome_dosage_multiref/{counts,ab}/<ref>/<pop>/
3 v1 assets (geometry the v2 builder reuses) v1 build_all.py → build_assets.py <ref> (now in /data/hop_data/hop_atlas/dosage_sources/2026-09-28/dosage_explorer/scripts/) v1/assets/
4 v2 copy number: build_all_cn.sh → worked_example.py → fill_defs.py → make_page.py → validate_cn.py (= rebuild_and_validate.sh) builder in /data/hop_data/dosage_explorer_v2/stage/scripts/ stage /data/hop_data/dosage_explorer_v2/stage; work /data/hop_data/dosage_explorer_v2/work/
5 relocate into the home: hop_atlas/tools/relocate_dosage.py this repo a self-contained dosage_atlas/

Inputs to stage 4: - clade calls: /data/hop_data/multires_clade/{calls,viewer,stage1}; - P2_states.npz; - verified sex: sync/2026-10-04/osu_sex_verification/; - the v1 assets and scripts. Since 2026-10-08 the builder reads these from the archive; build_cn.py, make_page.py, worked_example.py and check_cohort_browser_v2.py were repointed, with backups *.bak_2026-10-08_prehome.

Hard-coded lists to edit for any cohort or reference change: - build_all_cn.sh; - validate_cn.py; - check_cn_browser.py (REFS, POPS); - v1 build_all.py; - mr_config.py (REFS); - build_cn.py (CALLSRC, FRAME, REFHAP, EXCLUDE_BASE={'ERR11608432'}).

What relocate_dosage.py does: - It rewrites only the relative paths that load or link files, and verifies that none pointing outside the home remain. - It re-inserts the Pilgrim companion box if a rebuilt START_HERE.html lacks it. make_page.py does not know that box, which was added by hand on 2026-10-07; before the move, a rebuild would have dropped it.

3. Add a cohort or a reference

There is no tested procedure. From the records it requires all of the following: 1. Add the samples to the 09-25 manifest and run alignment plus counting per reference (stage 2), with GBS rules from annevo_eval/docs/ASSAYS.md. 2. Produce clade calls in multires_clade (annevo_eval/docs/INTROGRESSION_ATLAS_TECHNICAL.md §3–4). 3. Build v1 assets (stage 3). 4. Edit every list in §2. 5. Rebuild, test and deploy (§5).

Cohorts without reads (DArT, e.g. Pilgrim) cannot enter this atlas; link them from the page, as the Pilgrim companion does.

4. Tests

Tests run only when the PI asks (PI, 2026-10-08). They are kept and documented, but not run after every change.

Test Checks
scripts/check_cn_browser.py all 30 datasets load; browser per-chromosome CN equals the builder's (both modes; max abs diff < 1e-9); every preset renders; the 95 % interval worked example matches
scripts/check_cohort_browser_v2.py the 2026-09-28 cohort-browser assertions on the v2 page (#ratio)
sexpanel/scripts/check_sexpanel.py 20 sex-panel checks
scripts/validate_cn.py (part of the build) tables V0–V4
hop_atlas/tools/check_dosage_http.py [BASE_URL] through the web server: copy number, cohort views, sex panel and Pilgrim page all render with no page error, no failed request and no 4xx

5. Stage → build → test → deploy

T=hop_atlas/tools/atlas_deploy.py
python3 $T stage dosage --name my_change      # /data/hop_data/atlas_stages/dosage/my_change/dosage_atlas (copy of the served home)
STG=/data/hop_data/atlas_stages/dosage/my_change
python3 $T build dosage $STG                  # rebuild_and_validate.sh, then relocate_dosage.py into a FRESH home folder in the stage
python3 $T test  dosage $STG                  # the three bundled browser checks -> $STG/checks.txt
python3 $T deploy dosage $STG --dry-run       # files that would change; for text files, lines the served copy would LOSE
python3 $T deploy dosage $STG                 # refuses if the served home changed since `stage`; backs up; deletes nothing
python3 hop_atlas/tools/check_dosage_http.py  # through :8900 after the deploy

There is no separate server any more; :8900 serves scratch_plots/ (see hop_atlas/README.md → Server). Changes to what is served need PI approval.

6. Known gaps