|
| 1 | +#!/usr/bin/env bash |
| 2 | +set -euo pipefail |
| 3 | + |
| 4 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 5 | +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" |
| 6 | +DATA_DIR="${REPO_ROOT}/examples/dummy_data" |
| 7 | +OUT_DIR="${1:-${DATA_DIR}/output}" |
| 8 | + |
| 9 | +GFA_PATH="${OUT_DIR}/pangenome.gfa" |
| 10 | +MODEL_PATH="${OUT_DIR}/crf_model.json" |
| 11 | +HAP_PATH="${OUT_DIR}/haplotypes.fa" |
| 12 | + |
| 13 | +mkdir -p "${OUT_DIR}" |
| 14 | + |
| 15 | +if ! command -v seqwish >/dev/null 2>&1; then |
| 16 | + echo "Error: seqwish is not available in PATH. Install it before running this script." >&2 |
| 17 | + exit 1 |
| 18 | +fi |
| 19 | + |
| 20 | +echo "=== Building dummy pangenome graph ===" |
| 21 | +cargo run --bin hidive -- build-pangenome \ |
| 22 | + --tier1-fasta-paths "${DATA_DIR}/tier1.fa" \ |
| 23 | + --tier2-fasta-paths "${DATA_DIR}/tier2.fa" \ |
| 24 | + --tier3-fasta-paths "${DATA_DIR}/tier3.fa" \ |
| 25 | + --output "${GFA_PATH}" \ |
| 26 | + --kmer-size 11 \ |
| 27 | + --min-aln-len 30 |
| 28 | + |
| 29 | +echo "=== Training CRF on dummy data ===" |
| 30 | +cargo run --bin hidive -- train-crf \ |
| 31 | + --graph "${GFA_PATH}" \ |
| 32 | + --reads "${DATA_DIR}/reads.fa" \ |
| 33 | + --truth-haplotypes "${DATA_DIR}/truth_hap1.fa" \ |
| 34 | + --truth-haplotypes "${DATA_DIR}/truth_hap2.fa" \ |
| 35 | + --output "${MODEL_PATH}" \ |
| 36 | + --kmer-size 11 \ |
| 37 | + --iterations 5 |
| 38 | + |
| 39 | +echo "=== Inferring haplotypes on dummy data ===" |
| 40 | +cargo run --bin hidive -- infer-haplotypes \ |
| 41 | + --graph "${GFA_PATH}" \ |
| 42 | + --model "${MODEL_PATH}" \ |
| 43 | + --reads "${DATA_DIR}/reads.fa" \ |
| 44 | + --output "${HAP_PATH}" \ |
| 45 | + --kmer-size 11 |
| 46 | + |
| 47 | +echo "Dummy pipeline complete." |
| 48 | +echo "GFA: ${GFA_PATH}" |
| 49 | +echo "Model: ${MODEL_PATH}" |
| 50 | +echo "Haplotypes: ${HAP_PATH}" |
| 51 | + |
0 commit comments