select_substitution_model
Choose the substitution model for a maximum-likelihood phylogeny by fitting every candidate — model x rate-heterogeneity x invariant-sites — on ONE shared topology and ranking them by AIC, AICc or BIC with Akaike weights. Fitting on a shared topology is the point: a model test that also searched topologies would vary two things at once, and a log-likelihood measured on a different tree answers a different question. Wire the winning model into build_tree's ml_model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| models | No | candidate substitution models. Every one is fitted; the sweep costs one ML optimisation per candidate. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| criterion | No | which information criterion ranks the table. Changing it re-ranks candidates that are already fitted — it does not re-fit them. | AIC |
| sequences | Yes | aligned sequences — wire align_sequences' rows here, or name library documents. | |
| include_subject | No | also include the node's subject. | |
| gamma_categories | No | discrete-Γ category counts to try. `[1]` is no rate heterogeneity; `[1, 4]` is the usual sweep and is the panel's default. | |
| include_invariant | No | also try each model with a proportion of invariant sites (+I), doubling the candidate count. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| best | Yes | the winning model in the conventional shorthand (e.g. `GTR+G4+I`) | |
| fits | Yes | every candidate with its log-likelihood, free parameters, AIC/AICc/BIC and Akaike weight | |
| weight | Yes | the winner's Akaike weight — the share of the evidence it carries. A low weight means the data do not choose between the top models, which is a finding and not a failure | |
| candidates | Yes | how many candidates were fitted | |
| startingTree | Yes | the ONE topology every candidate was fitted on, in Newick — reported because it is a shared assumption of the whole table |