A Differential Framework for Dynamic Programming in Biological Sequence Analysis

Abstract

Background: Dynamic programming in biological sequence analysis computes probabilities or partition functions by summing over exponentially many latent paths, alignments, derivation trees, or RNA secondary structures. Their backward and outside quantities are used model-specifically, but the relation between differential sensitivities and exact finite sequence changes is rarely stated in a common framework. Methods: We represent hidden Markov models, affine-gap alignment ensembles, stochastic context-free grammars, and RNA secondary-structure ensembles as sum--product dynamic programs, defining backward and outside quantities as adjoints of forward or inside variables and sequence changes as finite replacements of sequence-dependent local factors. Results: Posterior item marginals are normalized inside--outside products, local-event posteriors additionally include the local factor and child inside terms, and expected feature counts are logarithmic derivatives of the partition function. For HMMs, ordinary SCFGs, and single-position substitutions in affine-gap alignment, the partition function is multi-affine in position-specific factor groups, so a one-site change is recovered exactly from first-derivative coefficients and multisite changes from mixed derivatives. In nearest-neighbor RNA models a substitution alters overlapping loop, stacking, and multiloop factors and boundary contexts, so exact mutation effects instead require context-dependent inside--outside recombination, as in the Rchange algorithm. Numerical experiments reproduce brute-force recomputation to machine precision. Conclusions: The framework identifies when derivatives give exact finite sequence effects and when broader recombination is required, providing a unified basis for posterior marginals, expected counts, parameter sensitivity, mutation analysis, and sequence design.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…