refactor: rename project from obikmer to obiskim
Update the project name, binary, and all associated documentation, scripts, and configuration files from `obikmer` to `obiskim`. This change ensures consistency across the codebase, including lock files, VCF outputs, benchmark targets, and user-facing documentation. - Update `mkdocs.yml` and `.crate-kit/VERSION` to reflect the new project name and version 0.3.4. - Rename all references in `DevDocMD/` documentation, including architecture, implementation, and theory sections, from `obikmer` to `obiskim`. - Update `UserDocMD/` files to use `.obiskim.lock` and `.obiskim.gate` for lock files, and update VCF contig IDs to `obiskim_<partition>_<layer>`. - Modify `benchmark/` scripts and Makefiles to use `obiskim` binary names and `obiskim_dist/` directories for distribution and comparison tasks. - Update `prompts/` files to reference the `obiskim` repository and commands instead of `obikmer`. - Rename temporary directories in `scripts/` smoke tests from `obikmer_*` to `obiskim_*`. - Update `src/obikphylo/src/siblings/algorithms/alignment_vcf.rs` to use `obiskim` in VCF source identifiers and assertions. - Update `src/obiskim/Cargo.toml` version to 1.4.9 and update `src/obiskim/src/cmd/phylo/args/outputs.rs` documentation. - Update `src/obisys/src/lock.rs` to use `.obiskim.lock`, `.obiskim.gate`, and `.obiskim.promote` file names.
This commit is contained in:
1 parent
42d5b881ec
commit
917cb26186
48 files changed
+236
-209
No files matched your search
@@ -13,4 +13,4 @@
|
||||
Le repli en classes d'équivalence circulaires + brin inverse (décrit dans une version antérieure de ce document) a été supprimé : voir la section « Why no equivalence classes » de `entropy.md` pour la justification théorique et numérique.
|
||||
|
||||
Vérifier que les paramètres `theta` et `level_max` dans le CLI
|
||||
(`obikmer/src/cli.rs` → `CommonArgs`) correspondent bien à ce qui est décrit.
|
||||
(`obiskim/src/cli.rs` → `CommonArgs`) correspondent bien à ce qui est décrit.
|
||||
@@ -205,7 +205,7 @@ single-copy at that locus.
|
||||
|
||||
## Context, detectability, and a 3-way ordinal distance per pair
|
||||
|
||||
Empirical follow-up to the pseudo-alignment idea above: `obikmer phylo
|
||||
Empirical follow-up to the pseudo-alignment idea above: `obiskim phylo
|
||||
--snp` was run on a real 20-genome benchmark index and the resulting FASTA
|
||||
fed to `raxml-ng`. Two problems surfaced, both traced back to conflating
|
||||
distinct notions under one symbol.
|
||||
@@ -552,7 +552,7 @@ informative across domains with this character type. Exploratory only —
|
||||
run entirely outside the repo (`/tmp/tnt_run`, TNT installed locally under
|
||||
`TNT/`), no new Rust code. Kept here as the record of what was learned.
|
||||
|
||||
**Pipeline.** `obikmer phylo --snp` emits one IUPAC-coded pseudo-alignment
|
||||
**Pipeline.** `obiskim phylo --snp` emits one IUPAC-coded pseudo-alignment
|
||||
row per genome (`snp_pseudo_alignment`, one column per family with
|
||||
`family_size() >= 2`). A small external Python script decodes IUPAC back to
|
||||
the 16-state bitmask, applies the set-edit-distance formula above, and
|
||||
@@ -622,7 +622,7 @@ estimator.
|
||||
|
||||
### Native `--sankoff --tnt`/`--phyg` export (2026-08-12), superseding the external scripts above
|
||||
|
||||
The ad hoc Python glue from the previous section is superseded: `obikmer
|
||||
The ad hoc Python glue from the previous section is superseded: `obiskim
|
||||
distance --sankoff` now calibrates the matrix natively (`p_hat`, 6-category
|
||||
substitution costs, `c_ctx` weighted by `mean_sub_cost` — see the worked
|
||||
example above) and `--tnt`/`--phyg` each write a ready-to-run script from
|
||||
@@ -630,7 +630,7 @@ it, no external script needed. `∅` is an ordinary 16th state throughout
|
||||
(never `-`), specifically to avoid gap-semantics confusion in downstream
|
||||
tools — see "A concrete Sankoff cost matrix" above for why.
|
||||
|
||||
**TNT (`--tnt`).** `write_sankoff_tnt` (`obikmer/src/cmd/phylo/mod.rs`)
|
||||
**TNT (`--tnt`).** `write_sankoff_tnt` (`obiskim/src/cmd/phylo/mod.rs`)
|
||||
recodes to TNT's own `0-9A-F` xread alphabet (its default reader rejects
|
||||
the wider IUPAC set otherwise), scales and rounds costs to integers
|
||||
(`smatrix`/`cost` reject decimals), then re-runs integer Floyd-Warshall on
|
||||
@@ -767,7 +767,7 @@ from the alignment") does **not** work as a shortcut for this — for a
|
||||
custom-file morphology model, `readParameters` always requires the file's
|
||||
own frequency line unconditionally; omitting it and passing `+F` instead
|
||||
just fails (`ERROR: State frequencies could not be read`). `π` has to be
|
||||
computed by `obikmer` and written into the file, not left to IQ-TREE.
|
||||
computed by `obiskim` and written into the file, not left to IQ-TREE.
|
||||
|
||||
Net effect: no free-rate ML estimation needed for this piece at all (the
|
||||
mistaken assumption that motivated most of this discussion — that
|
||||
@@ -843,12 +843,12 @@ with no error to catch it. **Checked against the real biological alignment**
|
||||
symbol `N` (IUPAC "all four bases ambiguous," state index 15) occurs 1383
|
||||
times across 13 of the 20 sequences — present, so this specific real
|
||||
dataset is not at risk. Still worth a real, general presence check inside
|
||||
`obikmer` before this is wired in, rather than assuming every future
|
||||
`obiskim` before this is wired in, rather than assuming every future
|
||||
dataset will have `N` too (nothing in IQ-TREE would catch it if not).
|
||||
|
||||
**Resolution: subset + compact-renumber, not rely on all 16 appearing.**
|
||||
Since IQ-TREE always infers `N` from the alignment's own content and
|
||||
nothing overrides that, the fix is to make the file `obikmer` writes match
|
||||
nothing overrides that, the fix is to make the file `obiskim` writes match
|
||||
that inference *by construction*, for every run, rather than hope the
|
||||
16th (or any particular) state happens to occur:
|
||||
1. Scan the real alignment for which of the 16 canonical states actually
|
||||
@@ -902,7 +902,7 @@ sections below, which implement and then substantially revise this.
|
||||
|
||||
### `R`/`π` implemented; `--exclude-genome` added; rogue-taxon test negative (2026-08-12)
|
||||
|
||||
`write_iqtree` (`obikmer/src/cmd/phylo/iqtree.rs`) implements exactly
|
||||
`write_iqtree` (`obiskim/src/cmd/phylo/iqtree.rs`) implements exactly
|
||||
the `R = exp(-cost)` / empirical-`π` design above: writes
|
||||
`<prefix>_iqtree.model` (lower-triangular `R`, PAML order, then `π`) and
|
||||
`<prefix>_iqtree.fasta` (alignment recoded to the compact `0..k-1`
|
||||
@@ -949,7 +949,7 @@ tell: with `n_eligible=1`, the ratio can only be exactly `0` or `1`, so
|
||||
possibly ascertainment bias — see below — or possibly a few genuinely
|
||||
ultra-conserved loci; not resolved).
|
||||
|
||||
**`--exclude-genome LABEL`** (repeatable, `obikmer phylo`) added for
|
||||
**`--exclude-genome LABEL`** (repeatable, `obiskim phylo`) added for
|
||||
exactly this kind of test: zeroes the excluded genome's row/column in
|
||||
`RawSnpDistanceOutput` after `raw_snp_distance` runs (a pair with zero
|
||||
counts is already skipped by `calibrate_p_hat`/`base_pair_tally` — no
|
||||
@@ -1165,7 +1165,7 @@ silently wrong data for TNT/PhyG, and a hard failure for IQ-TREE's `+ASC`
|
||||
(verified: excluding 2 taxa on the benchmark left 116,351 such columns —
|
||||
matches the manual `+ASC` failures hit earlier in this same investigation,
|
||||
before `--exclude-genome` existed). Fixed in `drop_excluded`
|
||||
(`obikmer/src/cmd/phylo/mod.rs`): after dropping excluded rows,
|
||||
(`obiskim/src/cmd/phylo/mod.rs`): after dropping excluded rows,
|
||||
re-scan each column among the *surviving* sequences and drop any that are
|
||||
now constant. Verified: 908,723 → 792,372 sites after excluding 2 taxa,
|
||||
zero monomorphic columns remain, `π` recomputed from the corrected
|
||||
@@ -1465,7 +1465,7 @@ Two helpers do not yet exist and are prerequisites:
|
||||
takes the min by `seq_hash()` — the same selection `RollingStat` performs,
|
||||
evaluated once. Partition index is then
|
||||
`(minimizer.seq_hash() & (n_partitions - 1)) as usize`, exactly as
|
||||
`QueryBatch::from_records` (`obikmer/src/cmd/query.rs:142`); `n_partitions`
|
||||
`QueryBatch::from_records` (`obiskim/src/cmd/query.rs:142`); `n_partitions`
|
||||
is a power of two so the mask is valid.
|
||||
|
||||
### Step 1 — the tally accumulator (`obikindex`)
|
||||
@@ -1586,7 +1586,7 @@ ever queries. Instead: compute it lazily, on first `phylo` call against a
|
||||
given index, and persist the result alongside that index for subsequent
|
||||
calls — the same lazy-derived-cache pattern `PersistentBitMatrix` already
|
||||
uses for `Columnar` -> `Packed`. This requires no explicit invalidation for
|
||||
`merge` or `filter` (`obikindex/src/merge.rs`, `obikmer/src/cmd/filter.rs`):
|
||||
`merge` or `filter` (`obikindex/src/merge.rs`, `obiskim/src/cmd/filter.rs`):
|
||||
both only ever write to a fresh `--output` directory, never mutate an input
|
||||
index in place, so a re-merged/re-filtered index is simply a new state with
|
||||
no annex yet. `select --in-place` (`select_layer.rs:139-235`) is the
|
||||
@@ -1778,7 +1778,7 @@ above) is observed anywhere in the index — fixes both:
|
||||
`bitmatrix.rs:264-287`); if absent, run step 3 and persist; if present,
|
||||
mmap and reuse.
|
||||
5. **Invalidation.** `merge` and `filter` always write to a fresh `--output`
|
||||
directory (`obikindex/src/merge.rs`, `obikmer/src/cmd/filter.rs`) so a
|
||||
directory (`obikindex/src/merge.rs`, `obiskim/src/cmd/filter.rs`) so a
|
||||
re-merged/re-filtered index simply has no annex yet — nothing to
|
||||
invalidate. `select --in-place` (`select_layer.rs:139-235`) mutates
|
||||
columns of an existing index without changing its location, which can
|
||||
@@ -1810,7 +1810,7 @@ accumulated counts (same shape as `jaccard_to_mash`):
|
||||
Guard the singularities (`p >= 3/4` for JC, `1-2P-Q <= 0` or `1-2Q <= 0` for
|
||||
K2P) by clamping to a max distance, as `jaccard_to_mash` clamps `J <= 0`.
|
||||
|
||||
### Step 4 — surfacing (`obikindex` + `obikmer` CLI)
|
||||
### Step 4 — surfacing (`obikindex` + `obiskim` CLI)
|
||||
|
||||
These metrics do not fit `DistanceMetric`'s current `LayeredStore`-partial
|
||||
dispatch (they need the cross-partition sweep and produce a different
|
||||
@@ -1853,7 +1853,7 @@ lookups proportionally; `p_hat` is unbiased. Off by default (exact).
|
||||
|
||||
1. Step 0 primitives + their unit tests (self-contained, no distance wiring).
|
||||
This also unblocks the long-declared-but-unimplemented `query --mismatch`
|
||||
(`obikmer/src/cmd/query.rs:676`, currently a warning), which needs the same
|
||||
(`obiskim/src/cmd/query.rs:676`, currently a warning), which needs the same
|
||||
neighbour + routing machinery.
|
||||
2. `SnpTally` + finalisation math with a brute-force (non-swept) reference
|
||||
backend, validated on a tiny index.
|
||||
@@ -1905,7 +1905,7 @@ correctness problem rather than a power problem. Not designed yet.
|
||||
|
||||
### `--free-loss` implemented (2026-08-13)
|
||||
|
||||
`obikmer phylo --sankoff --free-loss` (with `--tnt`/`--phyg`/`--iqtree`)
|
||||
`obiskim phylo --sankoff --free-loss` (with `--tnt`/`--phyg`/`--iqtree`)
|
||||
recodes `∅` (a family's non-detection in a genome) to `?` instead of the
|
||||
default ordinary, costed 16th state — the resolution of the discussion
|
||||
above. `?`, not `-`: `-` still carries gap/indel semantics in TNT/PhyG/
|
||||
@@ -1988,7 +1988,7 @@ filtered alignment — next verification step, alongside the still-open PhyG
|
||||
**Diagnostic added: `--family-overlap`.** Real per-genome-pair count of
|
||||
shared variable families (columns where neither genome is `∅`), diagonal
|
||||
kept (degenerates to "genome's own total family count", not a separate
|
||||
computation — see `obikmer/src/cmd/phylo/family_overlap.rs`). On the
|
||||
computation — see `obiskim/src/cmd/phylo/family_overlap.rs`). On the
|
||||
20-genome benchmark this predicted the `--tnt`/`--iqtree` rogue-placement
|
||||
pattern exactly: Candidozyma shares **0** families with all 19 others (hence
|
||||
its ~0-length branch, placed anywhere); the mean off-diagonal shared-family
|
||||
@@ -2052,7 +2052,7 @@ it stores) from a run on one taxon set against a regenerated `iqtree.fasta`
|
||||
with a different taxon count crashes with `Assertion 'i >= 0 && i <
|
||||
(int)seq_names.size()' failed` in `Alignment::getSeqName` /
|
||||
`PhyloTree::assignLeafNames` — `--undo` tries to graft a stored tree with
|
||||
the old leaf count onto the new, smaller alignment. Not an `obikmer` bug;
|
||||
the old leaf count onto the new, smaller alignment. Not an `obiskim` bug;
|
||||
avoid by using a fresh `--prefix` (or `-redo`) whenever the underlying
|
||||
alignment's taxon set changes, never `--undo` across them.
|
||||
|
||||
@@ -2060,7 +2060,7 @@ alignment's taxon set changes, never `--undo` across them.
|
||||
|
||||
User-reported suspicion: `--iqtree --free-loss` state frequencies "don't
|
||||
sum to 1". Verified both by code trace and unit test
|
||||
(`obikmer/src/cmd/phylo/iqtree.rs`, `free_loss_excludes_absent_state_and_freq_sums_to_one`)
|
||||
(`obiskim/src/cmd/phylo/iqtree.rs`, `free_loss_excludes_absent_state_and_freq_sums_to_one`)
|
||||
— **not a bug**: `compact_alphabet`'s counting loop `continue`s on
|
||||
`free_loss && b == b'-'` *before* recoding/counting, so the absent state
|
||||
never enters `occurs`/`counts`, and `freq[i] = counts[old]/total` sums to
|
||||
@@ -2152,7 +2152,7 @@ observed central bases across genomes is far more likely to be
|
||||
assembly/detection noise than a genuinely ancestral, widely-preserved
|
||||
polymorphism, the same reasoning already used for `-`.
|
||||
|
||||
**Mechanism** (`obikmer/src/cmd/phylo/iqtree.rs`, `write_iqtree`): a
|
||||
**Mechanism** (`obiskim/src/cmd/phylo/iqtree.rs`, `write_iqtree`): a
|
||||
*second* filtering pass, active only under `--free-loss`. After the first
|
||||
`compact_alphabet` call (post ascertainment-filtering), any state with
|
||||
`freq < --iqtree-min-freq` (default `0.001`) has every occurrence recoded
|
||||
@@ -2588,7 +2588,7 @@ generally (the same mechanism as `corrected_log`, not a coincidence — Jin &
|
||||
Nei's own formula is the `θ=0` special case applied to a pairwise `D`
|
||||
rather than a whole-tree one). Explicitly stated by the authors as
|
||||
infeasible beyond about 5–6 taxa (their own simulations stop at 5); not a
|
||||
candidate for obikmer's typical genome counts. Notable contribution worth
|
||||
candidate for obiskim's typical genome counts. Notable contribution worth
|
||||
keeping in mind regardless: `ρ = (1+θα)/(1+α)` is shown to be a more robust
|
||||
summary of rate heterogeneity than `α` alone whenever `θ` isn't negligible
|
||||
— `α` and `θ` are confounded (nearly-invariant sites can come from either a
|
||||
@@ -2610,7 +2610,7 @@ not a closed form; (4) the site-level `k̂` values (real-valued, not
|
||||
integers) are fit to a negative binomial (Uzzell & Corbin 1971) by ML to
|
||||
get α — again no closed form, numerical optimization. This is a real
|
||||
per-site pipeline requiring a tree *before* distances/α can be computed —
|
||||
the reverse of obikmer's current dependency order (`snp_distance` computes
|
||||
the reverse of obiskim's current dependency order (`snp_distance` computes
|
||||
distances, which `--nj`/`--upgma` only turn into a tree *afterward*). Their
|
||||
own answer to this chicken-and-egg problem is an iterative
|
||||
distance→tree→α→distance loop, which they themselves flag as expensive.
|
||||
@@ -2679,7 +2679,7 @@ proper is judged not worth the effort).
|
||||
**Correctness bug, not just a performance one.** `--sankoff`/`--tnt`/`--phyg`/
|
||||
`--iqtree` (via `SiblingExt::sankoff_bundle`) and a `snp-*` `--distance`
|
||||
(via `SiblingExt::snp_distance`) always consume the *exact same* selection
|
||||
parameters when requested together in one `obikmer phylo` invocation
|
||||
parameters when requested together in one `obiskim phylo` invocation
|
||||
(`n`/`free_loss`/`no_ambiguity`/excluded-set/`entropy_bias` — the CLI has
|
||||
no way to give them different values in one run, see `cmd/phylo/args.rs`).
|
||||
Before this fix, each independently called `sample_index`, and
|
||||
@@ -2721,7 +2721,7 @@ The in-process fix above only covered reuse *within one command*.
|
||||
`--session DIR` (`cmd/phylo/args.rs`) names a directory (outside the
|
||||
index) that persists the `snp-*` `--distance` sample — the
|
||||
`PairwiseTally`/`PartitionDispersion` pair `sample_index` would otherwise
|
||||
rebuild from scratch — across *separate* `obikmer phylo` invocations.
|
||||
rebuild from scratch — across *separate* `obiskim phylo` invocations.
|
||||
|
||||
**Crate placement, as planned**: a new **`obiksession`** crate
|
||||
(`src/obiksession/`), domain-agnostic — no `PairwiseTally`/"site" concept
|
||||
@@ -2878,7 +2878,7 @@ their existing CSV-only format.
|
||||
`phylo --vcf` writes the drawn sites of `--pseudo-alignment` as a VCF
|
||||
(`--fasta`/`--vcf` choose the formats, FASTA is the default, both can be
|
||||
combined). A family has no genomic coordinate, so coordinates are virtual and
|
||||
derived from where the scan finds the family: `CHROM = obikmer_<partition>_<layer>`,
|
||||
derived from where the scan finds the family: `CHROM = obiskim_<partition>_<layer>`,
|
||||
`POS = family_idx + 1` (`scan_layer_families`' iteration-order index inside
|
||||
that layer). Stable for a given index + annex, sorted by construction because
|
||||
`on_family` is replayed in `family_idx` order. A global dense rank or a bit
|
||||
@@ -2920,7 +2920,7 @@ Checked with `bcftools view`/`stats` and `tabix`: no warning, the sites with
|
||||
majority base (alphabetical on ties).
|
||||
|
||||
Ploidy. VCF allows any ploidy in `GT` (number of alleles written, variable
|
||||
per sample/site), but an obikmer cell only says *which* forms a genome
|
||||
per sample/site), but an obiskim cell only says *which* forms a genome
|
||||
carries, not their multiplicity (`A/A/G` and `A/G/G` are both `R`), nor
|
||||
whether several forms mean heterozygosity or paralogues. Compromise chosen:
|
||||
`--no-ambiguity` => haploid (ambiguous cells are already `?`); otherwise
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
## Notes
|
||||
|
||||
Vérifier que la doc mentionne bien que le nombre de partitions est une puissance de 2
|
||||
(converti par `partitions_to_bits` dans `obikmer/src/cli.rs`).
|
||||
(converti par `partitions_to_bits` dans `obiskim/src/cli.rs`).
|
||||
@@ -51,7 +51,7 @@ Structural tension: path coherence (long unitigs) needs a key shared by consecut
|
||||
|
||||
## Open measurements (index not on this machine)
|
||||
|
||||
1. Family-size histogram of the real index: `obikmer phylo --sibling-hist` (needs a built annex).
|
||||
1. Family-size histogram of the real index: `obiskim phylo --sibling-hist` (needs a built annex).
|
||||
2. Time and peak RSS of `--sibling-annex` on the Vaccinium/Salix index (`Stage` "sibling_annex" traces time; peak RSS from outside).
|
||||
3. Only if those show the sequential sweep or the probe volume is a real bottleneck: real-index test of scheme B or of a smaller $m$.
|
||||
|
||||
|
||||
Reference in new issue
Block a user