#!/usr/bin/env bash # H1 genome-wide: run the per-chromosome H1 pipeline for all autosomes (chr1..22). # Idempotent — skips chroms already trained. Disables per-chrom figures by default # (set SKIP_FIGURES= to enable). # # Usage: # bash experiments/h1_representation/run_genome.sh # bash experiments/h1_representation/run_genome.sh chr2 chr5 # only these # SKIP_FIGURES= bash experiments/h1_representation/run_genome.sh # render figures set -euo pipefail REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # Skip per-chrom UMAP/compare figures during genome loop (slow; render manually # for representative chroms after aggregation). export SKIP_FIGURES="${SKIP_FIGURES-1}" if [ $# -gt 0 ]; then CHROMS=("$@") else CHROMS=() for i in $(seq 1 22); do CHROMS+=("chr$i"); done fi START=$(date +%s) N=${#CHROMS[@]} i=0 for CHROM in "${CHROMS[@]}"; do i=$((i + 1)) echo "" echo "================================================================" echo "[H1] $CHROM ($i / $N)" echo "================================================================" CHROM="$CHROM" bash "$REPO/experiments/h1_representation/run.sh" done ELAPSED=$(( $(date +%s) - START )) echo "" echo "=== H1 genome-wide complete in ${ELAPSED}s ===" echo "Next: python experiments/h1_representation/aggregate.py"