Files
obikmer/benchmark/simulate_query_one.sh
T
Eric Coissac 89ea077456 Add benchmark pipeline for dense and sparse query testing
Introduces a complete query benchmark track to evaluate performance and verify consistency between dense and sparse index formats. Adds scripts to simulate fixed-size paired-end reads, pack a sparse presence index, execute queries in both modes, and capture wall time and RSS metrics. Includes a verification step that compares outputs by read ID to ensure content identity across parallel processing. Updates build configuration, documentation, and ignore patterns to support the new pipeline for two microbial specimens.
2026-08-20 13:59:12 +02:00

35 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Usage: simulate_query_one.sh genome.fna.gz output_dir
# Simulates a fixed-size paired-end HiSeq read set for the query benchmark.
# Unlike simulate_one.sh (coverage-proportional, used to build the indexed
# specimens), this always draws N_READS pairs regardless of genome size —
# query benchmark numbers (wall/RSS) must stay comparable across genomes of
# very different sizes. Independent iss run (unseeded), so error draw
# differs from any simulated_data/ reads for the same genome.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ISS="${SCRIPT_DIR}/../.venv/bin/iss"
N_READS=100000
CPUS="${CPUS:-$(sysctl -n hw.logicalcpu 2>/dev/null || nproc 2>/dev/null || echo 2)}"
genome_file="$1"
out_dir="$2"
mkdir -p "${out_dir}"
tmp_fasta=$(mktemp "${TMPDIR:-/tmp}/obikmer_XXXXXX.fna")
trap 'rm -f "${tmp_fasta}"' EXIT
gzip -dc "${genome_file}" > "${tmp_fasta}"
echo "[${out_dir}] ${N_READS} read pairs (query benchmark, fixed size)"
"${ISS}" generate \
--genomes "${tmp_fasta}" \
--model HiSeq \
--n_reads "${N_READS}" \
--cpus "${CPUS}" \
--compress \
--output "${out_dir}/reads"