discover_gene_tree_discordance
Find the genes whose own alignment rejects the species tree. Each named alignment file is one gene, its records the taxa, named as the species tree's tips. For every gene the species tree and each of its nearest-neighbour rearrangements (two per internal branch) is fitted by maximum likelihood under GTR + Γ (rates, base frequencies and shape fitted on the species tree, branch lengths refitted on each rearrangement), and the Shimodaira–Hasegawa test asks whether the species tree is significantly worse than the best of them; the false discovery rate is controlled across genes. A rejection says the gene fits another tree better: incomplete lineage sorting does that to a share of genes among closely spaced species, and so do hidden paralogy, alignment error and transfer, so it is a gene to read, never a call of any one of them. Also reports which genes' best tree is not the species tree, rejected or not, and which alternative trees they choose. Graded against phangorn's pml, optim.pml and SH.test on 122 great-ape genes. About a second of fitting per gene in a browser.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | seed for the bootstrap. Each gene draws from seed + its own index, so a gene's p does not depend on the rest of the corpus. Advanced. | |
| alpha | No | false discovery rate at which a gene counts as rejecting the species tree. | |
| _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. | |
| sh_form | No | how each replicate is measured: from its best tree, as Shimodaira and Hasegawa (1999) and Goldman et al. (2000) define the test, or from its worst, as phangorn's SH.test computes it. They agree when the replicates are symmetric. Values: published (Published (from the best tree)), phangorn (phangorn (from the worst tree)). Advanced. | published |
| _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. | |
| alignments | Yes | the gene alignments: library file names, each an aligned multi-FASTA with one record per taxon, the record names being the species tree's tips. | |
| correction | No | Benjamini–Hochberg (independent or positively dependent tests) or Benjamini–Yekutieli (any dependence; less power). Values: BH (Benjamini–Hochberg), BY (Benjamini–Yekutieli). | BH |
| replicates | No | RELL bootstrap replicates of the SH test. The smallest p it can give is 1 / replicates. | |
| species_tree | Yes | the species tree in Newick, tips named as the alignments' records. Rooted or not; it is tested unrooted. | |
| gamma_categories | No | discrete Gamma rate categories; 1 fits no rate variation among sites. Advanced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genes | Yes | every gene: sites, each candidate tree's log-likelihood and SH p, the species tree's p and q | |
| sweep | Yes | the full result | |
| rejected | Yes | genes whose alignment rejects the species tree at the chosen false discovery rate | |
| discordant | Yes | genes whose best tree is not the species tree, rejected or not | |
| alternatives | Yes | each alternative tree some gene prefers, with how many prefer it and how many of those reject the species tree |