Replace Sankoff cost matrix with cardinality-composition decomposition

Replaced the legacy Sankoff parsimony pipeline with a new cardinality-composition decomposition that constructs row-normalized transition probability matrices symmetrized via geometric mean. This ensures reversibility, reduces free parameters from 240 to 120, and guarantees a zero diagonal. Tallies are now explicitly restricted to variable families to align with +ASC-corrected alignment populations. Additionally, fixed `--exclude-genome` handling to re-scan surviving sequences and drop newly monomorphic columns, preventing silent data corruption in downstream tree inference tools.
This commit is contained in:
Eric Coissac
2026-08-13 16:58:12 +02:00
parent c26623fa00
commit 0c86ea0385
9 changed files with 901 additions and 549 deletions
+160 -20
View File
@@ -1,27 +1,167 @@
ratio_ceiling: 0.5
flank_length_m: 15
p_hat: 0.010713940022064144
p_hat_variance: 3.2110559785689563e-10
n_pairs_included: 158
n_loci_total: 33008305
mean_sub_cost: 1.4764371767846869
c_ctx: 1.7343663443925388
substitutions:
- pair: A/C
cardinality_transitions:
- from: 0
to: 0
count: 117158166
probability: 0.8249649657257814
- from: 0
to: 1
count: 13707223
probability: 0.09651891232567299
- from: 0
to: 2
count: 10934100
probability: 0.07699206755884405
- from: 0
to: 3
count: 193315
probability: 0.0013612205430842902
- from: 0
to: 4
count: 23125
probability: 0.00016283384661730445
- from: 1
to: 0
count: 13707223
probability: 0.8980473700324103
- from: 1
to: 1
count: 1043692
probability: 0.06837890181868832
- from: 1
to: 2
count: 507953
probability: 0.033279232106318904
- from: 1
to: 3
count: 4270
probability: 0.0002797548613631216
- from: 1
to: 4
count: 225
probability: 0.000014741181219368235
- from: 2
to: 0
count: 10934100
probability: 0.9551033885158036
- from: 2
to: 1
count: 507953
probability: 0.04437014765794788
- from: 2
to: 2
count: 5241
probability: 0.00045780602511512846
- from: 2
to: 3
count: 690
probability: 0.000060272115498843476
- from: 2
to: 4
count: 96
probability: 8.385685634621701e-6
- from: 3
to: 0
count: 193315
probability: 0.9743748708410829
- from: 3
to: 1
count: 4270
probability: 0.021522285898618442
- from: 3
to: 2
count: 690
probability: 0.0034778401100812
- from: 3
to: 3
count: 98
probability: 0.0004939541025912429
- from: 3
to: 4
count: 26
probability: 0.0001310490476262481
- from: 4
to: 0
count: 23125
probability: 0.9846291407647109
- from: 4
to: 1
count: 225
probability: 0.009580175423656646
- from: 4
to: 2
count: 96
probability: 0.004087541514093502
- from: 4
to: 3
count: 26
probability: 0.0011070424934003236
- from: 4
to: 4
count: 14
probability: 0.0005960998041386358
composition_transitions:
- from: 'A'
to: 'A'
count: 162260
probability: 0.47062167539692207
- from: 'A'
to: 'C'
count: 27810
cost: 2.5439415226130238
- pair: A/G
probability: 0.08066059899413536
- from: 'A'
to: 'G'
count: 130153
cost: 1.0
- pair: A/T
probability: 0.3774979842101294
- from: 'A'
to: 'T'
count: 24555
cost: 2.6684722241428322
- pair: C/G
probability: 0.07121974139881315
- from: 'C'
to: 'A'
count: 27810
probability: 0.07790832534920075
- from: 'C'
to: 'C'
count: 184633
probability: 0.5172401234879174
- from: 'C'
to: 'G'
count: 19637
cost: 2.892062911764701
- pair: C/T
probability: 0.05501207424963161
- from: 'C'
to: 'T'
count: 124878
cost: 1.0413902163542994
- pair: G/T
probability: 0.3498394769132503
- from: 'G'
to: 'A'
count: 130153
probability: 0.36057158212891627
- from: 'G'
to: 'C'
count: 19637
probability: 0.054401697680925745
- from: 'G'
to: 'G'
count: 184557
probability: 0.5112906308956874
- from: 'G'
to: 'T'
count: 26616
cost: 2.5878424665170052
probability: 0.07373608929447062
- from: 'T'
to: 'A'
count: 24555
probability: 0.07337692220342934
- from: 'T'
to: 'C'
count: 124878
probability: 0.3731689387464813
- from: 'T'
to: 'G'
count: 26616
probability: 0.07953574267426085
- from: 'T'
to: 'T'
count: 158593
probability: 0.4739183963758285