2026-04-16 22:38:20 +02:00
<!doctype html>
< html lang = "en" class = "no-js" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2026-11-19 15:58:05 +01:00
< link rel = "prev" href = "../gamma_rate_heterogeneity/" >
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
< link rel = "next" href = "../sampling_design/" >
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
< link rel = "icon" href = "../../../../assets/images/favicon.png" >
2026-04-16 22:38:20 +02:00
< meta name = "generator" content = "mkdocs-1.6.1, mkdocs-material-9.7.6" >
2026-11-19 15:58:05 +01:00
< title > Sankoff model - obikmer — User Guide</ title >
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
< link rel = "stylesheet" href = "../../../../assets/stylesheets/main.484c7ddc.min.css" >
2026-04-16 22:38:20 +02:00
< link rel = "preconnect" href = "https://fonts.gstatic.com" crossorigin >
< link rel = "stylesheet" href = "https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback" >
< style >: root { --md-text-font : "Roboto" ; --md-code-font : "Roboto Mono" }</ style >
2026-11-19 15:58:05 +01:00
< script > __md_scope = new URL ( "../../../.." , location ), __md_hash = e =>[... e ]. reduce ((( e , _ )=>( e << 5 ) - e + _ . charCodeAt ( 0 )), 0 ), __md_get = ( e , _ = localStorage , t = __md_scope )=> JSON . parse ( _ . getItem ( t . pathname + "." + e )), __md_set = ( e , _ , t = localStorage , a = __md_scope )=>{ try { t . setItem ( a . pathname + "." + e , JSON . stringify ( _ ))} catch ( e ){}}</ script >
2026-04-16 22:38:20 +02:00
</ head >
< body dir = "ltr" >
< input class = "md-toggle" data-md-toggle = "drawer" type = "checkbox" id = "__drawer" autocomplete = "off" >
< input class = "md-toggle" data-md-toggle = "search" type = "checkbox" id = "__search" autocomplete = "off" >
< label class = "md-overlay" for = "__drawer" ></ label >
< div data-md-component = "skip" >
2026-11-19 15:58:05 +01:00
< a href = "#the-16-state-sankoff-model" class = "md-skip" >
2026-04-16 22:38:20 +02:00
Skip to content
</ a >
</ div >
< div data-md-component = "announce" >
</ div >
< header class = "md-header md-header--shadow" data-md-component = "header" >
< nav class = "md-header__inner md-grid" aria-label = "Header" >
2026-11-19 15:58:05 +01:00
< a href = "../../../.." title = "obikmer — User Guide" class = "md-header__button md-logo" aria-label = "obikmer — User Guide" data-md-component = "logo" >
2026-04-16 22:38:20 +02:00
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" >< path d = "M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54" /></ svg >
</ a >
< label class = "md-header__button md-icon" for = "__drawer" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" >< path d = "M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z" /></ svg >
</ label >
< div class = "md-header__title" data-md-component = "header-title" >
< div class = "md-header__ellipsis" >
< div class = "md-header__topic" >
< span class = "md-ellipsis" >
2026-08-15 20:56:29 +02:00
obikmer — User Guide
2026-04-16 22:38:20 +02:00
</ span >
</ div >
< div class = "md-header__topic" data-md-component = "header-topic" >
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Sankoff model
2026-04-16 22:38:20 +02:00
</ span >
</ div >
</ div >
</ div >
< script > var palette = __md_get ( "__palette" ); if ( palette && palette . color ){ if ( "(prefers-color-scheme)" === palette . color . media ){ var media = matchMedia ( "(prefers-color-scheme: light)" ), input = document . querySelector ( media . matches ? "[data-md-color-media='(prefers-color-scheme: light)']" : "[data-md-color-media='(prefers-color-scheme: dark)']" ); palette . color . media = input . getAttribute ( "data-md-color-media" ), palette . color . scheme = input . getAttribute ( "data-md-color-scheme" ), palette . color . primary = input . getAttribute ( "data-md-color-primary" ), palette . color . accent = input . getAttribute ( "data-md-color-accent" )} for ( var [ key , value ] of Object . entries ( palette . color )) document . body . setAttribute ( "data-md-color-" + key , value )}</ script >
</ nav >
</ header >
< div class = "md-container" data-md-component = "container" >
< main class = "md-main" data-md-component = "main" >
< div class = "md-main__inner md-grid" >
< div class = "md-sidebar md-sidebar--primary" data-md-component = "sidebar" data-md-type = "navigation" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--primary" aria-label = "Navigation" data-md-level = "0" >
< label class = "md-nav__title" for = "__drawer" >
2026-11-19 15:58:05 +01:00
< a href = "../../../.." title = "obikmer — User Guide" class = "md-nav__button md-logo" aria-label = "obikmer — User Guide" data-md-component = "logo" >
2026-04-16 22:38:20 +02:00
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" >< path d = "M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54" /></ svg >
</ a >
2026-08-15 20:56:29 +02:00
obikmer — User Guide
2026-04-16 22:38:20 +02:00
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../.." class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
Home
</ span >
</ a >
</ li >
2026-08-15 20:56:29 +02:00
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../installation/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
Installation
</ span >
</ a >
</ li >
2026-04-16 22:38:20 +02:00
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
2026-08-15 20:56:29 +02:00
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3" checked >
2026-04-16 22:38:20 +02:00
2026-08-15 20:56:29 +02:00
< label class = "md-nav__link" for = "__nav_3" id = "__nav_3_label" tabindex = "0" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
Theory
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
2026-08-15 20:56:29 +02:00
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_3_label" aria-expanded = "true" >
< label class = "md-nav__title" for = "__nav_3" >
2026-04-16 22:38:20 +02:00
< span class = "md-nav__icon md-icon" ></ span >
Theory
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
2026-11-19 15:58:05 +01:00
< li class = "md-nav__item md-nav__item--nested" >
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3_1" >
< label class = "md-nav__link" for = "__nav_3_1" id = "__nav_3_1_label" tabindex = "0" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Kmer indexing
2026-04-16 22:38:20 +02:00
</ span >
2026-11-19 15:58:05 +01:00
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "2" aria-labelledby = "__nav_3_1_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_3_1" >
< span class = "md-nav__icon md-icon" ></ span >
Kmer indexing
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
2026-04-16 22:38:20 +02:00
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../kmer_indexing/encoding/" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
DNA encoding
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../kmer_indexing/kmers/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Kmers
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
< a href = "../../../kmer_indexing/minimizer_selection/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Minimizer selection
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
< a href = "../../../kmer_indexing/superkmers/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Super-kmers
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
< a href = "../../../kmer_indexing/indexing_architecture/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Partitioning and indexing architecture
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
< a href = "../../../kmer_indexing/entropy_filter/" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-08-15 20:56:29 +02:00
Low-complexity kmer filter
2026-04-29 22:52:42 +02:00
</ span >
</ a >
</ li >
2026-11-19 15:58:05 +01:00
</ ul >
</ nav >
</ li >
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3_2" checked >
< label class = "md-nav__link" for = "__nav_3_2" id = "__nav_3_2_label" tabindex = "0" >
< span class = "md-ellipsis" >
Phylogeny
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "2" aria-labelledby = "__nav_3_2_label" aria-expanded = "true" >
< label class = "md-nav__title" for = "__nav_3_2" >
< span class = "md-nav__icon md-icon" ></ span >
Phylogeny
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3_2_1" >
< label class = "md-nav__link" for = "__nav_3_2_1" id = "__nav_3_2_1_label" tabindex = "0" >
< span class = "md-ellipsis" >
Kmer-based
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "3" aria-labelledby = "__nav_3_2_1_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_3_2_1" >
< span class = "md-nav__icon md-icon" ></ span >
Kmer-based
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../../kmer_based/kmer_set_distances/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Whole k-mer set distances
</ span >
</ a >
</ li >
</ ul >
</ nav >
</ li >
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3_2_2" checked >
< label class = "md-nav__link" for = "__nav_3_2_2" id = "__nav_3_2_2_label" tabindex = "0" >
< span class = "md-ellipsis" >
SNP-based
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "3" aria-labelledby = "__nav_3_2_2_label" aria-expanded = "true" >
< label class = "md-nav__title" for = "__nav_3_2_2" >
< span class = "md-nav__icon md-icon" ></ span >
SNP-based
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../central_snp_model/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Central-position SNP model
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
< a href = "../gamma_rate_heterogeneity/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Gamma rate heterogeneity
</ span >
</ a >
</ li >
2026-04-29 22:52:42 +02:00
2026-04-16 22:38:20 +02:00
< li class = "md-nav__item md-nav__item--active" >
< input class = "md-nav__toggle md-toggle" type = "checkbox" id = "__toc" >
< label class = "md-nav__link md-nav__link--active" for = "__toc" >
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Sankoff model
2026-04-16 22:38:20 +02:00
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< a href = "./" class = "md-nav__link md-nav__link--active" >
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Sankoff model
2026-04-16 22:38:20 +02:00
</ span >
</ a >
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" ></ span >
Table of contents
</ label >
< ul class = "md-nav__list" data-md-component = "toc" data-md-scrollfix >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "#combining-into-a-1616-cost-matrix" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Combining into a 16×16 cost matrix
2026-04-16 22:38:20 +02:00
</ span >
</ a >
</ li >
</ ul >
</ nav >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../sampling_design/" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Sampling design
2026-06-04 21:27:01 +02:00
</ span >
</ a >
</ li >
2026-04-16 22:38:20 +02:00
</ ul >
</ nav >
</ li >
2026-11-19 15:58:05 +01:00
</ ul >
</ nav >
</ li >
</ ul >
</ nav >
</ li >
2026-04-16 22:38:20 +02:00
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_4" >
< label class = "md-nav__link" for = "__nav_4" id = "__nav_4_label" tabindex = "0" >
< span class = "md-ellipsis" >
2026-08-15 20:56:29 +02:00
Usage
2026-04-16 22:38:20 +02:00
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_4_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_4" >
< span class = "md-nav__icon md-icon" ></ span >
2026-08-15 20:56:29 +02:00
Usage
2026-04-16 22:38:20 +02:00
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/superkmer/" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-08-15 20:56:29 +02:00
superkmer
2026-04-16 22:38:20 +02:00
</ span >
</ a >
</ li >
2026-05-15 21:07:23 +08:00
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/index_command/" class = "md-nav__link" >
2026-05-15 21:07:23 +08:00
< span class = "md-ellipsis" >
2026-08-15 20:56:29 +02:00
index
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/merge/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
merge
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/filter/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
filter
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/select/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
select
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/query/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
query
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/dump/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
dump
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/annotate/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
annotate
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/phylo/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
phylo
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/unitig/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
unitig
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/estimate/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
estimate
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/convert/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
2026-08-28 10:26:18 +02:00
convert
2026-08-15 20:56:29 +02:00
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/utils/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
utils
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/pack/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
pack
</ span >
</ a >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../usage/predicates/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
Predicates and taxonomy paths
2026-05-15 21:07:23 +08:00
</ span >
</ a >
</ li >
2026-04-16 22:38:20 +02:00
</ ul >
</ nav >
</ li >
2026-08-15 20:56:29 +02:00
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_5" >
< label class = "md-nav__link" for = "__nav_5" id = "__nav_5_label" tabindex = "0" >
< span class = "md-ellipsis" >
Formats
</ span >
< span class = "md-nav__icon md-icon" ></ span >
</ label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_5_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_5" >
< span class = "md-nav__icon md-icon" ></ span >
Formats
</ label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../formats/index_layout/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
Index construction and on-disk layout
</ span >
</ a >
</ li >
2026-11-19 15:58:05 +01:00
< li class = "md-nav__item" >
< a href = "../../../../formats/vcf/" class = "md-nav__link" >
< span class = "md-ellipsis" >
VCF pseudo-alignment
</ span >
</ a >
</ li >
2026-08-15 20:56:29 +02:00
</ ul >
</ nav >
</ li >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "../../../../architecture/" class = "md-nav__link" >
2026-08-15 20:56:29 +02:00
< span class = "md-ellipsis" >
Architecture notes
</ span >
</ a >
</ li >
2026-04-16 22:38:20 +02:00
</ ul >
</ nav >
</ div >
</ div >
</ div >
< div class = "md-sidebar md-sidebar--secondary" data-md-component = "sidebar" data-md-type = "toc" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" ></ span >
Table of contents
</ label >
< ul class = "md-nav__list" data-md-component = "toc" data-md-scrollfix >
< li class = "md-nav__item" >
2026-11-19 15:58:05 +01:00
< a href = "#combining-into-a-1616-cost-matrix" class = "md-nav__link" >
2026-04-16 22:38:20 +02:00
< span class = "md-ellipsis" >
2026-11-19 15:58:05 +01:00
Combining into a 16×16 cost matrix
2026-04-16 22:38:20 +02:00
</ span >
</ a >
</ li >
</ ul >
</ nav >
</ div >
</ div >
</ div >
< div class = "md-content" data-md-component = "content" >
< article class = "md-content__inner md-typeset" >
2026-11-19 15:58:05 +01:00
< h1 id = "the-16-state-sankoff-model" > The 16-state Sankoff model</ h1 >
< p > Each family (see < a href = "../central_snp_model/" > Central-position SNP model</ a > ) is treated as a character with 16 possible states: one per subset of the 4 possible central bases, including the empty subset (no observed form). A genome pair's calibration reduces to two separately-estimated first-order Markov models, both restricted to genome pairs below a configurable SNP-ratio ceiling (excluding saturated pairs from skewing the calibration):</ p >
2026-08-15 20:56:29 +02:00
< ul >
2026-11-19 15:58:05 +01:00
< li >< strong > Cardinality transitions</ strong > (< span class = "arithmatex" > \(5 \times 5\)</ span > , row-stochastic): the probability that a family observed with < span class = "arithmatex" > \(i\)</ span > forms in one genome (< span class = "arithmatex" > \(i \in \{0,\dots,4\}\)</ span > ) is observed with < span class = "arithmatex" > \(j\)</ span > forms in the other.</ li >
< li >< strong > Composition transitions</ strong > (< span class = "arithmatex" > \(4 \times 4\)</ span > , row-stochastic): the probability that an unambiguous, single-copy base observed as one of A/C/G/T in one genome is observed as another base in the other genome.</ li >
2026-08-15 20:56:29 +02:00
</ ul >
2026-11-19 15:58:05 +01:00
< h2 id = "combining-into-a-1616-cost-matrix" > Combining into a 16×16 cost matrix</ h2 >
< p > The two matrices are < em > not</ em > combined as a plain tensor product. For a pair of states < span class = "arithmatex" > \((A, B)\)</ span > — each a subset of < span class = "arithmatex" > \(\{A,C,G,T\}\)</ span > — let < code > shared</ code > < span class = "arithmatex" > \(= A \cap B\)</ span > , < code > lost</ code > < span class = "arithmatex" > \(= A \setminus B\)</ span > , < code > gained</ code > < span class = "arithmatex" > \(= B \setminus A\)</ span > . The log-probability of the transition < span class = "arithmatex" > \(A \to B\)</ span > is:</ p >
< div class = "arithmatex" > \[\log P(A,B) = \underbrace{\log P_{\text{card}}(|A|,|B|)}_{\text{cardinality term, omitted when loss events are treated as free}} \;+\; \underbrace{\sum_{i \,\in\, \text{shared}} \log P_{\text{comp}}(i,i)}_{\text{bases conserved on both sides}} \;-\; \underbrace{\text{best\_pairing\_cost}(\text{lost}, \text{gained})}_{\text{substitutions among the differing bases}}\]</ div >
< p >< code > best_pairing_cost</ code > enumerates every injection pairing elements of < code > lost</ code > with elements of < code > gained</ code > and keeps the one minimizing < span class = "arithmatex" > \(-\sum \log P_{\text{comp}}\)</ span > over the pairs — the discrete analogue of "prefer a substitution over an independent loss and gain": if a base is lost from one side and a different base is gained on the other, that is scored as a single substitution between them (cheaper, under any sane calibration, than treating them as two unrelated cardinality-changing events) whenever such a pairing is possible.</ p >
< p > The resulting < span class = "arithmatex" > \(16 \times 16\)</ span > log-probability matrix is row-normalized in log-space (log-sum-exp, not a direct < code > exp()</ code > /divide, for numerical stability), giving a genuine row-stochastic transition matrix < span class = "arithmatex" > \(P\)</ span > . The cost matrix is then < span class = "arithmatex" > \(\text{cost}(A,B) = -\ln P(A,B)\)</ span > , symmetrized by simple averaging:</ p >
< div class = "arithmatex" > \[\text{sym}(A,B) = \frac{\text{cost}(A,B) + \text{cost}(B,A)}{2}\]</ div >
< p > This calibrated cost matrix is what every downstream export (for TNT, PhyG, IQ-TREE) reuses, recoded into each tool's own format.</ p >
< p > See < a href = "../../../../usage/phylo/#sankoff-calibration-and-phylogenetic-exports" >< code > phylo</ code ></ a > for how to run the calibration and produce these exports.</ p >
2026-04-16 22:38:20 +02:00
</ article >
</ div >
< script > var target = document . getElementById ( location . hash . slice ( 1 )); target && target . name && ( target . checked = target . name . startsWith ( "__tabbed_" ))</ script >
</ div >
</ main >
< footer class = "md-footer" >
< div class = "md-footer-meta md-typeset" >
< div class = "md-footer-meta__inner md-grid" >
< div class = "md-copyright" >
Made with
< a href = "https://squidfunk.github.io/mkdocs-material/" target = "_blank" rel = "noopener" >
Material for MkDocs
</ a >
</ div >
</ div >
</ div >
</ footer >
</ div >
< div class = "md-dialog" data-md-component = "dialog" >
< div class = "md-dialog__inner md-typeset" ></ div >
</ div >
2026-11-19 15:58:05 +01:00
< script id = "__config" type = "application/json" >{ "annotate" : null , "base" : "../../../.." , "features" : [], "search" : "../../../../assets/javascripts/workers/search.2c215733.min.js" , "tags" : null , "translations" : { "clipboard.copied" : "Copied to clipboard" , "clipboard.copy" : "Copy to clipboard" , "search.result.more.one" : "1 more on this page" , "search.result.more.other" : "# more on this page" , "search.result.none" : "No matching documents" , "search.result.one" : "1 matching document" , "search.result.other" : "# matching documents" , "search.result.placeholder" : "Type to start searching" , "search.result.term.missing" : "Missing" , "select.version" : "Select version" }, "version" : null }</ script >
2026-04-16 22:38:20 +02:00
2026-11-19 15:58:05 +01:00
< script src = "../../../../assets/javascripts/bundle.79ae519e.min.js" ></ script >
2026-04-16 22:38:20 +02:00
< script src = "https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js" ></ script >
</ body >
</ html >