Aligners

Twitcher supports two alignment backends. How each of them uses the cost model is described in Cost model.

A* Aligner (default)

The default aligner uses an A* search strategy. It is the most capable option: it can find alignments with indels inside the template switch and can handle multiple template switches in a single cluster. It is gap-affine and uses a full cost model configurable via --costs.

The A* Aligner is developed under the name tsalign on Github.

Key parameters: - --costs <FILE>: a .tsa config file for the alignment cost model (gap open/extend, mismatch, template switch penalties, etc.). If omitted, built-in defaults are used. - --min-length-strategy <ML_STRATEGY>: controls how the minimum inner length of a template switch is enforced during the search. Available strategies: none, lookahead, preprocess-filter (default), preprocess-price, preprocess-lookahead. The preprocess strategies prune the search space before alignment and are generally faster. - --no-ts: disables template switch alignment entirely; the aligner falls back to a plain pairwise alignment. Mainly useful for benchmarking or debugging.

Four-Point-Aligner (enabled by --fpa)

An alternative aligner based on dynamic programming. It is generally faster but has two important limitations:

  • It cannot find alignments with indels inside the template switch.
  • It supports at most one template switch per cluster.

Because it is not gap-affine, the gap-open cost from the cost model is ignored; only the gap-extension cost applies.

Use --fpa when speed matters and the above limitations are acceptable for your data.