Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ calibrated for the overdispersion typical of RNA-seq count data.

The standard threshold is FDR < 0.05. For discovery analyses you may want
FDR < 0.1. For validation or follow-up experiments, consider FDR < 0.01.
See :doc:`methods/statistical_models` for the BH procedure and the NaN-propagation warning.
See :doc:`user_guide/analysis` for the BH procedure and the NaN-propagation warning.

**My output has very few significant sites. What's wrong?**

Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Documentation
:caption: Statistical Methods

methods/mapping_filter
methods/statistical_models

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/source/methods/mapping_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ The typical WASP2 workflow:
See Also
--------

- :doc:`statistical_models` — beta-binomial LRT and FDR applied to the counts
- :doc:`/user_guide/analysis` — beta-binomial LRT + FDR CLI and defaults

References
----------
Expand Down
200 changes: 0 additions & 200 deletions docs/source/methods/statistical_models.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/tutorials/bulk_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Step 3 — Test for allelic imbalance

The beta-binomial LRT tests :math:`\mu = 0.5` against :math:`\mu \neq 0.5`
per region, correcting for overdispersion and multiple testing via
Benjamini–Hochberg (:doc:`/methods/statistical_models`).
Benjamini–Hochberg (:doc:`/user_guide/analysis`).

``--phased`` applies only when the VCF GT field uses ``0|1`` / ``1|0``; pass
it off for unphased data.
Expand Down Expand Up @@ -168,5 +168,5 @@ See Also
- :doc:`/user_guide/counting` — counting CLI reference
- :doc:`/user_guide/analysis` — analysis CLI reference
- :doc:`/methods/mapping_filter` — canonical WASP filter contract
- :doc:`/methods/statistical_models` — the LRT and beta-binomial model
- :doc:`/user_guide/analysis` — analysis CLI + defaults + contracts
- :doc:`/tutorials/single_cell_workflow` — single-cell RNA-seq / ATAC-seq
2 changes: 1 addition & 1 deletion docs/source/tutorials/single_cell_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ See Also

- :doc:`/user_guide/single_cell` — barcode format, Seurat/Scanpy export
- :doc:`/user_guide/analysis` — analysis CLI reference
- :doc:`/methods/statistical_models` — beta-binomial LRT
- :doc:`/methods/mapping_filter` — canonical WASP filter contract
- :doc:`bulk_workflow` — sibling tutorial for bulk RNA-seq / ATAC-seq
23 changes: 23 additions & 0 deletions docs/source/user_guide/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,29 @@ Notes
* For bulk analysis, region columns are auto-detected when present in the count
TSV. Use ``--region_col`` only when you need to override that behavior.

Defaults and contracts
----------------------

- ``pseudocount`` defaults to **1** (added to both ``ref_count`` and
``alt_count`` — Laplace-style shrinkage toward :math:`\mu = 0.5`,
conservative under :math:`H_0`).
- ``min_count`` defaults to **10**; regions with :math:`N < 10` are dropped.
- Beta-binomial LRT: :math:`\rho` is held at its **null-model MLE** while
maximizing the alternative likelihood over :math:`\mu` (profile likelihood,
df = 1). :math:`\rho` is not jointly re-estimated under :math:`H_1`.
- Dispersion optimizer bounds :math:`\rho \in (10^{-6},\, 1-10^{-6})`; the
linear-dispersion model clips the logit at :math:`\pm 10` for numerical
stability on extreme :math:`N`.
- FDR correction uses :func:`scipy.stats.false_discovery_control` with
``method='bh'`` (Benjamini–Hochberg). ``scipy`` raises on NaN p-values,
but a hand-written BH loop using ``np.minimum.accumulate`` silently
propagates NaN through the cumulative minimum — always drop or impute
NaN p-values before BH correction.

See the upstream mapping-filter docs (:doc:`/methods/mapping_filter`) for the
WASP2 canonical filter contract that applies to both remapping and counting
steps.

Outputs
-------

Expand Down
Loading