From 6deae24219229aecd926777d649b7910698efd42 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 7 Jan 2026 11:28:22 +0200 Subject: [PATCH 1/6] Fix release compile issues. --- lib_ts_chainalign/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_ts_chainalign/Cargo.toml b/lib_ts_chainalign/Cargo.toml index 9358d0d..3a4157d 100644 --- a/lib_ts_chainalign/Cargo.toml +++ b/lib_ts_chainalign/Cargo.toml @@ -13,7 +13,7 @@ generic_a_star = { version = "0.19.1", path = "../generic_a_star" } lib_tsalign = { version = "0.19.1", path = "../lib_tsalign" } ndarray = { version = "0.17.1", features = ["serde"] } num-traits.workspace = true -serde.workspace = true +serde = { workspace = true, features = ["derive"] } compact-genome.workspace = true itertools = "0.14.0" log.workspace = true From 97323b232a894cd9b9405db8766706a8c026adf7 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 7 Jan 2026 11:32:26 +0200 Subject: [PATCH 2/6] Update dependencies. --- Cargo.lock | 376 ++++++++++++++++------------------------- Cargo.toml | 6 +- lib_tsalign/Cargo.toml | 2 +- lib_tsshow/Cargo.toml | 2 +- tsalign/Cargo.toml | 2 +- 5 files changed, 150 insertions(+), 238 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b47177..8fc94df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "anstream" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" @@ -40,35 +40,38 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "arc-swap" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +checksum = "51d03449bb8ca2cc2ef70869af31463d1ae5ccc8fa3e334b307203fbf815207e" +dependencies = [ + "rustversion", +] [[package]] name = "arrayref" @@ -131,9 +134,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "bitvec" @@ -155,15 +158,15 @@ checksum = "e3acc5ce9c60e68df21b877f13f908ef95c89f01cb6c656cf76ba95f10bc72f5" [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "bytemuck" -version = "1.23.2" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" [[package]] name = "byteorder-lite" @@ -173,15 +176,15 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "clap" -version = "4.5.47" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" dependencies = [ "clap_builder", "clap_derive", @@ -189,9 +192,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.47" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" dependencies = [ "anstream", "anstyle", @@ -201,9 +204,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.47" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck", "proc-macro2", @@ -213,9 +216,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "color_quant" @@ -253,15 +256,15 @@ checksum = "120133d4db2ec47efe2e26502ee984747630c67f51974fca0b6c1340cf2368d3" [[package]] name = "console" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b430743a6eb14e9764d4260d4c0d8123087d504eeb9c48f2b2a5e810dd369df4" +checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" dependencies = [ "encode_unicode", "libc", "once_cell", "unicode-width", - "windows-sys 0.61.0", + "windows-sys", ] [[package]] @@ -290,9 +293,9 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "deranged" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -370,9 +373,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -438,9 +441,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.5" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -466,9 +469,9 @@ checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] name = "indexmap" -version = "2.11.3" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92119844f513ffa41556430369ab02c295a3578af21cf945caa3e9e0c2481ac3" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", "hashbrown", @@ -489,15 +492,18 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -508,6 +514,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + [[package]] name = "js-sys" version = "0.3.83" @@ -549,7 +561,7 @@ dependencies = [ "itertools", "lib_tsalign", "log", - "ndarray 0.17.1", + "ndarray", "num-traits", "rustc-hash", "serde", @@ -564,7 +576,7 @@ dependencies = [ "extend_map", "generic_a_star", "log", - "ndarray 0.16.1", + "ndarray", "noisy_float", "nom", "num-traits", @@ -593,9 +605,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.175" +version = "0.2.179" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" [[package]] name = "libm" @@ -605,9 +617,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "matrixmultiply" @@ -621,15 +633,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memmap2" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843a98750cd611cc2965a8213b53b43e715f13c37a9e096c6408e69990961db7" +checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" dependencies = [ "libc", ] @@ -653,22 +665,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "ndarray" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "portable-atomic", - "portable-atomic-util", - "rawpointer", - "serde", -] - [[package]] name = "ndarray" version = "0.17.1" @@ -687,9 +683,9 @@ dependencies = [ [[package]] name = "noisy_float" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af" +checksum = "c16843be85dd410c6a12251c4eca0dd1d3ee8c5725f746c4d5e0fdcec0a864b2" dependencies = [ "num-traits", "serde", @@ -754,9 +750,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "pico-args" @@ -779,9 +775,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "portable-atomic-util" @@ -800,9 +796,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" dependencies = [ "unicode-ident", ] @@ -910,9 +906,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" dependencies = [ "proc-macro2", ] @@ -931,18 +927,18 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "ref-cast" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", @@ -999,7 +995,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "bytemuck", "core_maths", "log", @@ -1023,9 +1019,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", @@ -1033,18 +1029,18 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1053,11 +1049,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.9" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -1071,9 +1067,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "simplecss" @@ -1103,9 +1099,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slotmap" -version = "1.0.7" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" dependencies = [ "version_check", ] @@ -1127,18 +1123,18 @@ dependencies = [ [[package]] name = "strong-type" -version = "0.12.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7d7139f5f4d5ceae0e71b68cb12ddf1e9a33fc621e14cc8c8e77c091e91649" +checksum = "1efa3fde4fd6d1bc510194b62afd2a3544d52e1594ec3790942f3be34bd511c7" dependencies = [ "strong-type-derive", ] [[package]] name = "strong-type-derive" -version = "0.12.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4905d64a6277be7989ce451864b65de38c665e465f519278a89d3ae867cf018" +checksum = "0bfbb84466cae4b0ed7b1692a700aaf1845f027f73ab6e3f06e356378c969ae3" dependencies = [ "proc-macro2", "quote", @@ -1175,9 +1171,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.106" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -1198,9 +1194,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" +checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba" [[package]] name = "template-switch-error-free-inners" @@ -1226,18 +1222,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", @@ -1246,11 +1242,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.43" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bde6f1ec10e72d583d91623c939f623002284ef622b87de38cfd546cbf2031" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", + "itoa", "libc", "num-conv", "num_threads", @@ -1319,44 +1316,42 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml" -version = "0.8.23" +version = "0.9.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" dependencies = [ - "serde", + "indexmap", + "serde_core", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.11" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] -name = "toml_edit" -version = "0.22.27" +name = "toml_parser" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "toml_write", "winnow", ] [[package]] -name = "toml_write" -version = "0.1.2" +name = "toml_writer" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "traitsequence" @@ -1422,21 +1417,21 @@ checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-properties" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-script" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" +checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" [[package]] name = "unicode-vo" @@ -1497,9 +1492,9 @@ dependencies = [ [[package]] name = "utf8-chars" -version = "3.0.5" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f598f797138b219a4560b4e9c53c255e872e267c9e3fdcc75aa59a2a90953bcd" +checksum = "ebe49e006d6df172d7f14794568a90fe41e05a1fa9e03dc276fa6da4bb747ec3" dependencies = [ "arrayvec", ] @@ -1579,9 +1574,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "winapi-util" @@ -1589,112 +1584,29 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys", ] [[package]] name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-link" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" - -[[package]] -name = "windows-sys" -version = "0.60.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets", -] +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-sys" -version = "0.61.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" -dependencies = [ - "windows-link 0.2.0", -] - -[[package]] -name = "windows-targets" -version = "0.53.3" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.1.3", - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows-link", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" [[package]] name = "wyz" diff --git a/Cargo.toml b/Cargo.toml index dd4f11c..f72be03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,11 +22,11 @@ package.rust-version = "1.85.1" package.repository = "https://github.com/sebschmi/template-switch-aligner" [workspace.dependencies] -clap = { version = "4.5.16", features = ["derive"] } -serde = "1.0.219" +clap = { version = "4.5.54", features = ["derive"] } +serde = "1.0.228" compact-genome = "12.5.0" traitsequence = "8.1.2" -log = "0.4.27" +log = "0.4.29" num-traits = "0.2.19" rustc-hash = "2.1.1" binary-heap-plus = "0.5.0" diff --git a/lib_tsalign/Cargo.toml b/lib_tsalign/Cargo.toml index a5b9566..e2a5d35 100644 --- a/lib_tsalign/Cargo.toml +++ b/lib_tsalign/Cargo.toml @@ -19,7 +19,7 @@ serde = [ [dependencies] compact-genome.workspace = true traitsequence.workspace = true -ndarray = "0.16.1" +ndarray = "0.17.1" binary-heap-plus = "0.5.0" nom = "8.0.0" thiserror = "2.0.3" diff --git a/lib_tsshow/Cargo.toml b/lib_tsshow/Cargo.toml index 4bd990b..1a998c7 100644 --- a/lib_tsshow/Cargo.toml +++ b/lib_tsshow/Cargo.toml @@ -15,6 +15,6 @@ svg = "0.18.0" resvg = "0.45.0" thiserror = "2.0.12" tagged-vec = "0.3.5" -strong-type = "0.12.2" +strong-type = "1.0.0" ena = "0.14.3" itertools = "0.14.0" diff --git a/tsalign/Cargo.toml b/tsalign/Cargo.toml index f415770..520089d 100644 --- a/tsalign/Cargo.toml +++ b/tsalign/Cargo.toml @@ -18,7 +18,7 @@ clap.workspace = true compact-genome = { workspace = true, features = ["io"] } traitsequence.workspace = true serde.workspace = true -toml = "0.8.19" +toml = "0.9.8" log.workspace = true simplelog = "0.12.2" anyhow = "1.0.97" From 9512a9eb0b0f86ba37502acb491fbdec152fea41 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 7 Jan 2026 11:53:26 +0200 Subject: [PATCH 3/6] Add more and better comments for chainalign interface. --- lib_ts_chainalign/src/costs.rs | 16 ++++++++++++++++ lib_ts_chainalign/src/lib.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/lib_ts_chainalign/src/costs.rs b/lib_ts_chainalign/src/costs.rs index e9e744a..70c0b22 100644 --- a/lib_ts_chainalign/src/costs.rs +++ b/lib_ts_chainalign/src/costs.rs @@ -14,17 +14,33 @@ pub struct GapAffineCosts { #[derive(Debug, Serialize, Deserialize, Eq, PartialEq)] pub struct TsLimits { + /// The maximum range of the 12-jump of a template switch. + /// This parameter is ignored for now. pub jump_12: Range, + /// The maximum range of the 34-jump of a template switch. + /// This parameter is ignored for now. pub jump_34: Range, + /// The range for the length of the 23-alignment of a template switch. pub length_23: Range, + /// The range for the ancestor gap of a template switch. + /// This parameter is ignored for now. pub ancestor_gap: Range, } +/// The cost function for alignments. +/// +/// For convenience, it implements [`TryFrom>`](std::convert::TryFrom). +/// Note that the conversion is very strict and only allows to convert from a [`TemplateSwitchConfig`](lib_tsalign::config::TemplateSwitchConfig) if the conversion loses no information. #[derive(Debug, Serialize, Deserialize, Eq, PartialEq)] pub struct AlignmentCosts { + /// Costs for primary alignment outside of template switches. pub primary_costs: GapAffineCosts, + /// Costs for secondary alignment, i.e. for the 23-alignment of a template switch. pub secondary_costs: GapAffineCosts, + /// The base cost of a template switch. + /// This is applied whenevera template switch is started. pub ts_base_cost: Cost, + /// Limits on the geometry of a template switch. pub ts_limits: TsLimits, } diff --git a/lib_ts_chainalign/src/lib.rs b/lib_ts_chainalign/src/lib.rs index ba06408..c4752fd 100644 --- a/lib_ts_chainalign/src/lib.rs +++ b/lib_ts_chainalign/src/lib.rs @@ -26,11 +26,22 @@ pub mod costs; pub mod exact_chaining; pub mod panic_on_extend; +/// A reverse complement function for DNA alphabets. +pub fn dna_rc_fn(c: u8) -> u8 { + match c { + b'A' => b'T', + b'C' => b'G', + b'G' => b'C', + b'T' => b'A', + c => panic!("Unsupported character: {c}"), + } +} + /// Perform preprocessing for tschainalign. /// /// * `max_n` is the maximum sequence length that the lower bounds should support. /// * `max_match_run` is the maximum consecutive sequence of matches that is allowed. -/// Set this to `k-1`, if the anchors are `k`-mers. +/// Set this to `k-1`, if the anchors are supposed to be `k`-mers. /// * `alignment_costs` is the cost function for the alignment. pub fn preprocess( max_n: usize, @@ -40,6 +51,20 @@ pub fn preprocess( ChainingLowerBounds::new(max_n, max_match_run, alignment_costs) } +/// Align two sequences. +/// +/// Note that `reference` and `query` are interchangeable, and the order has no meaning. +/// +/// * `AlphabetType` must be a DNA alphabet. +/// +/// * `reference` is the reference string in ASCII format. Only characters `A`, `C`, `G` and `T` are allowed. +/// * `query` is the query string in ASCII format. Only characters `A`, `C`, `G` and `T` are allowed. +/// * `range` is the range on which the alignment happens. Note that points 2 and 3 of a template switch may fall outside of this range. +/// * `parameters` is a set of parameters for the aligner that only affect performance. +/// * `rc_fn` is a function that maps a character to its reverse complement. +/// * `reference_name` is the name of the reference string. It is irrelevant for the alignment, but will appear in e.g. the output of `tsalign show`. +/// * `query_name` is the name of the query string. It is irrelevant for the alignment, but will appear in e.g. the output of `tsalign show`. +/// * `chaining_lower_bounds` are the lower bounds computed with the function [`preprocess`]. #[expect(clippy::too_many_arguments)] pub fn align( reference: Vec, From 75bd8a2536041cda816dc6ba05f3313467c1160e Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 7 Jan 2026 11:56:08 +0200 Subject: [PATCH 4/6] chore: Release --- Cargo.lock | 16 ++++++++-------- generic_a_star/Cargo.toml | 2 +- lib_ts_chainalign/Cargo.toml | 6 +++--- lib_tsalign/Cargo.toml | 6 +++--- lib_tsshow/Cargo.toml | 4 ++-- python_bindings/Cargo.toml | 6 +++--- seed_chain/Cargo.toml | 4 ++-- tsalign-tests/Cargo.toml | 2 +- tsalign/Cargo.toml | 8 ++++---- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8fc94df..49c222e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,7 +418,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "generic_a_star" -version = "0.19.1" +version = "0.20.0" dependencies = [ "binary-heap-plus", "compare", @@ -549,7 +549,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lib_ts_chainalign" -version = "0.1.0" +version = "0.2.0" dependencies = [ "binary-heap-plus", "bincode", @@ -569,7 +569,7 @@ dependencies = [ [[package]] name = "lib_tsalign" -version = "0.19.1" +version = "0.20.0" dependencies = [ "binary-heap-plus", "compact-genome", @@ -590,7 +590,7 @@ dependencies = [ [[package]] name = "lib_tsshow" -version = "0.19.1" +version = "0.20.0" dependencies = [ "ena", "itertools", @@ -805,7 +805,7 @@ dependencies = [ [[package]] name = "py_lib_tsalign" -version = "0.4.1" +version = "0.5.0" dependencies = [ "compact-genome", "lib_tsalign", @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "seed_chain" -version = "0.19.1" +version = "0.20.0" dependencies = [ "compact-genome", "generic_a_star", @@ -1361,7 +1361,7 @@ checksum = "2b939c825d0c4295ac520f7b479927c1e5b458c9107a9d6f5ba65bc867bb93a5" [[package]] name = "tsalign" -version = "0.19.1" +version = "0.20.0" dependencies = [ "anyhow", "bincode", @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "tsalign-tests" -version = "0.4.1" +version = "0.5.0" dependencies = [ "anyhow", "clap", diff --git a/generic_a_star/Cargo.toml b/generic_a_star/Cargo.toml index af053f4..e6b003b 100644 --- a/generic_a_star/Cargo.toml +++ b/generic_a_star/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "generic_a_star" description = "A generic implementation of the A* algorithm" -version = "0.19.1" +version = "0.20.0" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/lib_ts_chainalign/Cargo.toml b/lib_ts_chainalign/Cargo.toml index 3a4157d..ab1a1d7 100644 --- a/lib_ts_chainalign/Cargo.toml +++ b/lib_ts_chainalign/Cargo.toml @@ -2,15 +2,15 @@ name = "lib_ts_chainalign" description = "A chaining-based sequence-to-sequence aligner that accounts for template switches" authors = ["Sebastian Schmidt "] -version = "0.1.0" +version = "0.2.0" license.workspace = true edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -generic_a_star = { version = "0.19.1", path = "../generic_a_star" } -lib_tsalign = { version = "0.19.1", path = "../lib_tsalign" } +generic_a_star = { version = "0.20.0", path = "../generic_a_star" } +lib_tsalign = { version = "0.20.0", path = "../lib_tsalign" } ndarray = { version = "0.17.1", features = ["serde"] } num-traits.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/lib_tsalign/Cargo.toml b/lib_tsalign/Cargo.toml index e2a5d35..3d7b8b6 100644 --- a/lib_tsalign/Cargo.toml +++ b/lib_tsalign/Cargo.toml @@ -2,7 +2,7 @@ name = "lib_tsalign" description = "A sequence-to-sequence aligner that accounts for template switches" authors = ["Sebastian Schmidt "] -version = "0.19.1" +version = "0.20.0" license.workspace = true edition.workspace = true rust-version.workspace = true @@ -26,9 +26,9 @@ thiserror = "2.0.3" num-traits.workspace = true serde = { workspace = true, features = ["derive"], optional = true } noisy_float = { version = "0.2.0" } -generic_a_star = { version = "0.19.1", path = "../generic_a_star" } +generic_a_star = { version = "0.20.0", path = "../generic_a_star" } log.workspace = true rustc-hash = "2.1.1" -seed_chain = { version = "0.19.1", path = "../seed_chain" } +seed_chain = { version = "0.20.0", path = "../seed_chain" } extend_map = "0.14.3" template-switch-error-free-inners = "0.1.1" diff --git a/lib_tsshow/Cargo.toml b/lib_tsshow/Cargo.toml index 1a998c7..4401cc6 100644 --- a/lib_tsshow/Cargo.toml +++ b/lib_tsshow/Cargo.toml @@ -3,13 +3,13 @@ name = "lib_tsshow" description = "A visualiser for template-switch alignments" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.19.1" +version = "0.20.0" edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -lib_tsalign = { version = "0.19.1", path = "../lib_tsalign" } +lib_tsalign = { version = "0.20.0", path = "../lib_tsalign" } log.workspace = true svg = "0.18.0" resvg = "0.45.0" diff --git a/python_bindings/Cargo.toml b/python_bindings/Cargo.toml index 7e4d005..6823cda 100644 --- a/python_bindings/Cargo.toml +++ b/python_bindings/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "Sebastian Schmidt ", "Jasper Krauter ", ] -version = "0.4.1" +version = "0.5.0" edition.workspace = true rust-version.workspace = true repository.workspace = true @@ -18,10 +18,10 @@ crate-type = ["cdylib"] [dependencies] pyo3 = "0.26" -lib_tsalign = { version = "0.19.1", path = "../lib_tsalign", features = [ +lib_tsalign = { version = "0.20.0", path = "../lib_tsalign", features = [ "serde", ] } -lib_tsshow = { version = "0.19.1", path = "../lib_tsshow" } +lib_tsshow = { version = "0.20.0", path = "../lib_tsshow" } serde.workspace = true pythonize = "0.26" pyo3-log = "0.13" diff --git a/seed_chain/Cargo.toml b/seed_chain/Cargo.toml index 0970d61..dc7bf39 100644 --- a/seed_chain/Cargo.toml +++ b/seed_chain/Cargo.toml @@ -3,7 +3,7 @@ name = "seed_chain" description = "A seeding and generic chaining mechanism for sequence-to-sequence alignment" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.19.1" +version = "0.20.0" edition.workspace = true rust-version.workspace = true repository.workspace = true @@ -12,5 +12,5 @@ repository.workspace = true [dependencies] compact-genome.workspace = true log.workspace = true -generic_a_star = { version = "0.19.1", path = "../generic_a_star" } +generic_a_star = { version = "0.20.0", path = "../generic_a_star" } num-traits.workspace = true diff --git a/tsalign-tests/Cargo.toml b/tsalign-tests/Cargo.toml index bc06ea0..82bb776 100644 --- a/tsalign-tests/Cargo.toml +++ b/tsalign-tests/Cargo.toml @@ -2,7 +2,7 @@ name = "tsalign-tests" license.workspace = true authors = ["Sebastian Schmidt ", "Jasper Krauter "] -version = "0.4.1" +version = "0.5.0" edition.workspace = true rust-version.workspace = true repository.workspace = true diff --git a/tsalign/Cargo.toml b/tsalign/Cargo.toml index 520089d..c9e6477 100644 --- a/tsalign/Cargo.toml +++ b/tsalign/Cargo.toml @@ -3,17 +3,17 @@ name = "tsalign" description = "A sequence-to-sequence aligner that accounts for template switches" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.19.1" +version = "0.20.0" edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -lib_tsalign = { version = "0.19.1", path = "../lib_tsalign", features = [ +lib_tsalign = { version = "0.20.0", path = "../lib_tsalign", features = [ "serde", ] } -lib_ts_chainalign = { version = "0.1.0", path = "../lib_ts_chainalign" } -lib_tsshow = { version = "0.19.1", path = "../lib_tsshow" } +lib_ts_chainalign = { version = "0.2.0", path = "../lib_ts_chainalign" } +lib_tsshow = { version = "0.20.0", path = "../lib_tsshow" } clap.workspace = true compact-genome = { workspace = true, features = ["io"] } traitsequence.workspace = true From b8ced6421f68aaeff33fbeaddb3771a9063ea140 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 8 Jan 2026 09:47:00 +0200 Subject: [PATCH 5/6] Add default to `AlignmentPerformanceParameters`. --- lib_ts_chainalign/src/chain_align.rs | 61 +++++-------------- .../src/chain_align/performance_parameters.rs | 51 ++++++++++++++++ lib_ts_chainalign/src/lib.rs | 10 +-- tsalign/src/align.rs | 4 +- tsalign/src/align/a_star_chain_ts.rs | 8 +-- 5 files changed, 77 insertions(+), 57 deletions(-) create mode 100644 lib_ts_chainalign/src/chain_align/performance_parameters.rs diff --git a/lib_ts_chainalign/src/chain_align.rs b/lib_ts_chainalign/src/chain_align.rs index 0de9c30..5cd7a50 100644 --- a/lib_ts_chainalign/src/chain_align.rs +++ b/lib_ts_chainalign/src/chain_align.rs @@ -1,5 +1,4 @@ use binary_heap_plus::BinaryHeap; -use clap::ValueEnum; use compact_genome::{ implementation::vec_sequence::VectorGenome, interface::{ @@ -34,6 +33,9 @@ use crate::{ chain_align::{ chainer::{Context, Identifier, Node, closed_list::ChainerClosedList}, evaluation::ChainEvaluator, + performance_parameters::{ + AlignmentPerformanceParameters, ChainingClosedList, ChainingOpenList, + }, }, chaining_cost_function::ChainingCostFunction, costs::AlignmentCosts, @@ -41,62 +43,27 @@ use crate::{ mod chainer; mod evaluation; - -pub struct AlignmentParameters { - /// The step width for generating successors during chaining. - /// - /// At most `max_successors` will be generated at a time, but at least all with minimum chaining cost. - pub max_successors: usize, - - /// The cost until which the cost function is initialised exactly. - /// - /// Anchor chainings with a higher exact cost are initialised based on the lower bound. - pub max_exact_cost_function_cost: Cost, - - /// The closed list type to use for chaining. - pub closed_list: ChainingClosedList, - - /// The open list type to use for chaining. - pub open_list: ChainingOpenList, -} - -/// The closed list type to use for chaining. -#[derive(Debug, Clone, ValueEnum)] -pub enum ChainingClosedList { - /// Use [`HashMap`](std::collections::HashMap) as closed list with [`FxHasher`](rustc_hash::FxHasher) as hasher. - FxHashMap, - /// Use a special-purpose closed list. - Special, -} - -/// The open list type to use for chaining. -#[derive(Debug, Clone, ValueEnum)] -pub enum ChainingOpenList { - /// Use [`BinaryHeap`](std::collections::BinaryHeap) as open list. - StdHeap, - /// Use [`LinearHeap`](generic_a_star::open_lists::linear_heap::LinearHeap) as open list. - LinearHeap, -} +pub mod performance_parameters; #[expect(clippy::too_many_arguments)] pub fn align( sequences: &AlignmentSequences, start: AlignmentCoordinates, end: AlignmentCoordinates, - parameters: &AlignmentParameters, + performance_parameters: &AlignmentPerformanceParameters, alignment_costs: &AlignmentCosts, rc_fn: &dyn Fn(u8) -> u8, max_match_run: u32, anchors: &Anchors, chaining_cost_function: &mut ChainingCostFunction, ) -> AlignmentResult { - match parameters.open_list { + match performance_parameters.open_list { ChainingOpenList::StdHeap => { choose_closed_list::, AStarNodeComparator>>( sequences, start, end, - parameters, + performance_parameters, alignment_costs, rc_fn, max_match_run, @@ -108,7 +75,7 @@ pub fn align( sequences, start, end, - parameters, + performance_parameters, alignment_costs, rc_fn, max_match_run, @@ -127,20 +94,20 @@ pub fn choose_closed_list< sequences: &AlignmentSequences, start: AlignmentCoordinates, end: AlignmentCoordinates, - parameters: &AlignmentParameters, + performance_parameters: &AlignmentPerformanceParameters, alignment_costs: &AlignmentCosts, rc_fn: &dyn Fn(u8) -> u8, max_match_run: u32, anchors: &Anchors, chaining_cost_function: &mut ChainingCostFunction, ) -> AlignmentResult { - match parameters.closed_list { + match performance_parameters.closed_list { ChainingClosedList::FxHashMap => { actually_align::, OpenList>( sequences, start, end, - parameters, + performance_parameters, alignment_costs, rc_fn, max_match_run, @@ -153,7 +120,7 @@ pub fn choose_closed_list< sequences, start, end, - parameters, + performance_parameters, alignment_costs, rc_fn, max_match_run, @@ -174,7 +141,7 @@ fn actually_align< sequences: &AlignmentSequences, start: AlignmentCoordinates, end: AlignmentCoordinates, - parameters: &AlignmentParameters, + performance_parameters: &AlignmentPerformanceParameters, alignment_costs: &AlignmentCosts, rc_fn: &dyn Fn(u8) -> u8, max_match_run: u32, @@ -194,7 +161,7 @@ fn actually_align< chaining_cost_function, &alignment_costs.ts_limits, k, - parameters.max_successors, + performance_parameters.max_successors, ); let mut astar = AStar::<_, ClosedList, OpenList>::new(context); diff --git a/lib_ts_chainalign/src/chain_align/performance_parameters.rs b/lib_ts_chainalign/src/chain_align/performance_parameters.rs new file mode 100644 index 0000000..41902d9 --- /dev/null +++ b/lib_ts_chainalign/src/chain_align/performance_parameters.rs @@ -0,0 +1,51 @@ +use clap::ValueEnum; + +/// Performance parameters for chainalign. +/// +/// Use the `default()` method for a reasonable choice of parameters that works well in many cases. +pub struct AlignmentPerformanceParameters { + /// The step width for generating successors during chaining. + /// + /// At most `max_successors` will be generated at a time, but at least all with minimum chaining cost. + pub max_successors: usize, + + /// The cost until which the cost function is initialised exactly. + /// + /// Anchor chainings with a higher exact cost are initialised based on the lower bound. + pub max_exact_cost_function_cost: Cost, + + /// The closed list type to use for chaining. + pub closed_list: ChainingClosedList, + + /// The open list type to use for chaining. + pub open_list: ChainingOpenList, +} + +/// The closed list type to use for chaining. +#[derive(Debug, Clone, ValueEnum)] +pub enum ChainingClosedList { + /// Use [`HashMap`](std::collections::HashMap) as closed list with [`FxHasher`](rustc_hash::FxHasher) as hasher. + FxHashMap, + /// Use a special-purpose closed list. + Special, +} + +/// The open list type to use for chaining. +#[derive(Debug, Clone, ValueEnum)] +pub enum ChainingOpenList { + /// Use [`BinaryHeap`](std::collections::BinaryHeap) as open list. + StdHeap, + /// Use [`LinearHeap`](generic_a_star::open_lists::linear_heap::LinearHeap) as open list. + LinearHeap, +} + +impl> Default for AlignmentPerformanceParameters { + fn default() -> Self { + Self { + max_successors: 1, + max_exact_cost_function_cost: 1u8.into(), + closed_list: ChainingClosedList::Special, + open_list: ChainingOpenList::LinearHeap, + } + } +} diff --git a/lib_ts_chainalign/src/lib.rs b/lib_ts_chainalign/src/lib.rs index c4752fd..3bca35b 100644 --- a/lib_ts_chainalign/src/lib.rs +++ b/lib_ts_chainalign/src/lib.rs @@ -11,7 +11,7 @@ use log::{debug, info, trace}; use crate::{ alignment::{coordinates::AlignmentCoordinates, sequences::AlignmentSequences}, anchors::Anchors, - chain_align::AlignmentParameters, + chain_align::performance_parameters::AlignmentPerformanceParameters, chaining_cost_function::ChainingCostFunction, chaining_lower_bounds::ChainingLowerBounds, costs::AlignmentCosts, @@ -60,7 +60,7 @@ pub fn preprocess( /// * `reference` is the reference string in ASCII format. Only characters `A`, `C`, `G` and `T` are allowed. /// * `query` is the query string in ASCII format. Only characters `A`, `C`, `G` and `T` are allowed. /// * `range` is the range on which the alignment happens. Note that points 2 and 3 of a template switch may fall outside of this range. -/// * `parameters` is a set of parameters for the aligner that only affect performance. +/// * `performance_parameters` is a set of parameters for the aligner that only affect performance. /// * `rc_fn` is a function that maps a character to its reverse complement. /// * `reference_name` is the name of the reference string. It is irrelevant for the alignment, but will appear in e.g. the output of `tsalign show`. /// * `query_name` is the name of the query string. It is irrelevant for the alignment, but will appear in e.g. the output of `tsalign show`. @@ -70,7 +70,7 @@ pub fn align( reference: Vec, query: Vec, range: AlignmentRange, - parameters: &AlignmentParameters, + performance_parameters: &AlignmentPerformanceParameters, rc_fn: &dyn Fn(u8) -> u8, reference_name: &str, query_name: &str, @@ -101,7 +101,7 @@ pub fn align( &sequences, start, end, - parameters.max_exact_cost_function_cost, + performance_parameters.max_exact_cost_function_cost, rc_fn, ); @@ -109,7 +109,7 @@ pub fn align( &sequences, start, end, - parameters, + performance_parameters, chaining_lower_bounds.alignment_costs(), rc_fn, chaining_lower_bounds.max_match_run(), diff --git a/tsalign/src/align.rs b/tsalign/src/align.rs index 6ebe836..7e6d36b 100644 --- a/tsalign/src/align.rs +++ b/tsalign/src/align.rs @@ -24,7 +24,9 @@ use compact_genome::{ sequence_store::SequenceStore, }, }; -use lib_ts_chainalign::chain_align::{ChainingClosedList, ChainingOpenList}; +use lib_ts_chainalign::chain_align::performance_parameters::{ + ChainingClosedList, ChainingOpenList, +}; use lib_tsalign::{ a_star_aligner::{ alignment_geometry::{AlignmentCoordinates, AlignmentRange}, diff --git a/tsalign/src/align/a_star_chain_ts.rs b/tsalign/src/align/a_star_chain_ts.rs index 9dc1961..5779128 100644 --- a/tsalign/src/align/a_star_chain_ts.rs +++ b/tsalign/src/align/a_star_chain_ts.rs @@ -3,8 +3,8 @@ use compact_genome::interface::{ sequence::GenomeSequence, }; use lib_ts_chainalign::{ - chain_align::AlignmentParameters, chaining_lower_bounds::ChainingLowerBounds, - costs::AlignmentCosts, + chain_align::performance_parameters::AlignmentPerformanceParameters, + chaining_lower_bounds::ChainingLowerBounds, costs::AlignmentCosts, }; use lib_tsalign::{ a_star_aligner::alignment_geometry::AlignmentRange, config::TemplateSwitchConfig, @@ -93,7 +93,7 @@ pub fn align_a_star_chain_ts< let reference = reference.clone_as_vec(); let query = query.clone_as_vec(); - let parameters = AlignmentParameters { + let performance_parameters = AlignmentPerformanceParameters { max_successors: cli.max_chaining_successors, max_exact_cost_function_cost: cli.max_exact_cost_function_cost.into(), closed_list: cli.chaining_closed_list, @@ -104,7 +104,7 @@ pub fn align_a_star_chain_ts< reference, query, range, - ¶meters, + &performance_parameters, &|c| { AlphabetType::character_to_ascii( AlphabetType::ascii_to_character(c).unwrap().complement(), From 412ebf73c0238eb6c4ee1dda2f4d351c2703941d Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 8 Jan 2026 09:49:26 +0200 Subject: [PATCH 6/6] chore: Release --- Cargo.lock | 16 ++++++++-------- generic_a_star/Cargo.toml | 2 +- lib_ts_chainalign/Cargo.toml | 6 +++--- lib_tsalign/Cargo.toml | 6 +++--- lib_tsshow/Cargo.toml | 4 ++-- python_bindings/Cargo.toml | 6 +++--- seed_chain/Cargo.toml | 4 ++-- tsalign-tests/Cargo.toml | 2 +- tsalign/Cargo.toml | 8 ++++---- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49c222e..abce813 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,7 +418,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "generic_a_star" -version = "0.20.0" +version = "0.21.0" dependencies = [ "binary-heap-plus", "compare", @@ -549,7 +549,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lib_ts_chainalign" -version = "0.2.0" +version = "0.3.0" dependencies = [ "binary-heap-plus", "bincode", @@ -569,7 +569,7 @@ dependencies = [ [[package]] name = "lib_tsalign" -version = "0.20.0" +version = "0.21.0" dependencies = [ "binary-heap-plus", "compact-genome", @@ -590,7 +590,7 @@ dependencies = [ [[package]] name = "lib_tsshow" -version = "0.20.0" +version = "0.21.0" dependencies = [ "ena", "itertools", @@ -805,7 +805,7 @@ dependencies = [ [[package]] name = "py_lib_tsalign" -version = "0.5.0" +version = "0.6.0" dependencies = [ "compact-genome", "lib_tsalign", @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "seed_chain" -version = "0.20.0" +version = "0.21.0" dependencies = [ "compact-genome", "generic_a_star", @@ -1361,7 +1361,7 @@ checksum = "2b939c825d0c4295ac520f7b479927c1e5b458c9107a9d6f5ba65bc867bb93a5" [[package]] name = "tsalign" -version = "0.20.0" +version = "0.21.0" dependencies = [ "anyhow", "bincode", @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "tsalign-tests" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "clap", diff --git a/generic_a_star/Cargo.toml b/generic_a_star/Cargo.toml index e6b003b..7a8646c 100644 --- a/generic_a_star/Cargo.toml +++ b/generic_a_star/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "generic_a_star" description = "A generic implementation of the A* algorithm" -version = "0.20.0" +version = "0.21.0" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/lib_ts_chainalign/Cargo.toml b/lib_ts_chainalign/Cargo.toml index ab1a1d7..ae47bbb 100644 --- a/lib_ts_chainalign/Cargo.toml +++ b/lib_ts_chainalign/Cargo.toml @@ -2,15 +2,15 @@ name = "lib_ts_chainalign" description = "A chaining-based sequence-to-sequence aligner that accounts for template switches" authors = ["Sebastian Schmidt "] -version = "0.2.0" +version = "0.3.0" license.workspace = true edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -generic_a_star = { version = "0.20.0", path = "../generic_a_star" } -lib_tsalign = { version = "0.20.0", path = "../lib_tsalign" } +generic_a_star = { version = "0.21.0", path = "../generic_a_star" } +lib_tsalign = { version = "0.21.0", path = "../lib_tsalign" } ndarray = { version = "0.17.1", features = ["serde"] } num-traits.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/lib_tsalign/Cargo.toml b/lib_tsalign/Cargo.toml index 3d7b8b6..a426b47 100644 --- a/lib_tsalign/Cargo.toml +++ b/lib_tsalign/Cargo.toml @@ -2,7 +2,7 @@ name = "lib_tsalign" description = "A sequence-to-sequence aligner that accounts for template switches" authors = ["Sebastian Schmidt "] -version = "0.20.0" +version = "0.21.0" license.workspace = true edition.workspace = true rust-version.workspace = true @@ -26,9 +26,9 @@ thiserror = "2.0.3" num-traits.workspace = true serde = { workspace = true, features = ["derive"], optional = true } noisy_float = { version = "0.2.0" } -generic_a_star = { version = "0.20.0", path = "../generic_a_star" } +generic_a_star = { version = "0.21.0", path = "../generic_a_star" } log.workspace = true rustc-hash = "2.1.1" -seed_chain = { version = "0.20.0", path = "../seed_chain" } +seed_chain = { version = "0.21.0", path = "../seed_chain" } extend_map = "0.14.3" template-switch-error-free-inners = "0.1.1" diff --git a/lib_tsshow/Cargo.toml b/lib_tsshow/Cargo.toml index 4401cc6..e019029 100644 --- a/lib_tsshow/Cargo.toml +++ b/lib_tsshow/Cargo.toml @@ -3,13 +3,13 @@ name = "lib_tsshow" description = "A visualiser for template-switch alignments" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.20.0" +version = "0.21.0" edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -lib_tsalign = { version = "0.20.0", path = "../lib_tsalign" } +lib_tsalign = { version = "0.21.0", path = "../lib_tsalign" } log.workspace = true svg = "0.18.0" resvg = "0.45.0" diff --git a/python_bindings/Cargo.toml b/python_bindings/Cargo.toml index 6823cda..85df2e5 100644 --- a/python_bindings/Cargo.toml +++ b/python_bindings/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "Sebastian Schmidt ", "Jasper Krauter ", ] -version = "0.5.0" +version = "0.6.0" edition.workspace = true rust-version.workspace = true repository.workspace = true @@ -18,10 +18,10 @@ crate-type = ["cdylib"] [dependencies] pyo3 = "0.26" -lib_tsalign = { version = "0.20.0", path = "../lib_tsalign", features = [ +lib_tsalign = { version = "0.21.0", path = "../lib_tsalign", features = [ "serde", ] } -lib_tsshow = { version = "0.20.0", path = "../lib_tsshow" } +lib_tsshow = { version = "0.21.0", path = "../lib_tsshow" } serde.workspace = true pythonize = "0.26" pyo3-log = "0.13" diff --git a/seed_chain/Cargo.toml b/seed_chain/Cargo.toml index dc7bf39..58acad5 100644 --- a/seed_chain/Cargo.toml +++ b/seed_chain/Cargo.toml @@ -3,7 +3,7 @@ name = "seed_chain" description = "A seeding and generic chaining mechanism for sequence-to-sequence alignment" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.20.0" +version = "0.21.0" edition.workspace = true rust-version.workspace = true repository.workspace = true @@ -12,5 +12,5 @@ repository.workspace = true [dependencies] compact-genome.workspace = true log.workspace = true -generic_a_star = { version = "0.20.0", path = "../generic_a_star" } +generic_a_star = { version = "0.21.0", path = "../generic_a_star" } num-traits.workspace = true diff --git a/tsalign-tests/Cargo.toml b/tsalign-tests/Cargo.toml index 82bb776..156fe36 100644 --- a/tsalign-tests/Cargo.toml +++ b/tsalign-tests/Cargo.toml @@ -2,7 +2,7 @@ name = "tsalign-tests" license.workspace = true authors = ["Sebastian Schmidt ", "Jasper Krauter "] -version = "0.5.0" +version = "0.6.0" edition.workspace = true rust-version.workspace = true repository.workspace = true diff --git a/tsalign/Cargo.toml b/tsalign/Cargo.toml index c9e6477..1748ab8 100644 --- a/tsalign/Cargo.toml +++ b/tsalign/Cargo.toml @@ -3,17 +3,17 @@ name = "tsalign" description = "A sequence-to-sequence aligner that accounts for template switches" license.workspace = true authors = ["Sebastian Schmidt "] -version = "0.20.0" +version = "0.21.0" edition.workspace = true rust-version.workspace = true repository.workspace = true [dependencies] -lib_tsalign = { version = "0.20.0", path = "../lib_tsalign", features = [ +lib_tsalign = { version = "0.21.0", path = "../lib_tsalign", features = [ "serde", ] } -lib_ts_chainalign = { version = "0.2.0", path = "../lib_ts_chainalign" } -lib_tsshow = { version = "0.20.0", path = "../lib_tsshow" } +lib_ts_chainalign = { version = "0.3.0", path = "../lib_ts_chainalign" } +lib_tsshow = { version = "0.21.0", path = "../lib_tsshow" } clap.workspace = true compact-genome = { workspace = true, features = ["io"] } traitsequence.workspace = true