diff --git a/Cargo.lock b/Cargo.lock index b0726dd..bf0ca5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,15 +23,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aho-corasick" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" -dependencies = [ - "memchr", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -96,21 +87,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "anyhow" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayvec" version = "0.5.2" @@ -144,73 +120,6 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" -[[package]] -name = "bio" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07645dcc036557a09cf078268b4666f0ce737bd797b0ee554de29ea81981ab2" -dependencies = [ - "anyhow", - "approx", - "bio-types", - "bit-set", - "bv", - "bytecount", - "csv", - "custom_derive", - "enum-map", - "fxhash", - "getset", - "itertools 0.10.5", - "itertools-num", - "lazy_static", - "multimap", - "ndarray", - "newtype_derive", - "num-integer", - "num-traits", - "ordered-float", - "petgraph", - "rand", - "regex", - "serde", - "serde_derive", - "statrs", - "strum 0.24.1", - "strum_macros 0.24.3", - "thiserror", - "triple_accel", - "vec_map", -] - -[[package]] -name = "bio-types" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa990f40a28735fa598dc3dd58d73e62e6b41458959d623903b927ba7b04c80" -dependencies = [ - "derive-new", - "lazy_static", - "regex", - "strum_macros 0.24.3", - "thiserror", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitflags" version = "1.3.2" @@ -229,22 +138,6 @@ version = "3.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" -[[package]] -name = "bv" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" -dependencies = [ - "feature-probe", - "serde", -] - -[[package]] -name = "bytecount" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" - [[package]] name = "bytemuck" version = "1.13.1" @@ -324,7 +217,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -438,44 +331,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "csv" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "custom_derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" - -[[package]] -name = "derive-new" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "either" version = "1.9.0" @@ -497,26 +352,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-map" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e893a7ba6116821058dec84a6fb14fb2a97cd8ce5fd0f85d5a4e760ecd7329d9" -dependencies = [ - "enum-map-derive", -] - -[[package]] -name = "enum-map-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84278eae0af6e34ff6c1db44c11634a694aafac559ff3080e4db4e4ac35907aa" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "env_logger" version = "0.10.0" @@ -581,12 +416,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "feature-probe" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" - [[package]] name = "fixedbitset" version = "0.4.2" @@ -672,38 +501,17 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", "wasi", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "gimli" version = "0.27.2" @@ -934,15 +742,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.0" @@ -952,15 +751,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools-num" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a872a22f9e6f7521ca557660adb96dd830e54f0f490fa115bb55dd69d38b27e7" -dependencies = [ - "num-traits", -] - [[package]] name = "itoa" version = "1.0.6" @@ -997,12 +787,6 @@ version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - [[package]] name = "linux-raw-sys" version = "0.4.11" @@ -1029,16 +813,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "matrixmultiply" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" -dependencies = [ - "autocfg", - "rawpointer", -] - [[package]] name = "memchr" version = "2.6.3" @@ -1091,44 +865,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "nalgebra" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d506eb7e08d6329505faa8a3a00a5dcc6de9f76e0c77e4b75763ae3c770831ff" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "rand", - "rand_distr", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -1148,34 +884,43 @@ dependencies = [ ] [[package]] -name = "ndarray" -version = "0.15.6" +name = "noodles" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "254ff100d92851724c8b271d6dccd3f21bb7be8438413995d67dcca3f996f2ac" dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", + "noodles-core", + "noodles-fasta", ] [[package]] -name = "newtype_derive" -version = "0.1.6" +name = "noodles-bgzf" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8cd24d9f185bb7223958d8c1ff7a961b74b1953fd05dba7cc568a63b3861ec" +checksum = "7d578e5a173cbfac77295db4188c959966ce24a3364e009d363170d1ed44066a" dependencies = [ - "rustc_version", + "byteorder", + "bytes", + "crossbeam-channel", + "flate2", ] [[package]] -name = "num-complex" -version = "0.4.3" +name = "noodles-core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fbe3192fe33acacabaedd387657f39b0fc606f1996d546db0dfe14703b843a" + +[[package]] +name = "noodles-fasta" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "310dcfb61e8e2cafb65d9da4b329a98a390f2b570c17599a7f4639328cfb3e2c" dependencies = [ - "num-traits", + "bytes", + "memchr", + "noodles-bgzf", + "noodles-core", ] [[package]] @@ -1206,7 +951,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -1263,7 +1007,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -1294,15 +1038,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "ordered-float" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" -dependencies = [ - "num-traits", -] - [[package]] name = "owned_ttf_parser" version = "0.15.2" @@ -1318,12 +1053,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - [[package]] name = "percent-encoding" version = "2.2.0" @@ -1385,30 +1114,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.64" @@ -1457,16 +1162,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand", -] - [[package]] name = "raqote" version = "0.8.2" @@ -1480,12 +1175,6 @@ dependencies = [ "typed-arena", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rayon" version = "1.7.0" @@ -1512,7 +1201,6 @@ dependencies = [ name = "rebar" version = "0.2.0" dependencies = [ - "bio", "chrono", "clap", "color-eyre", @@ -1521,8 +1209,9 @@ dependencies = [ "image", "indicatif", "indoc", - "itertools 0.12.0", + "itertools", "log", + "noodles", "openssl", "petgraph", "rand", @@ -1531,10 +1220,10 @@ dependencies = [ "reqwest", "rustix", "rusttype", - "semver 1.0.19", + "semver", "serde", "serde_json", - "strum 0.25.0", + "strum", "tempfile", "tokio", "zstd", @@ -1549,35 +1238,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "regex" -version = "1.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "reqwest" version = "0.11.18" @@ -1621,15 +1281,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -dependencies = [ - "semver 0.1.20", -] - [[package]] name = "rustix" version = "0.38.25" @@ -1665,15 +1316,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" -[[package]] -name = "safe_arch" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794821e4ccb0d9f979512f9c1973480123f9bd62a90d74ab0f9426fcf8f4a529" -dependencies = [ - "bytemuck", -] - [[package]] name = "schannel" version = "0.1.22" @@ -1712,12 +1354,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" - [[package]] name = "semver" version = "1.0.19" @@ -1741,7 +1377,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -1767,19 +1403,6 @@ dependencies = [ "serde", ] -[[package]] -name = "simba" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b7840f121a46d63066ee7a99fc81dcabbc6105e437cae43528cea199b5a05f" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - [[package]] name = "simd-adler32" version = "0.3.5" @@ -1805,51 +1428,19 @@ dependencies = [ "winapi", ] -[[package]] -name = "statrs" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d08e5e1748192713cc281da8b16924fb46be7b0c2431854eadc785823e5696e" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand", -] - [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - [[package]] name = "strum" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.25.2", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", + "strum_macros", ] [[package]] @@ -1862,7 +1453,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.32", + "syn", ] [[package]] @@ -1871,17 +1462,6 @@ version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac8fb7895b4afa060ad731a32860db8755da3449a47e796d5ecf758db2671d4" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.32" @@ -1906,26 +1486,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1966,7 +1526,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2019,12 +1579,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "triple_accel" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22048bc95dfb2ffd05b1ff9a756290a009224b60b2f0e7525faeee7603851e63" - [[package]] name = "try-lock" version = "0.2.4" @@ -2043,12 +1597,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - [[package]] name = "unicode-bidi" version = "0.3.13" @@ -2093,21 +1641,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" -dependencies = [ - "serde", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "want" version = "0.3.0" @@ -2145,7 +1678,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn", "wasm-bindgen-shared", ] @@ -2179,7 +1712,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2200,16 +1733,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "wide" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd0496a71f3cc6bc4bf0ed91346426a5099e93d89807e663162dc5a1069ff65" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index de42cdb..075d46f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ version = "0.2.0" edition = "2021" [dependencies] -bio = { version = "1.1.0", default-features = false } chrono = { version = "0.4.31", default-features = false, features = ["clock", "serde"] } clap = { version = "4.2.7", default-features = true, features = ["derive", "string"] } color-eyre = { version = "0.6.2", default-features = false } @@ -15,10 +14,11 @@ indicatif = { version = "0.17.5", default-features = false, features = [" indoc = { version = "2.0.4", default-features = false } itertools = { version = "0.12.0", default-features = false, features = ["use_std"] } log = { version = "0.4.17", default-features = false } +noodles = { version = "0.59.0", default-features = false, features = ["core", "fasta"]} openssl = { version = "0.10.60", default-features = false, features = ["vendored"]} petgraph = { version = "0.6.3", default-features = false, features = ["serde-1"] } raqote = { version = "0.8.2", default-features = false, features = ["png"]} -rand = { version = "0.8.5", default-features = false } +rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] } rayon = { version = "1.7.0", default-features = false } reqwest = { version = "0.11.18", default-features = true, features = ["json"] } rustix = { version = "0.38.25", default-features = false } diff --git a/src/dataset/load.rs b/src/dataset/load.rs index c5f9f3e..ec440a9 100644 --- a/src/dataset/load.rs +++ b/src/dataset/load.rs @@ -3,10 +3,12 @@ use crate::dataset::attributes::{Name, Summary, Tag}; use crate::dataset::Dataset; use crate::phylogeny::Phylogeny; use crate::sequence::{read_reference, Sequence, Substitution}; -use bio::io::fasta; -use color_eyre::eyre::{eyre, Report, Result, WrapErr}; +use color_eyre::eyre::{Report, Result}; use log::{info, warn}; +use noodles::fasta; use std::collections::BTreeMap; +use std::fs::File; +use std::io::BufReader; use std::path::Path; // ---------------------------------------------------------------------------- @@ -88,9 +90,8 @@ pub fn parse_populations( Report, > { // read in populations from fasta - let populations_reader = fasta::Reader::from_file(populations_path) - .map_err(|e| eyre!(e)) - .wrap_err(format!("Failed to read file: {populations_path:?}"))?; + let mut reader = + File::open(populations_path).map(BufReader::new).map(fasta::Reader::new)?; // read in reference from fasta let reference = read_reference(reference_path, mask)?; @@ -98,15 +99,16 @@ pub fn parse_populations( let mut populations = BTreeMap::new(); let mut mutations = BTreeMap::new(); - for result in populations_reader.records() { + reader.records().try_for_each(|result| { let record = result?; let sequence = Sequence::from_record(record, Some(&reference), mask)?; populations.insert(sequence.id.clone(), sequence.clone()); - for sub in sequence.substitutions { + sequence.substitutions.into_iter().for_each(|sub| { mutations.entry(sub).or_insert(Vec::new()).push(sequence.id.clone()); - } - } + }); + Ok::<(), Report>(()) + })?; Ok((populations, mutations)) } diff --git a/src/dataset/mod.rs b/src/dataset/mod.rs index 0e4efc0..7b86cbd 100644 --- a/src/dataset/mod.rs +++ b/src/dataset/mod.rs @@ -12,6 +12,7 @@ use color_eyre::eyre::{eyre, Report, Result, WrapErr}; use indoc::formatdoc; use itertools::Itertools; use log::debug; +use noodles::fasta; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::default::Default; @@ -84,13 +85,15 @@ impl Dataset { }) .join(""); - // create bio record - let description = None; - let record = - bio::io::fasta::Record::with_attrs(name, description, consensus.as_bytes()); + // create new fasta record + let definition = fasta::record::Definition::new(name, None); + let sequence = fasta::record::Sequence::from(consensus.as_bytes().to_vec()); + let record = fasta::Record::new(definition, sequence); + // parse and create Sequence record // dataset is already masked, no need let mask = Vec::new(); + let sequence = Sequence::from_record(record, Some(&self.reference), &mask)?; Ok(sequence) diff --git a/src/dataset/sarscov2/phylogeny.rs b/src/dataset/sarscov2/phylogeny.rs index c83857e..e5efe5b 100644 --- a/src/dataset/sarscov2/phylogeny.rs +++ b/src/dataset/sarscov2/phylogeny.rs @@ -1,10 +1,12 @@ use crate::{dataset, phylogeny::Phylogeny, utils::table::Table}; -use bio::io::fasta; use color_eyre::eyre::{eyre, Report, Result, WrapErr}; use color_eyre::Help; use itertools::Itertools; use log::{debug, info, warn}; +use noodles::fasta; use std::collections::BTreeMap; +use std::fs::File; +use std::io::BufReader; use std::path::Path; pub async fn build( @@ -92,19 +94,18 @@ pub async fn build( // read populations fasta, to check if any lineages are missing in notes let populations_path = &summary.populations.local_path; let populations_file_name = populations_path.file_name().unwrap().to_str().unwrap(); - let alignment_reader = fasta::Reader::from_file(populations_path) - .map_err(|e| eyre!(e)) - .wrap_err("Failed to read file: {populations_path:?}")?; + let file = File::open(populations_path); + let mut reader = file.map(BufReader::new).map(fasta::Reader::new)?; // keep track of population names in alignment, cross-reference against // lineage notes + alias_key later let mut alignment_populations = Vec::new(); - for result in alignment_reader.records() { - let record = - result.wrap_err(eyre!("Failed to parse file: {populations_path:?}"))?; - let lineage = record.id().to_string(); + reader.records().try_for_each(|result| { + let record = result.wrap_err(eyre!("Failed to parse fasta record."))?; + let lineage = record.name().to_string(); alignment_populations.push(lineage); - } + Ok::<(), Report>(()) + })?; // ------------------------------------------------------------------------ // Parent Child Relationships diff --git a/src/run/mod.rs b/src/run/mod.rs index 7815b72..5b9195f 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -6,14 +6,14 @@ use crate::recombination; use crate::dataset::{attributes::Name, SearchResult}; use crate::recombination::Recombination; use crate::sequence::Sequence; -use bio::io::fasta; -use color_eyre::eyre::{eyre, Report, Result, WrapErr}; +use color_eyre::eyre::{Report, Result, WrapErr}; use indicatif::{style::ProgressStyle, ProgressBar}; use itertools::Itertools; use log::{debug, info, warn}; +use noodles::fasta; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use std::fs::{create_dir_all, File}; -use std::io::Write; +use std::io::{BufReader, Write}; /// Run rebar on input alignment and/or dataset population(s) pub fn run(args: &mut cli::run::Args) -> Result<(), Report> { @@ -111,11 +111,10 @@ pub fn run(args: &mut cli::run::Args) -> Result<(), Report> { if let Some(alignment) = &args.input.alignment { info!("Loading query alignment: {:?}", alignment); - let alignment_reader = fasta::Reader::from_file(alignment) - .map_err(|e| eyre!(e)) - .wrap_err("Failed to read file: {alignment:?}")?; + let file = File::open(alignment); + let mut reader = file.map(BufReader::new).map(fasta::Reader::new)?; - for result in alignment_reader.records() { + for result in reader.records() { let record = result.wrap_err("Unable to parse alignment: {alignment:?}")?; let sequence = Sequence::from_record(record, Some(&dataset.reference), &args.mask)?; diff --git a/src/sequence/mod.rs b/src/sequence/mod.rs index 3d37fed..f222b30 100644 --- a/src/sequence/mod.rs +++ b/src/sequence/mod.rs @@ -1,11 +1,13 @@ pub mod parsimony; -use bio::io::fasta; -use color_eyre::eyre::{eyre, Report, Result, WrapErr}; +use color_eyre::eyre::{eyre, ContextCompat, Report, Result, WrapErr}; use color_eyre::Help; +use noodles::{core::Position, fasta}; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::default::Default; +use std::fs::File; +use std::io::BufReader; use std::path::Path; use std::str::FromStr; @@ -140,20 +142,35 @@ impl Sequence { } } + /// Parse fasta record into a rebar sequence. pub fn from_record( - record: bio::io::fasta::Record, + record: fasta::Record, reference: Option<&Sequence>, mask: &Vec, ) -> Result { let mut sample = Sequence::new(); - sample.id = record.id().to_string(); - sample.seq = record.seq().iter().map(|b| *b as char).collect(); + + // parse fasta::Record into rebar Sequence + let id = record.name().to_string(); + + // convert sequence to vec of bases, noodle positions are 1-based! + let start = Position::try_from(1).unwrap(); + let seq: Vec = record + .sequence() + .get(start..) + .context(format!("Failed to parse sequence record {}", &sample.id))? + .iter() + .map(|b| *b as char) + .collect(); + let sample_len = seq.len(); + sample.id = id.clone(); + sample.seq = seq; // check mask coord for bases in mask { if *bases > sample.seq.len() { return Err( - eyre!("5' and 3' masking ({mask:?}) is incompatible with sequence length {}", sample.seq.len()) + eyre!("5' and 3' masking ({mask:?}) is incompatible with {id} sequence length {sample_len}") .suggestion("Please change your --mask parameter.") .suggestion("Maybe you want to disable masking all together with --mask 0,0 ?") ); @@ -161,15 +178,11 @@ impl Sequence { } if let Some(reference) = reference { - if sample.seq.len() != reference.seq.len() { + let ref_len = reference.seq.len(); + if sample_len != ref_len { return Err( - eyre!( - "Reference sequence ({ref_len}) and {record_id} ({record_len}) are different lengths!", - ref_len=reference.seq.len(), - record_id=sample.id, - record_len=sample.seq.len(), - ) - .suggestion("Are you sure your --alignment is aligned correctly?") + eyre!("Reference and {id} are different lengths ({ref_len} vs {sample_len})!") + .suggestion(format!("Are you sure {id} is aligned correctly?")) ); } sample.genome_length = reference.seq.len(); @@ -234,7 +247,7 @@ impl Sequence { /// Read first record of fasta path into sequence record. pub fn read_reference(path: &Path, mask: &Vec) -> Result { // start reading in the reference as fasta, raise error if file doesn't exist - let reader = fasta::Reader::from_file(path).expect("Unable to read reference"); + let mut reader = File::open(path).map(BufReader::new).map(fasta::Reader::new)?; // parse just the first record from the reference // 1. raise error if record iterator doesn't work