diff --git a/Cargo.lock b/Cargo.lock index 6e515337..64539355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae682f693a9cd7b058f2b0b5d9a6d7728a8555779bedbbc35dd88528611d020" +checksum = "d48f96fc3003717aeb9856ca3d02a8c7de502667ad76eeacd830b48d2e91fac4" dependencies = [ "actix-codec", "actix-rt", @@ -65,7 +65,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -95,16 +95,16 @@ dependencies = [ [[package]] name = "actix-server" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02303ce8d4e8be5b855af6cf3c3a08f3eff26880faad82bab679c22d3650cb5" +checksum = "7ca2549781d8dd6d75c40cf6b6051260a2cc2f3c62343d761a969a0640646894" dependencies = [ "actix-rt", "actix-service", "actix-utils", "futures-core", "futures-util", - "mio 0.8.11", + "mio", "socket2 0.5.7", "tokio", "tracing", @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.8.0" +version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1988c02af8d2b718c05bc4aeb6a66395b7cdf32858c2c71131e5637a8c05a9ff" +checksum = "9180d76e5cc7ccbc4d60a506f2c727730b154010262df5b910eb17dbe4b8cb38" dependencies = [ "actix-codec", "actix-http", @@ -155,6 +155,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", + "impl-more", "itoa", "language-tags", "log", @@ -181,7 +182,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -384,9 +385,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-attributes" @@ -455,7 +456,7 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", @@ -484,9 +485,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", @@ -494,11 +495,11 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling 3.7.3", + "rustix 0.38.35", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -556,13 +557,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -609,9 +610,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" +checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -621,15 +622,16 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42c2d4218de4dcd890a109461e2f799a1a2ba3bcd2cde9af88360f5df9266c6" +checksum = "2424565416eef55906f9f8cece2072b6b6a76075e3ff81483ebe938a89a4c05f" dependencies = [ "aws-credential-types", "aws-sigv4", "aws-smithy-async", "aws-smithy-eventstream", "aws-smithy-http", + "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", @@ -646,9 +648,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.43.0" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccda7e730ace3cb8bbd4071bc650c6d294364891f9564bd4e43adfc8dea3177" +checksum = "cca49303c05d2a740b8a4552fac63a4db6ead84f7e7eeed04761fd3014c26f25" dependencies = [ "ahash 0.8.11", "aws-credential-types", @@ -681,9 +683,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.37.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1074e818fbe4f9169242d78448b15be8916a79daa38ea1231f2e2e10d993fcd2" +checksum = "e5879bec6e74b648ce12f6085e7245417bc5f6d672781028384d2e494be3eb6d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -703,9 +705,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.38.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29755c51e33fa3f678598f64324a169cf4b7d3c4865d2709d4308f53366a92a4" +checksum = "4ef4cd9362f638c22a3b959fd8df292e7e47fdf170270f86246b97109b5f2f7d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -725,9 +727,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.37.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e52dc3fd7dfa6c01a69cf3903e00aa467261639138a05b06cd92314d2c8fb07" +checksum = "0b1e2735d2ab28b35ecbb5496c9d41857f52a0d6a0075bbf6a8af306045ea6f6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -820,9 +822,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.9" +version = "0.60.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9cd0ae3d97daa0a2bf377a4d8e8e1362cae590c4a1aad0d40058ebca18eb91e" +checksum = "01dbcb6e2588fd64cfb6d7529661b06466419e4c54ed1c62d6510d2d0350a728" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -860,9 +862,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.6.2" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce87155eba55e11768b8c1afa607f3e864ae82f03caf63258b37455b0ad02537" +checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -904,9 +906,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.0" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe321a6b21f5d8eabd0ade9c55d3d0335f3c3157fc2b3e87f05f34b539e4df5" +checksum = "273dcdfd762fae3e1650b8024624e7cd50e484e37abdab73a7a706188ad34543" dependencies = [ "base64-simd", "bytes", @@ -947,7 +949,7 @@ dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "tracing", ] @@ -1035,7 +1037,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1079,9 +1081,9 @@ dependencies = [ [[package]] name = "bio-types" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cc7edd677651969cc262a8dfb870f0c2266c3ceeaf863d742982e39699ff460" +checksum = "f4dcf54f8b7f51450207d54780bab09c05f30b8b0caa991545082842e466ad7e" dependencies = [ "derive-new 0.6.0", "lazy_static", @@ -1197,7 +1199,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "syn_derive", ] @@ -1289,9 +1291,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" [[package]] name = "byteorder" @@ -1375,7 +1377,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1386,12 +1388,13 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1482,7 +1485,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1563,9 +1566,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "coz" @@ -1579,9 +1582,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -1592,7 +1595,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" dependencies = [ - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -1718,7 +1721,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1729,7 +1732,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1791,7 +1794,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1802,7 +1805,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1823,7 +1826,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1833,7 +1836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" dependencies = [ "derive_builder_core", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1845,8 +1848,8 @@ dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.72", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1980,7 +1983,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2001,7 +2004,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2280,7 +2283,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2652,6 +2655,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "impl-more" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" + [[package]] name = "indexmap" version = "1.9.3" @@ -2771,9 +2780,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2807,7 +2816,7 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2903,9 +2912,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -2961,9 +2970,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -3085,9 +3094,9 @@ dependencies = [ [[package]] name = "mehari" -version = "0.26.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3facefeeab18cd7c0dbc08ef008b225e5f1e50d8eb49c9fcb69f89d66bdfbe" +checksum = "8f3d50c31dc97c89aad833828657d57f66a57ce735c9157e245c3ee1f4400597" dependencies = [ "actix-web", "annonars", @@ -3193,24 +3202,13 @@ checksum = "9bec4598fddb13cc7b528819e697852653252b760f1228b7642679bf2ff2cd07" [[package]] name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", + "log", "wasi", "windows-sys 0.52.0", ] @@ -3250,7 +3248,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3619,15 +3617,15 @@ dependencies = [ "kinded", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "urlencoding", ] [[package]] name = "object" -version = "0.36.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -3706,16 +3704,16 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] [[package]] name = "parse-display" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" +checksum = "287d8d3ebdce117b8539f59411e4ed9ec226e0a4153c7f55495c6070d68e6f72" dependencies = [ "parse-display-derive", "regex", @@ -3724,16 +3722,16 @@ dependencies = [ [[package]] name = "parse-display-derive" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae7800a4c974efd12df917266338e79a7a74415173caf7e70aa0a0707345281" +checksum = "7fc048687be30d79502dea2f623d052f3a074012c6eac41726b7ab17213616b1" dependencies = [ "proc-macro2", "quote", "regex", "regex-syntax 0.8.4", "structmeta", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3827,9 +3825,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", "fastrand 2.1.1", @@ -3870,17 +3868,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.35", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3960,19 +3958,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -4021,7 +4019,7 @@ dependencies = [ "hex", "lazy_static", "procfs-core", - "rustix 0.38.34", + "rustix 0.38.35", ] [[package]] @@ -4047,9 +4045,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "f8650aabb6c35b860610e9cff5dc1af886c9e25073b7b1712a68972af4281302" dependencies = [ "bytes", "heck", @@ -4062,7 +4060,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.72", + "syn 2.0.77", "tempfile", ] @@ -4076,14 +4074,14 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519" dependencies = [ "prost", ] @@ -4110,9 +4108,9 @@ dependencies = [ [[package]] name = "quick_cache" -version = "0.6.2" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec932c60e6faf77dc6601ea149a23d821598b019b450bb1d98fe89c0301c0b61" +checksum = "2ec0b6fed0a0ff01fa82d0c8982389375dd59c72dae84d4f8a15b1a894c273f7" dependencies = [ "ahash 0.8.11", "equivalent", @@ -4122,9 +4120,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4201,15 +4199,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -4221,9 +4210,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -4323,9 +4312,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -4341,9 +4330,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -4402,7 +4391,7 @@ dependencies = [ "futures", "futures-timer", "rstest_macros", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -4418,8 +4407,8 @@ dependencies = [ "quote", "regex", "relative-path", - "rustc_version 0.4.0", - "syn 2.0.72", + "rustc_version 0.4.1", + "syn 2.0.77", "unicode-ident", ] @@ -4439,9 +4428,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.35.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", "borsh", @@ -4482,9 +4471,9 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] @@ -4505,9 +4494,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -4690,7 +4679,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4754,7 +4743,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4961,7 +4950,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4972,7 +4961,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4994,7 +4983,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5016,9 +5005,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5034,7 +5023,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5058,7 +5047,7 @@ dependencies = [ "cfg-if", "fastrand 2.1.1", "once_cell", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.59.0", ] @@ -5079,7 +5068,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5153,7 +5142,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -5170,7 +5159,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5230,9 +5219,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap 2.5.0", "toml_datetime", @@ -5241,9 +5230,9 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5265,7 +5254,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5325,7 +5314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5342,9 +5331,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typeid" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" @@ -5375,9 +5364,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" [[package]] name = "unicode-segmentation" @@ -5582,34 +5571,35 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5619,9 +5609,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5629,28 +5619,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5668,20 +5658,20 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", "web-sys", ] [[package]] name = "wide" -version = "0.7.26" +version = "0.7.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901e8597c777fa042e9e245bd56c0dc4418c5db3f845b6ff94fbac732c6a0692" +checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" dependencies = [ "bytemuck", "safe_arch", @@ -5868,9 +5858,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -5923,7 +5913,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 27381035..30ad1f3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,11 +35,11 @@ ext-sort = { version = "0.1", features = ["memory-limit", "bytesize"] } fastrand = "2.1" flate2 = "1.0" futures = "0.3.30" -hgvs = "0.17" +hgvs = "0.17.2" indexmap = { version = "2.5", features = ["serde"] } itertools = "0.13" log = "0.4" -mehari = "0.26.1" +mehari = "0.28.1" multimap = "0.10" pbjson = "0.7" pbjson-types = "0.7" diff --git a/src/seqvars/aggregate/mod.rs b/src/seqvars/aggregate/mod.rs index cdd5563b..fd46a2a6 100644 --- a/src/seqvars/aggregate/mod.rs +++ b/src/seqvars/aggregate/mod.rs @@ -2,7 +2,8 @@ pub mod ds; -use mehari::common::noodles::open_vcf_reader; +use futures::TryStreamExt as _; +use mehari::common::noodles::NoodlesVariantReader as _; use noodles::vcf; use rayon::prelude::*; use std::{str::FromStr as _, sync::Arc}; @@ -196,7 +197,7 @@ async fn import_vcf( cf_carriers: &str, genomebuild: crate::common::GenomeRelease, ) -> Result<(), anyhow::Error> { - let mut input_reader = open_vcf_reader(path_input) + let mut input_reader = common::noodles::open_vcf_reader(path_input) .await .map_err(|e| anyhow::anyhow!("could not open file {} for reading: {}", path_input, e))?; let input_header = input_reader.read_header().await?; @@ -206,16 +207,9 @@ async fn import_vcf( let (pedigree, case_uuid) = common::extract_pedigree_and_case_uuid(&input_header)?; let mut prev = std::time::Instant::now(); - let mut record_buf = vcf::variant::RecordBuf::default(); - loop { - let bytes_read = input_reader - .read_record_buf(&input_header, &mut record_buf) - .await - .map_err(|e| anyhow::anyhow!("problem reading VCF file {}: {}", path_input, e))?; - if bytes_read == 0 { - break; // EOF - } + let mut records = input_reader.records(&input_header).await; + while let Some(record_buf) = records.try_next().await? { // Obtain counts from the current variant. let (this_counts_data, this_carrier_data) = handle_record( &record_buf, @@ -238,29 +232,29 @@ async fn import_vcf( // Read data for variant from database. let mut db_counts_data = transaction.get_cf(&cf_counts, key.clone()).map_err(|e| { - anyhow::anyhow!( - "problem acessing counts data for variant {:?}: {} (non-existing would be fine)", - &vcf_var, - e - ) - })?.map(|buffer| ds::Counts::from_vec(&buffer)).unwrap_or_default(); + anyhow::anyhow!( + "problem acessing counts data for variant {:?}: {} (non-existing would be fine)", + &vcf_var, + e + ) + })?.map(|buffer| ds::Counts::from_vec(&buffer)).unwrap_or_default(); let mut db_carrier_data = transaction.get_cf(&cf_carriers, key.clone()).map_err(|e| { - anyhow::anyhow!( - "problem acessing carrier data for variant {:?}: {} (non-existing would be fine)", - &vcf_var, - e - ) - })? - .map(|buffer| ds::CarrierList::try_from(buffer.as_slice())) - .transpose() - .map_err(|e| { - anyhow::anyhow!( - "problem decoding carrier data for variant {:?}: {}", - &vcf_var, - e - ) - })? - .unwrap_or_default(); + anyhow::anyhow!( + "problem acessing carrier data for variant {:?}: {} (non-existing would be fine)", + &vcf_var, + e + ) + })? + .map(|buffer| ds::CarrierList::try_from(buffer.as_slice())) + .transpose() + .map_err(|e| { + anyhow::anyhow!( + "problem decoding carrier data for variant {:?}: {}", + &vcf_var, + e + ) + })? + .unwrap_or_default(); // Aggregate the data. db_counts_data.aggregate(this_counts_data); @@ -268,7 +262,7 @@ async fn import_vcf( // Write data for variant back to database. transaction - .put_cf(&cf_counts, key.clone(), &db_counts_data.to_vec()) + .put_cf(&cf_counts, key.clone(), db_counts_data.to_vec()) .map_err(|e| { anyhow::anyhow!( "problem writing counts data for variant {:?}: {}", @@ -277,7 +271,7 @@ async fn import_vcf( ) })?; transaction - .put_cf(&cf_carriers, key.clone(), &db_carrier_data.to_vec()) + .put_cf(&cf_carriers, key.clone(), db_carrier_data.to_vec()) .map_err(|e| { anyhow::anyhow!( "problem writing carrier data for variant {:?}: {}", diff --git a/src/seqvars/ingest/mod.rs b/src/seqvars/ingest/mod.rs index a77342bb..50e65248 100644 --- a/src/seqvars/ingest/mod.rs +++ b/src/seqvars/ingest/mod.rs @@ -6,8 +6,12 @@ use crate::{ common::{self, genotype_to_string, strip_gt_leading_slash, worker_version, GenomeRelease}, flush_and_shutdown, }; -use mehari::annotate::seqvars::provider::Provider as MehariProvider; -use mehari::common::noodles::{open_vcf_reader, open_vcf_writer, AsyncVcfReader, AsyncVcfWriter}; +use futures::TryStreamExt as _; +use mehari::common::noodles::{open_vcf_writer, AsyncVcfWriter}; +use mehari::{ + annotate::seqvars::provider::Provider as MehariProvider, + common::noodles::{NoodlesVariantReader as _, VariantReader}, +}; use noodles::vcf; use thousands::Separable; use tokio::io::AsyncWriteExt; @@ -281,7 +285,7 @@ fn copy_format( /// Process the variants from `input_reader` to `output_writer`. async fn process_variants( output_writer: &mut AsyncVcfWriter, - input_reader: &mut AsyncVcfReader, + input_reader: &mut VariantReader, output_header: &vcf::Header, input_header: &vcf::Header, id_mapping: &Option>, @@ -302,10 +306,7 @@ async fn process_variants( ["meta", "autosomal", "gonosomal", "mitochondrial"], false, )?; - - let cf_autosomal = db_freq.cf_handle("autosomal").unwrap(); - let cf_gonosomal = db_freq.cf_handle("gonosomal").unwrap(); - let cf_mtdna = db_freq.cf_handle("mitochondrial").unwrap(); + let freq_anno = mehari::annotate::seqvars::FrequencyAnnotator::new(db_freq); // Open the ClinVar RocksDB database in read only mode. tracing::info!("Opening ClinVar database"); @@ -318,8 +319,7 @@ async fn process_variants( let options = rocksdb::Options::default(); let db_clinvar = rocksdb::DB::open_cf_for_read_only(&options, &rocksdb_path, ["meta", "clinvar"], false)?; - - let cf_clinvar = db_clinvar.cf_handle("clinvar").unwrap(); + let clinvar_anno = mehari::annotate::seqvars::ClinvarAnnotator::new(db_clinvar); // Open the serialized transcripts. tracing::info!("Opening transcript database"); @@ -366,17 +366,9 @@ async fn process_variants( let start = std::time::Instant::now(); let mut prev = std::time::Instant::now(); let mut total_written = 0usize; - let mut input_record = vcf::variant::RecordBuf::default(); let known_format_keys = KNOWN_FORMAT_KEYS.get_or_init(Default::default); - loop { - let bytes_read = input_reader - .read_record_buf(input_header, &mut input_record) - .await - .map_err(|e| anyhow::anyhow!("problem reading VCF file: {}", e))?; - if bytes_read == 0 { - break; // EOF - } - + let mut records = input_reader.records(input_header).await; + while let Some(input_record) = records.try_next().await? { for (allele_no, alt_allele) in input_record.alternate_bases().as_ref().iter().enumerate() { let allele_no = allele_no + 1; // Construct record with first few fields describing one variant allele. @@ -424,26 +416,11 @@ async fn process_variants( // Annotate with frequency. if mehari::annotate::seqvars::CHROM_AUTO.contains(vcf_var.chrom.as_str()) { - mehari::annotate::seqvars::annotate_record_auto( - &db_freq, - &cf_autosomal, - &key, - &mut output_record, - )?; + freq_anno.annotate_record_auto(&key, &mut output_record)?; } else if mehari::annotate::seqvars::CHROM_XY.contains(vcf_var.chrom.as_str()) { - mehari::annotate::seqvars::annotate_record_xy( - &db_freq, - &cf_gonosomal, - &key, - &mut output_record, - )?; + freq_anno.annotate_record_xy(&key, &mut output_record)?; } else if mehari::annotate::seqvars::CHROM_MT.contains(vcf_var.chrom.as_str()) { - mehari::annotate::seqvars::annotate_record_mt( - &db_freq, - &cf_mtdna, - &key, - &mut output_record, - )?; + freq_anno.annotate_record_mt(&key, &mut output_record)?; } else { tracing::debug!( "Record @{:?} on non-canonical chromosome, skipping.", @@ -452,12 +429,7 @@ async fn process_variants( } // Annotate with ClinVar information. - mehari::annotate::seqvars::annotate_record_clinvar( - &db_clinvar, - &cf_clinvar, - &key, - &mut output_record, - )?; + clinvar_anno.annotate_record_clinvar(&key, &mut output_record)?; } let annonars::common::keys::Var { @@ -527,7 +499,7 @@ pub async fn run(args_common: &crate::common::Args, args: &Args) -> Result<(), a tracing::info!("pedigre = {:#?}", &pedigree); tracing::info!("opening input file..."); - let mut input_reader = open_vcf_reader(&args.path_in) + let mut input_reader = common::noodles::open_vcf_reader(&args.path_in) .await .map_err(|e| anyhow::anyhow!("could not build VCF reader: {}", e))?; diff --git a/src/seqvars/prefilter/mod.rs b/src/seqvars/prefilter/mod.rs index 0bfa625d..daa280cb 100644 --- a/src/seqvars/prefilter/mod.rs +++ b/src/seqvars/prefilter/mod.rs @@ -2,8 +2,9 @@ use std::io::BufRead; +use futures::TryStreamExt as _; use mehari::annotate::seqvars::ann::AnnField; -use mehari::common::noodles::{open_vcf_reader, open_vcf_writer, AsyncVcfReader, AsyncVcfWriter}; +use mehari::common::noodles::{open_vcf_writer, AsyncVcfWriter, NoodlesVariantReader as _}; use noodles::vcf; use thousands::Separable; use tokio::io::AsyncWriteExt; @@ -140,7 +141,7 @@ fn get_freq_and_distance( /// Perform the actual prefiltration. async fn run_filtration( - input_reader: &mut AsyncVcfReader, + input_reader: &mut mehari::common::noodles::VariantReader, input_header: &vcf::Header, output_writers: &mut [AsyncVcfWriter], output_headers: &[vcf::Header], @@ -149,16 +150,9 @@ async fn run_filtration( let start = std::time::Instant::now(); let mut prev = std::time::Instant::now(); let mut total_written = 0usize; - let mut input_record = vcf::variant::RecordBuf::default(); - loop { - let bytes_read = input_reader - .read_record_buf(input_header, &mut input_record) - .await - .map_err(|e| anyhow::anyhow!("problem reading VCF file: {}", e))?; - if bytes_read == 0 { - break; // EOF - } + let mut records = input_reader.records(input_header).await; + while let Some(input_record) = records.try_next().await? { let (frequency, exon_distance) = get_freq_and_distance(&input_record)?; if let Some(exon_distance) = exon_distance { for ((writer_params, output_writer), output_header) in params @@ -204,7 +198,7 @@ pub async fn run(args_common: &crate::common::Args, args: &Args) -> Result<(), a tracing::info!("loading prefilter params..."); let params_list = load_params(&args.params)?; tracing::info!("opening input file..."); - let mut reader = open_vcf_reader(&args.path_in) + let mut reader = common::noodles::open_vcf_reader(&args.path_in) .await .map_err(|e| anyhow::anyhow!("could not open input file: {}", e))?; let header = reader diff --git a/src/seqvars/query/mod.rs b/src/seqvars/query/mod.rs index 3c174d31..44470c11 100644 --- a/src/seqvars/query/mod.rs +++ b/src/seqvars/query/mod.rs @@ -13,9 +13,10 @@ use clap::{command, Parser}; use ext_sort::LimitedBufferBuilder; use ext_sort::{ExternalSorter, ExternalSorterBuilder}; +use futures::TryStreamExt as _; use itertools::Itertools as _; use mehari::annotate::seqvars::CHROM_TO_CHROM_NO; -use noodles::vcf; +use mehari::common::noodles::NoodlesVariantReader as _; use rand_core::{RngCore, SeedableRng}; use schema::data::{TryFromVcf as _, VariantRecord}; use schema::query::{CaseQuery, GenotypeChoice, RecessiveMode, SampleGenotypeChoice}; @@ -27,7 +28,6 @@ use crate::common; use crate::pbs::varfish::v1::seqvars::output as pbs_output; use crate::pbs::varfish::v1::seqvars::query as pbs_query; use crate::{common::trace_rss_now, common::GenomeRelease}; -use mehari::common::noodles::open_vcf_reader; use self::annonars::Annotator; use self::sorting::{ByCoordinate, ByHgncId}; @@ -271,9 +271,11 @@ async fn run_query( let mut uuid_buf = [0u8; 16]; // Open VCF file, create reader, and read header. - let mut input_reader = open_vcf_reader(&args.path_input).await.map_err(|e| { - anyhow::anyhow!("could not open file {} for reading: {}", args.path_input, e) - })?; + let mut input_reader = common::noodles::open_vcf_reader(&args.path_input) + .await + .map_err(|e| { + anyhow::anyhow!("could not open file {} for reading: {}", args.path_input, e) + })?; let input_header = input_reader.read_header().await?; let path_unsorted = tmp_dir.path().join("unsorted.jsonl"); @@ -289,18 +291,8 @@ async fn run_query( .map(std::io::BufWriter::new) .map_err(|e| anyhow::anyhow!("could not create temporary unsorted file: {}", e))?; - let mut record_buf = vcf::variant::RecordBuf::default(); - loop { - let bytes_read = input_reader - .read_record_buf(&input_header, &mut record_buf) - .await - .map_err(|e| { - anyhow::anyhow!("problem reading VCF file {}: {}", &args.path_input, e) - })?; - if bytes_read == 0 { - break; // EOF - } - + let mut records = input_reader.records(&input_header).await; + while let Some(record_buf) = records.try_next().await? { stats.count_total += 1; let record_seqvar = VariantRecord::try_from_vcf(&record_buf, &input_header) .map_err(|e| anyhow::anyhow!("could not parse VCF record: {}", e))?; diff --git a/src/strucvars/aggregate/cli.rs b/src/strucvars/aggregate/cli.rs index c810006f..9e73347c 100644 --- a/src/strucvars/aggregate/cli.rs +++ b/src/strucvars/aggregate/cli.rs @@ -11,17 +11,19 @@ use std::{ use bio::data_structures::interval_tree::IntervalTree; use clap::{command, Parser}; use futures::TryStreamExt as _; -use mehari::common::io::std::{open_write_maybe_bgzf, read_lines}; +use mehari::common::{ + io::std::{open_write_maybe_bgzf, read_lines}, + noodles::NoodlesVariantReader as _, +}; use serde_json::to_writer; use strum::IntoEnumIterator; use thousands::Separable; use crate::{ - common::{build_chrom_map, trace_rss_now, GenomeRelease, CHROMS}, + common::{self, build_chrom_map, trace_rss_now, GenomeRelease, CHROMS}, strucvars::query::schema::SvType, }; -use mehari::common::noodles::open_vcf_reader; /// Create one file with records for each chromosome and SV type. fn create_tmp_files( @@ -56,14 +58,15 @@ async fn split_input_by_chrom_and_sv_type( let mut count_files = 0; for path_input in &input_vcf_paths { tracing::debug!("parsing {:?}", &path_input); - let mut input_reader = open_vcf_reader(path_input).await?; + let mut input_reader = common::noodles::open_vcf_reader(path_input).await?; let input_header = input_reader.read_header().await?; - let (pedigree, _) = crate::common::extract_pedigree_and_case_uuid(&input_header)?; + let (pedigree, _) = common::extract_pedigree_and_case_uuid(&input_header)?; let mut prev = std::time::Instant::now(); - let mut records = input_reader.records(); let before_parsing = Instant::now(); let mut count_records = 0; + + let mut records = input_reader.records(&input_header).await; while let Some(input_record) = records.try_next().await? { let input_record = super::output::Record::from_vcf( &input_record, @@ -79,6 +82,7 @@ async fn split_input_by_chrom_and_sv_type( let mut tmp_file = tmp_files .get_mut(&(chrom_no, sv_type)) .expect("no file for chrom/sv_type"); + #[allow(clippy::needless_borrows_for_generic_args)] to_writer(&mut tmp_file, &input_record)?; tmp_file.write_all(&[b'\n'])?; @@ -292,7 +296,7 @@ pub struct Args { } /// Main entry point for the `strucvars txt-to-bin` command. -pub async fn run(common_args: &crate::common::Args, args: &Args) -> Result<(), anyhow::Error> { +pub async fn run(common_args: &common::Args, args: &Args) -> Result<(), anyhow::Error> { tracing::info!("Starting `strucvars aggregate`"); tracing::info!(" common_args = {:?}", &common_args); tracing::info!(" args = {:?}", &args); diff --git a/src/strucvars/aggregate/output.rs b/src/strucvars/aggregate/output.rs index 6de05d24..64722d87 100644 --- a/src/strucvars/aggregate/output.rs +++ b/src/strucvars/aggregate/output.rs @@ -5,7 +5,10 @@ use mehari::annotate::strucvars::{ }; use noodles::vcf::{ self, - variant::record::{samples::Sample, AlternateBases as _}, + variant::{ + record::{info::field::key, samples::Sample, AlternateBases as _, Samples as _}, + record_buf::info::field, + }, }; use crate::{ @@ -67,41 +70,31 @@ impl Record { /// Convert VCF record into a `Record`. pub fn from_vcf( - record: &vcf::Record, + record: &vcf::variant::RecordBuf, header: &vcf::Header, _genome_release: crate::common::GenomeRelease, pedigree: &mehari::ped::PedigreeByName, ) -> Result { let chromosome = record.reference_sequence_name().to_string(); let begin = { - let position: usize = record - .variant_start() - .expect("no variant_start?") - .map_err(|e| anyhow::anyhow!("error converting start position: {}", e))? - .into(); + let position: usize = record.variant_start().expect("no variant_start?").into(); position.saturating_sub(1) as i32 }; let chromosome2 = - if let Some(Ok(Some(vcf::variant::record::info::field::Value::String(chromosome2)))) = - record.info().get(header, "chr2") - { + if let Some(Some(field::Value::String(chromosome2))) = record.info().get("chr2") { chromosome2.to_string() } else { chromosome.clone() }; - use noodles::vcf::variant::record::info::field::key; - let end = if let Some(Ok(Some(vcf::variant::record::info::field::Value::Integer(end)))) = - record.info().get(header, key::END_POSITION) - { - end - } else { - anyhow::bail!("missing INFO/END") - }; + let end = + if let Some(Some(field::Value::Integer(end))) = record.info().get(key::END_POSITION) { + end + } else { + anyhow::bail!("missing INFO/END") + }; let sv_type = - if let Some(Ok(Some(vcf::variant::record::info::field::Value::String(sv_type)))) = - record.info().get(header, key::SV_TYPE) - { + if let Some(Some(field::Value::String(sv_type))) = record.info().get(key::SV_TYPE) { sv_type.parse()? } else { anyhow::bail!("missing INFO/SVTYPE") @@ -202,7 +195,7 @@ impl Record { chromosome, begin, chromosome2, - end, + end: *end, pe_orientation, sv_type, carriers_het,