BranchModel_test — Bayesian test of branch-category assignment hypotheses

Usage

BranchModel_test(submodel: Double -> CTMC<Codons<a>>, omegas: List<Double>, hypothesis: Int, branchCats: IntMap<List<Int>>) → CTMC<Codons<a>>

Arguments

Underlined names in default expressions refer to other arguments. A default beginning with ~ specifies a prior distribution.

submodel:

The codon model constructed for each omega.

Default: |w:GY94(omega=w)|

omegas:

The omega value shared by every occurrence of each numbered branch category.

Default: ~IID(numberHypothesisBranchCategories(branchCats),LogNormal(0,1))

hypothesis:

The zero-based position selected from every branch category vector.

Default: ~UniformInt(0,numberBranchHypotheses(branchCats)-1)

branchCats:

The positional category assignments supplied by foreground={...} annotations.

Default: The branch category vectors in the current context

Original default expressions
omegas
~IID(numberHypothesisBranchCategories(@branchCats),LogNormal(0,1))
hypothesis
~UniformInt(0,numberBranchHypotheses(@branchCats)-1)
branchCats
get_state(branch_category_vectors)

Description

Compare branch-model hypotheses encoded positionally in tree annotations. In [&foreground={1,2}], the branch has category 1 under hypothesis 0 and category 2 under hypothesis 1. All specified vectors must have the same length; an unannotated branch has category 0 under every hypothesis. Hypotheses have equal prior probability by default.

To compare one shared omega against separate background and foreground omegas, annotate foreground branches with [&foreground={0,1}] and leave background branches unannotated. Hypothesis 0 uses omega 0 on every branch; hypothesis 1 uses omega 0 on background branches and omega 1 on foreground branches. The default omegas have independent LogNormal(0,1) priors, and these two hypotheses each have prior probability 0.5. This tests branch-specific omega heterogeneity, not specifically positive selection.

The PrBranchHypothesis[i] fields contain conditional probabilities whose posterior means estimate support for hypothesis i. The corresponding LogOddsBranchHypothesis[i] fields give conditional log odds against all other hypotheses; use statreport to summarize posterior log odds rather than averaging these fields directly. The ordinary omegas and hypothesis fields supply hypothesis-conditioned summaries in bpy-summarize when logged. Annotation-derived category-usage metadata lets the report omit unused categories. Conditional tables show sample counts; autocorrelation diagnostics remain on unfiltered parameters.

Examples

BranchModel_test
BranchModel_test(omegas=[0.2,1.0,2.0])

See also