refactor: rename obikmer to obiskim
Rename the `obikmer` binary, crate, and documentation to `obiskim`. This change updates all references in source code, build scripts, CI workflows, and user documentation to reflect the new tool name. - Move `src/obikmer` to `src/obiskim`, renaming the package and binary in `Cargo.toml` and updating `main.rs` and `cli.rs` to use the new name. - Update `src/Cargo.toml` and `src/Cargo.lock` to replace the `obikmer` workspace member with `obiskim`. - Update `Makefile` targets (`build`, `release`, `debug`, `profile-build`) and variables (`CARGO_TOML`, `bump-version`) to build and manage `obiskim`. - Update `.gitea/workflows/release.yml` to build and upload `obiskim` artifacts for Linux and macOS. - Rename all files in `src/obiskim/src/cmd/` from `obikmer` to `obiskim` paths, updating error messages and help text in `index/mod.rs`, `phylo/args/mod.rs`, and `phylo/tnt.rs`. - Update documentation in `UserDocMD/` (including `index.md`, `installation.md`, `architecture.md`, and usage guides) to reference `obiskim` commands and behavior. - Update `benchmark/` scripts and Python verification tools to use `obiskim` binary paths and arguments. - Update `scripts/` (including `smoke_test_*.sh`, `bench_merge_oracle.sh`, and Docker debug scripts) to test and build `obiskim`. - Update comments and error messages in library crates (`obicompactvec`, `obifastwrite`, `obikentropy`, `obikfilter`, `obikindex`, `obikindexer`, `obikphylo`, `obikselect`, `obikseq`, `obiread`, `obisys`) to reference `obiskim`.
This commit is contained in:
1 parent
a71e59d6f0
commit
42d5b881ec
106 files changed
+223
-223
No files matched your search
+3
-3
@@ -1,5 +1,5 @@
|
||||
# Requires GNU Make >= 4.3 (grouped targets &:) — use gmake on macOS
|
||||
BINARY := ../src/target/release/obikmer
|
||||
BINARY := ../src/target/release/obiskim
|
||||
VENV_PY := ../.venv/bin/python3
|
||||
|
||||
# All generated/downloaded artifacts live under RUN/ so the whole tree can be
|
||||
@@ -121,7 +121,7 @@ $(REF_DIST_CSVS) &: $(REF_NPZS) build_reference_dist.py
|
||||
|
||||
reference_dist: $(REF_DIST_CSVS)
|
||||
|
||||
# ── obikmer phylo (presence index) ──────────────────────────────────────────
|
||||
# ── obiskim phylo (presence index) ──────────────────────────────────────────
|
||||
|
||||
$(OBIKMER_PRESENCE_DIST) &: $(RUN)/global_index_presence/index.done $(BINARY)
|
||||
mkdir -p $(RUN)/obikmer_dist/presence
|
||||
@@ -136,7 +136,7 @@ $(OBIKMER_PRESENCE_DIST) &: $(RUN)/global_index_presence/index.done $(BINARY)
|
||||
|
||||
obikmer_dist_presence: $(OBIKMER_PRESENCE_DIST)
|
||||
|
||||
# ── obikmer phylo (count index) ─────────────────────────────────────────────
|
||||
# ── obiskim phylo (count index) ─────────────────────────────────────────────
|
||||
|
||||
$(OBIKMER_COUNT_DIST) &: $(RUN)/global_index_count/index.done $(BINARY)
|
||||
mkdir -p $(RUN)/obikmer_dist/count
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: bench_mphf.sh LABEL
|
||||
#
|
||||
# Measures the obikmer commands that sit on MPHF lookups (see
|
||||
# Measures the obiskim commands that sit on MPHF lookups (see
|
||||
# DevDocMD/implementation/mphf_batch_queries.md for the site inventory), on the
|
||||
# 20-genome benchmark data already built under run/ (`gmake all` first).
|
||||
# Nothing under run/ other than run/bench_mphf/ is written.
|
||||
#
|
||||
# Env:
|
||||
# BINARY obikmer binary to measure (default ../src/target/release/obikmer)
|
||||
# BINARY obiskim binary to measure (default ../src/target/release/obiskim)
|
||||
# REPS repetitions per step (default 3)
|
||||
# CPU_MAX passed as --cpu-max when set (default: all cores)
|
||||
#
|
||||
@@ -19,7 +19,7 @@ set -euo pipefail
|
||||
LABEL="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${BINARY:-${SCRIPT_DIR}/../src/target/release/obikmer}"
|
||||
BINARY="${BINARY:-${SCRIPT_DIR}/../src/target/release/obiskim}"
|
||||
REPS="${REPS:-3}"
|
||||
OUT="${RUN_DIR}/bench_mphf/${LABEL}"
|
||||
CPU=()
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"""Compute reference pairwise distance matrices from per-specimen .npz kmer indexes.
|
||||
|
||||
Reads all .npz files in reference_index/ (each containing sorted uint64 `kmers`
|
||||
and uint32 `counts`), computes all distance metrics supported by `obikmer phylo`,
|
||||
and uint32 `counts`), computes all distance metrics supported by `obiskim phylo`,
|
||||
and writes one CSV per metric to reference_dist/.
|
||||
|
||||
Output CSV format matches `obikmer phylo --output`:
|
||||
Output CSV format matches `obiskim phylo --output`:
|
||||
- first row: "genome", then specimen names
|
||||
- subsequent rows: specimen name, then float or int values
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare all reference distance matrices against obikmer phylo outputs.
|
||||
"""Compare all reference distance matrices against obiskim phylo outputs.
|
||||
|
||||
Reads from:
|
||||
reference_dist/ — ground-truth matrices computed by build_reference_dist.py
|
||||
obikmer_dist/ — matrices produced by `obikmer phylo`
|
||||
obikmer_dist/ — matrices produced by `obiskim phylo`
|
||||
|
||||
Handles label reordering: both matrices are sorted by genome label before
|
||||
element-wise comparison, so column/row order differences are irrelevant.
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
# Usage: filter_one_count.sh SPECIES
|
||||
# Filters global_index_count to keep only kmers specific to SPECIES,
|
||||
# then selects the SPECIES column (to a temp dir, swapped over the
|
||||
# original — obikmer select has no --in-place mode, but its output hard-
|
||||
# original — obiskim select has no --in-place mode, but its output hard-
|
||||
# links each layer's unchanged kmer-identity files rather than copying
|
||||
# them, so this costs no extra disk for those).
|
||||
# Outputs:
|
||||
# specific_index_count/SPECIES/index.done (written by obikmer select)
|
||||
# specific_index_count/SPECIES/index.done (written by obiskim select)
|
||||
# stats/specific_kmer_count/SPECIES.stats (one CSV data row, no header)
|
||||
set -euo pipefail
|
||||
|
||||
SPECIES="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
|
||||
SOURCE="${RUN_DIR}/global_index_count"
|
||||
OUTPUT="${RUN_DIR}/specific_index_count/${SPECIES}"
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
# Usage: filter_one_presence.sh SPECIES
|
||||
# Filters global_index_presence to keep only kmers specific to SPECIES,
|
||||
# then selects the SPECIES column (to a temp dir, swapped over the
|
||||
# original — obikmer select has no --in-place mode, but its output hard-
|
||||
# original — obiskim select has no --in-place mode, but its output hard-
|
||||
# links each layer's unchanged kmer-identity files rather than copying
|
||||
# them, so this costs no extra disk for those).
|
||||
# Outputs:
|
||||
# specific_index_presence/SPECIES/index.done (written by obikmer select)
|
||||
# specific_index_presence/SPECIES/index.done (written by obiskim select)
|
||||
# stats/specific_kmer_presence/SPECIES.stats (one CSV data row, no header)
|
||||
set -euo pipefail
|
||||
|
||||
SPECIES="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
|
||||
SOURCE="${RUN_DIR}/global_index_presence"
|
||||
OUTPUT="${RUN_DIR}/specific_index_presence/${SPECIES}"
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Usage: index_one_count.sh SPECIMEN
|
||||
# SPECIMEN = "species--strain" (Make pattern stem)
|
||||
# Outputs:
|
||||
# specimen_index_count/SPECIMEN/index.done (written by obikmer)
|
||||
# specimen_index_count/SPECIMEN/index.done (written by obiskim)
|
||||
# stats/indexing_count/SPECIMEN.stats (one CSV data row, no header)
|
||||
set -euo pipefail
|
||||
|
||||
SPECIMEN="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
|
||||
species="${SPECIMEN%%--*}"
|
||||
strain="${SPECIMEN#*--}"
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Usage: index_one_presence.sh SPECIMEN
|
||||
# SPECIMEN = "species--strain" (Make pattern stem)
|
||||
# Outputs:
|
||||
# specimen_index_presence/SPECIMEN/index.done (written by obikmer)
|
||||
# specimen_index_presence/SPECIMEN/index.done (written by obiskim)
|
||||
# stats/indexing_presence/SPECIMEN.stats (one CSV data row, no header)
|
||||
set -euo pipefail
|
||||
|
||||
SPECIMEN="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
|
||||
species="${SPECIMEN%%--*}"
|
||||
strain="${SPECIMEN#*--}"
|
||||
|
||||
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
IDX_DIR="${RUN_DIR}/specimen_index_count"
|
||||
OUTPUT="${RUN_DIR}/global_index_count"
|
||||
STATS_DIR="${RUN_DIR}/stats/merge_count"
|
||||
|
||||
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
IDX_DIR="${RUN_DIR}/specimen_index_presence"
|
||||
OUTPUT="${RUN_DIR}/global_index_presence"
|
||||
STATS_DIR="${RUN_DIR}/stats/merge_presence"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# sparse by default (2026-08-28), so the dense comparison arm needs an
|
||||
# explicit rebuild.
|
||||
#
|
||||
# `obikmer pack --dense` cannot do this: it only converts the raw, freshly-
|
||||
# `obiskim pack --dense` cannot do this: it only converts the raw, freshly-
|
||||
# built columnar (per-genome-file, unpacked) matrix into a packed format —
|
||||
# `finalize_indexed` already packs (sparse by default) as the last step of
|
||||
# every index-building command, so there is no columnar leftover for a
|
||||
@@ -13,7 +13,7 @@
|
||||
# directory", `obicompactvec::bitmatrix::packed::pack_bit_matrix` looking
|
||||
# for a `meta.json` that packing already cleaned up).
|
||||
#
|
||||
# `obikmer select` doesn't have that limitation — it always rebuilds its
|
||||
# `obiskim select` doesn't have that limitation — it always rebuilds its
|
||||
# output from scratch via `MatrixBuilder`, reading the source through the
|
||||
# format-agnostic `PersistentBitMatrix`/`PersistentIntMatrix` (Sparse
|
||||
# included, both content kinds — see `obicompactvec::batch_presence_counts`/
|
||||
@@ -31,7 +31,7 @@ set -euo pipefail
|
||||
KIND="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
SOURCE="${RUN_DIR}/global_index_${KIND}"
|
||||
OUTPUT="${RUN_DIR}/global_index_${KIND}_dense"
|
||||
STATS_DIR="${RUN_DIR}/stats/pack_dense_${KIND}"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# explicitly repacked global_index_KIND_dense (see pack_dense.sh).
|
||||
# SPECIMEN = "species--strain" (Make pattern stem), reads from query_data/
|
||||
# Outputs:
|
||||
# query_KIND_MODE/SPECIMEN.fasta.gz (obikmer query output, --count-missing)
|
||||
# query_KIND_MODE/SPECIMEN.fasta.gz (obiskim query output, --count-missing)
|
||||
# stats/query_KIND_MODE/SPECIMEN.stats (one CSV data row, no header)
|
||||
set -euo pipefail
|
||||
|
||||
@@ -15,7 +15,7 @@ MODE="$2"
|
||||
SPECIMEN="$3"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
|
||||
case "${KIND}" in
|
||||
presence|count) ;;
|
||||
|
||||
@@ -14,7 +14,7 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ISS="${SCRIPT_DIR}/../.venv/bin/iss"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
COVERAGE="${COVERAGE:-1}"
|
||||
SEED="${SEED:-1}"
|
||||
READ_LENGTH=150
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare an obikmer count index against a reference kmer set (presence + counts).
|
||||
"""Compare an obiskim count index against a reference kmer set (presence + counts).
|
||||
|
||||
Loads the reference .npz (sorted uint64 kmers + uint32 counts from build_reference.py),
|
||||
streams `obikmer dump` from a --with-counts index, then reports:
|
||||
streams `obiskim dump` from a --with-counts index, then reports:
|
||||
- false negatives : kmers in reference absent from the index
|
||||
- false positives : kmers in the index absent from the reference
|
||||
- count mismatches: kmers present in both but with differing counts
|
||||
@@ -44,7 +44,7 @@ def decode_kmer(val: int, k: int) -> str:
|
||||
# ── dump parsing ──────────────────────────────────────────────────────────────
|
||||
|
||||
def load_index(obikmer_bin: str, index_dir: str) -> tuple[np.ndarray, np.ndarray]:
|
||||
"""Stream `obikmer dump` and return (kmers_sorted_uint64, counts_uint32)."""
|
||||
"""Stream `obiskim dump` and return (kmers_sorted_uint64, counts_uint32)."""
|
||||
cmd = [obikmer_bin, 'dump', index_dir]
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
||||
text=True)
|
||||
@@ -59,7 +59,7 @@ def load_index(obikmer_bin: str, index_dir: str) -> tuple[np.ndarray, np.ndarray
|
||||
counts.append(int(parts[1]))
|
||||
proc.wait()
|
||||
if proc.returncode != 0:
|
||||
print(f'ERROR: obikmer dump exited {proc.returncode}', file=sys.stderr)
|
||||
print(f'ERROR: obiskim dump exited {proc.returncode}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
order = np.argsort(np.array(kmers, dtype=np.uint64), kind='stable')
|
||||
return (np.array(kmers, dtype=np.uint64)[order],
|
||||
@@ -104,9 +104,9 @@ def main() -> None:
|
||||
ap.add_argument('reference', metavar='REF_NPZ', nargs='?',
|
||||
help='Reference .npz file')
|
||||
ap.add_argument('index', metavar='INDEX_DIR', nargs='?',
|
||||
help='obikmer index directory (built with --with-counts)')
|
||||
ap.add_argument('--obikmer', default='obikmer',
|
||||
help='Path to obikmer binary')
|
||||
help='obiskim index directory (built with --with-counts)')
|
||||
ap.add_argument('--obiskim', default='obiskim',
|
||||
help='Path to obiskim binary')
|
||||
ap.add_argument('--species', default='')
|
||||
ap.add_argument('--strain', default='')
|
||||
ap.add_argument('--header', action='store_true',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify the merged count index against all per-specimen reference sets.
|
||||
|
||||
Streams `obikmer dump` once on the merged index, accumulates per-specimen
|
||||
Streams `obiskim dump` once on the merged index, accumulates per-specimen
|
||||
kmer+count pairs from each column, then compares each against its reference .npz.
|
||||
|
||||
Output to stdout: one CSV row per specimen (same columns as verify_count.py)
|
||||
@@ -70,7 +70,7 @@ def stream_merged_dump(obikmer_bin: str, index_dir: str,
|
||||
|
||||
proc.wait()
|
||||
if proc.returncode != 0:
|
||||
print(f'ERROR: obikmer dump exited {proc.returncode}', file=sys.stderr)
|
||||
print(f'ERROR: obiskim dump exited {proc.returncode}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
return specimen_names, per_specimen
|
||||
@@ -156,7 +156,7 @@ def main() -> None:
|
||||
help='Merged count index directory')
|
||||
ap.add_argument('ref_dir', metavar='REF_DIR', nargs='?',
|
||||
help='Directory containing per-specimen .npz reference files')
|
||||
ap.add_argument('--obikmer', default='obikmer')
|
||||
ap.add_argument('--obiskim', default='obiskim')
|
||||
ap.add_argument('--header', action='store_true',
|
||||
help='Print CSV header and exit')
|
||||
ap.add_argument('--save-fn', metavar='DIR',
|
||||
|
||||
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
INDEX="${RUN_DIR}/global_index_count"
|
||||
REF_DIR="${RUN_DIR}/reference_index"
|
||||
STATS_DIR="${RUN_DIR}/stats/verify_merge_count"
|
||||
@@ -17,7 +17,7 @@ CURRENT="${STATS_DIR}/current.csv"
|
||||
"${PYTHON}" "${VERIFY_PY}" --header >"${CURRENT}"
|
||||
|
||||
"${PYTHON}" "${VERIFY_PY}" \
|
||||
--obikmer "${BINARY}" \
|
||||
--obiskim "${BINARY}" \
|
||||
"${INDEX}" "${REF_DIR}" \
|
||||
>>"${CURRENT}"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify the merged presence index against all per-specimen reference sets.
|
||||
|
||||
Streams `obikmer dump` once on the merged index, accumulates per-specimen
|
||||
Streams `obiskim dump` once on the merged index, accumulates per-specimen
|
||||
kmer sets from each column, then compares each against its reference .npz.
|
||||
|
||||
Output to stdout: one CSV row per specimen (same columns as verify_presence.py)
|
||||
@@ -66,7 +66,7 @@ def stream_merged_dump(obikmer_bin: str, index_dir: str,
|
||||
|
||||
proc.wait()
|
||||
if proc.returncode != 0:
|
||||
print(f'ERROR: obikmer dump exited {proc.returncode}', file=sys.stderr)
|
||||
print(f'ERROR: obiskim dump exited {proc.returncode}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
return specimen_names, per_specimen
|
||||
@@ -130,7 +130,7 @@ def main() -> None:
|
||||
help='Merged presence index directory')
|
||||
ap.add_argument('ref_dir', metavar='REF_DIR', nargs='?',
|
||||
help='Directory containing per-specimen .npz reference files')
|
||||
ap.add_argument('--obikmer', default='obikmer')
|
||||
ap.add_argument('--obiskim', default='obiskim')
|
||||
ap.add_argument('--header', action='store_true',
|
||||
help='Print CSV header and exit')
|
||||
ap.add_argument('--save-fn', metavar='DIR',
|
||||
|
||||
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
INDEX="${RUN_DIR}/global_index_presence"
|
||||
REF_DIR="${RUN_DIR}/reference_index"
|
||||
STATS_DIR="${RUN_DIR}/stats/verify_merge_presence"
|
||||
@@ -17,7 +17,7 @@ CURRENT="${STATS_DIR}/current.csv"
|
||||
"${PYTHON}" "${VERIFY_PY}" --header >"${CURRENT}"
|
||||
|
||||
"${PYTHON}" "${VERIFY_PY}" \
|
||||
--obikmer "${BINARY}" \
|
||||
--obiskim "${BINARY}" \
|
||||
"${INDEX}" "${REF_DIR}" \
|
||||
>>"${CURRENT}"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ set -euo pipefail
|
||||
SPECIMEN="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
PYTHON="${SCRIPT_DIR}/../.venv/bin/python3"
|
||||
VERIFY_PY="${SCRIPT_DIR}/verify_count.py"
|
||||
|
||||
@@ -24,7 +24,7 @@ mkdir -p "${STATS_DIR}"
|
||||
echo "[${SPECIMEN}] verifying count"
|
||||
|
||||
"${PYTHON}" "${VERIFY_PY}" \
|
||||
--obikmer "${BINARY}" \
|
||||
--obiskim "${BINARY}" \
|
||||
--species "${species}" \
|
||||
--strain "${strain}" \
|
||||
"${REF_NPZ}" "${INDEX_DIR}" \
|
||||
|
||||
@@ -7,7 +7,7 @@ set -euo pipefail
|
||||
SPECIMEN="$1"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUN_DIR="${SCRIPT_DIR}/run"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obikmer"
|
||||
BINARY="${SCRIPT_DIR}/../src/target/release/obiskim"
|
||||
PYTHON="${SCRIPT_DIR}/../.venv/bin/python3"
|
||||
VERIFY_PY="${SCRIPT_DIR}/verify_presence.py"
|
||||
|
||||
@@ -24,7 +24,7 @@ mkdir -p "${STATS_DIR}"
|
||||
echo "[${SPECIMEN}] verifying presence"
|
||||
|
||||
"${PYTHON}" "${VERIFY_PY}" \
|
||||
--obikmer "${BINARY}" \
|
||||
--obiskim "${BINARY}" \
|
||||
--species "${species}" \
|
||||
--strain "${strain}" \
|
||||
"${REF_NPZ}" "${INDEX_DIR}" \
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare an obikmer index against a reference kmer set (presence/absence).
|
||||
"""Compare an obiskim index against a reference kmer set (presence/absence).
|
||||
|
||||
Loads the reference .npz (sorted uint64 kmers built by build_reference.py),
|
||||
streams the output of `obikmer dump`, encodes each kmer string to uint64,
|
||||
streams the output of `obiskim dump`, encodes each kmer string to uint64,
|
||||
then reports false negatives and false positives using numpy set operations.
|
||||
|
||||
Output to stdout: one CSV row
|
||||
@@ -41,7 +41,7 @@ def decode_kmer(val: int, k: int) -> str:
|
||||
# ── dump parsing ──────────────────────────────────────────────────────────────
|
||||
|
||||
def load_index_kmers(obikmer_bin: str, index_dir: str) -> np.ndarray:
|
||||
"""Stream `obikmer dump` and return a sorted uint64 array of kmer integers."""
|
||||
"""Stream `obiskim dump` and return a sorted uint64 array of kmer integers."""
|
||||
cmd = [obikmer_bin, 'dump', index_dir]
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
||||
text=True)
|
||||
@@ -55,7 +55,7 @@ def load_index_kmers(obikmer_bin: str, index_dir: str) -> np.ndarray:
|
||||
kmers.append(encode_kmer(kmer_str))
|
||||
proc.wait()
|
||||
if proc.returncode != 0:
|
||||
print(f'ERROR: obikmer dump exited {proc.returncode}', file=sys.stderr)
|
||||
print(f'ERROR: obiskim dump exited {proc.returncode}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
arr = np.array(kmers, dtype=np.uint64)
|
||||
arr.sort()
|
||||
@@ -77,8 +77,8 @@ def main() -> None:
|
||||
ap = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument('reference', metavar='REF_NPZ', nargs='?', help='Reference .npz file')
|
||||
ap.add_argument('index', metavar='INDEX_DIR', nargs='?', help='obikmer index directory')
|
||||
ap.add_argument('--obikmer', default='obikmer', help='Path to obikmer binary')
|
||||
ap.add_argument('index', metavar='INDEX_DIR', nargs='?', help='obiskim index directory')
|
||||
ap.add_argument('--obiskim', default='obiskim', help='Path to obiskim binary')
|
||||
ap.add_argument('--species', default='', help='Species label for CSV row')
|
||||
ap.add_argument('--strain', default='', help='Strain label for CSV row')
|
||||
ap.add_argument('--header', action='store_true', help='Print CSV header and exit')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare dense vs sparse obikmer query output for one specimen.
|
||||
"""Compare dense vs sparse obiskim query output for one specimen.
|
||||
|
||||
Both files are `obikmer query --count-missing` output: OBITools4-style
|
||||
Both files are `obiskim query --count-missing` output: OBITools4-style
|
||||
FASTA, one record per read — `>id {"kmer_count":N,"kmer_missing":M,
|
||||
"kmer_strict_matches":{"label":count,...}}`. Packing format (dense vs
|
||||
sparse presence matrix) must not change query results — only I/O access
|
||||
|
||||
Reference in new issue
Block a user