feat: add k-mer sharing estimation and Poisson-binomial null model
Add a new `estimate --index` command to compare observed k-mer sharing against a random-sequence model using a Poisson-binomial distribution. Introduce the `row_presence_histogram` API to support this analysis across various matrix types. Update documentation and dependencies accordingly. - Add `src/obikstats/src/null_model.rs` implementing `SharingNullModel` and `SharingRow` for computing cumulative probabilities and false discovery rates based on a Poisson-binomial distribution. - Add `src/obikstats/src/sharing.rs` defining `GenomeSharing` and `SharingSpectrum` to compute k-mer sharing spectra using parallel map-reduce. - Add `src/obikmer/src/cmd/estimate/sharing.rs` with `run` and `write_csv` to execute sharing estimation and output CSV results containing observed, expected, and deviation metrics. - Modify `src/obikmer/src/cmd/estimate/mod.rs` to support the new `--index` subcommand, adding `EstimateArgs` fields for index path, presence threshold, and output file. - Add `src/obicompactvec/src/row_histogram.rs` implementing `row_presence_histogram` for `PersistentIntMatrix`, `PersistentBitMatrix`, and sparse matrices to count rows present in exactly $j$ columns. - Update `src/obikindex/src/layer/content_layer.rs` and `src/obikindex/src/layer/typed_layer.rs` to expose the new `row_presence_histogram` method, dispatching based on layer type. - Add tests in `src/obicompactvec/src/tests/bitmatrix.rs`, `intmatrix.rs`, and `sparse.rs` to verify `count_geq` and `row_presence_histogram` against naive implementations for various matrix structures. - Update `UserDocMD/theory/kmer_indexing/kmers.md` to document the Poisson-binomial approach, $D_r$ bounds, and FDR calculations, replacing previous binomial approximations. - Update `UserDocMD/usage/estimate.md` to describe the two uses of `estimate`: parameter estimation and index comparison via `--index`. - Add `wiki` target to `Makefile` for regenerating documentation from user docs. - Bump `obikmer` package version from 1.4.5 to 1.4.6 in `Cargo.toml` and `Cargo.lock`.
This commit is contained in:
1 parent
6d6d5e5e53
commit
36c7247acb
17 files changed
+970
-378
No files matched your search
@@ -91,6 +91,17 @@ doc-user-serve: $(MKDOCS)
|
||||
clean-doc-user:
|
||||
rm -rf $(DOC_USER_SITE)/
|
||||
|
||||
# Regenerates the Gitea/Forgejo wiki (a separate repository, checked out next
|
||||
# to this one) from the user documentation. Only rewrites its working tree:
|
||||
# committing and pushing it stays a manual step. Not part of `clean`.
|
||||
DOC_WIKI_DIR := ../obikmer.wiki
|
||||
|
||||
.PHONY: wiki
|
||||
wiki:
|
||||
@command -v pmotransdoc >/dev/null || { echo "pmotransdoc not found in PATH" >&2; exit 1; }
|
||||
@test -d $(DOC_WIKI_DIR)/.git || { echo "$(DOC_WIKI_DIR) is not a git checkout of the wiki" >&2; exit 1; }
|
||||
pmotransdoc $(DOC_USER_DIR) $(DOC_WIKI_DIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-doc clean-doc-user
|
||||
rm -rf $(VENV)
|
||||
|
||||
Reference in new issue
Block a user