PhyloCSF coding classifier

DefinitionLeaf data of an alignment column#✓fully proved

The leaf data of an alignment column col : L → S: the indicator of the observed codon at each leaf.

def leafData (col : L → S) (l : L) (s : S) : ℝ := if col l = s then 1 else 0
Used by 2

DefinitionLikelihood of one alignment column#✓fully proved

The likelihood of one alignment column under the model (t, π).

noncomputable def siteLik (t : Tree L S ℝ) (π : S → ℝ) (col : L → S) : ℝ :=
  likelihood (leafData col) t π
Uses 3 · Used by 5

DefinitionLikelihood of an alignment of independent columns#✓fully proved

The likelihood of an alignment of m independent columns: the product of the site likelihoods.

noncomputable def alignLik (t : Tree L S ℝ) (π : S → ℝ) (A : Fin m → L → S) : ℝ :=
  ∏ k, siteLik t π (A k)
Uses 2 · Used by 2

DefinitionThe PhyloCSF score#✓fully proved

The PhyloCSF score (natural-log scale): the sum over the columns of the log-likelihood ratio of the coding model (tC, πC) against the non-coding model (tN, πN). The published PhyloCSF score is reported in decibans; see score_decibans for the conversion. Thresholds for this score are in natural-log units.

noncomputable def score (tC : Tree L S ℝ) (πC : S → ℝ) (tN : Tree L S ℝ) (πN : S → ℝ)
    (A : Fin m → L → S) : ℝ :=
  ∑ k, log (siteLik tC πC (A k) / siteLik tN πN (A k))
Uses 2 · Used by 5

DefinitionThe published PhyloCSF score in decibans#✓fully proved

10 * log₁₀(L_C / L_N), i.e. (10 / log 10) * score, since log₁₀ x = log x / log 10.

noncomputable def score_decibans (tC : Tree L S ℝ) (πC : S → ℝ) (tN : Tree L S ℝ) (πN : S → ℝ)
    (A : Fin m → L → S) : ℝ :=
  (10 / log 10) * score tC πC tN πN A
Uses 2 · Used by 1

TheoremDeciban score as a rescaled natural-log score#✓fully proved

Decibans are the natural-log score rescaled by 10 / log 10.

theorem score_decibans_eq (tC : Tree L S ℝ) (πC : S → ℝ) (tN : Tree L S ℝ) (πN : S → ℝ)
    (A : Fin m → L → S) :
    score_decibans tC πC tN πN A = (10 / log 10) * score tC πC tN πN A
Uses 3

TheoremSite likelihood by Felsenstein's pruning algorithm#✓fully proved

Each site likelihood is computed by Felsenstein's pruning algorithm.

theorem siteLik_eq_sum_prune (t : Tree L S ℝ) (π : S → ℝ) (col : L → S) :
    siteLik t π col = ∑ s, π s * prune (leafData col) t s
Uses 5

TheoremThe score is the log-likelihood ratio of the alignment#✓fully proved

The score is the log-likelihood ratio of the alignment when all site likelihoods are positive.

theorem score_eq_log_div {tC tN : Tree L S ℝ} {πC πN : S → ℝ} {A : Fin m → L → S}
    (hC : ∀ k, 0 < siteLik tC πC (A k)) (hN : ∀ k, 0 < siteLik tN πN (A k)) :
    score tC πC tN πN A = log (alignLik tC πC A / alignLik tN πN A)
Uses 4 · Used by 1

DefinitionScore threshold test for calling an alignment coding#✓fully proved

The threshold test on the score: call the alignment coding (1) iff the score exceeds the cutoff c.

noncomputable def scoreTest (tC : Tree L S ℝ) (πC : S → ℝ) (tN : Tree L S ℝ) (πN : S → ℝ)
    (c : ℝ) (A : Fin m → L → S) : Set.Icc (0 : ℝ) 1 :=
  if c < score tC πC tN πN A then ⟨1, by norm_num, le_rfl⟩ else ⟨0, le_rfl, by norm_num⟩
Uses 2 · Used by 1

TheoremPhyloCSF's score threshold test is most powerful for unnormalized weights#✓fully proved

With positive site likelihoods under both models, a randomized test φ whose weighted size under the non-coding weights is at most that of scoreTest c has at most its weighted power under the coding weights. This is the dominated Neyman–Pearson inequality for the unnormalized alignment weights alignLik; it becomes a statement about statistical size and power only under additional normalization hypotheses (∑ A, alignLik = 1 for each model).

theorem weighted_power_le_scoreTest {tC tN : Tree L S ℝ} {πC πN : S → ℝ}
    (hC : ∀ col, 0 < siteLik tC πC col) (hN : ∀ col, 0 < siteLik tN πN col) (c : ℝ)
    (φ : (Fin m → L → S) → Set.Icc (0 : ℝ) 1)
    (hsize : ∑ A, (φ A).val * alignLik tN πN A ≤
      ∑ A : Fin m → L → S, (scoreTest tC πC tN πN c A).val * alignLik tN πN A) :
    ∑ A, (φ A).val * alignLik tC πC A ≤
      ∑ A : Fin m → L → S, (scoreTest tC πC tN πN c A).val * alignLik tC πC A
Uses 7
10 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.