From 9195f7c86b3c11819e786ba9ed162eb4bdfddfc3 Mon Sep 17 00:00:00 2001 From: "N. Tessa Pierce-Ward" Date: Mon, 6 Jan 2025 13:37:16 -0800 Subject: [PATCH] use sigstrait isntead --- Cargo.lock | 3 ++- Cargo.toml | 3 +-- src/utils/buildutils.rs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79dcc9e8..02967f67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1773,7 +1773,8 @@ checksum = "bceb57dc07c92cdae60f5b27b3fa92ecaaa42fe36c55e22dbfb0b44893e0b1f7" [[package]] name = "sourmash" version = "0.18.0" -source = "git+https://github.com/sourmash-bio/sourmash.git?branch=add-nhashes#d293d2dd8c19f0e8012689d20e1990f3d42d86a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fec589a91cf0d7d8cde46a51ccf165f32b9b4d709688f69b3fcea14c6f12e6e6" dependencies = [ "az", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index e33f21c9..c68f67b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,7 @@ crate-type = ["cdylib"] pyo3 = { version = "0.23.3", features = ["extension-module", "anyhow"] } rayon = "1.10.0" serde = { version = "1.0.217", features = ["derive"] } -#sourmash = { version = "0.18.0", features = ["branchwater"] } -sourmash = { git = "https://github.com/sourmash-bio/sourmash.git", branch = "add-nhashes", features = ["branchwater"] } +sourmash = { version = "0.18.0", features = ["branchwater"] } serde_json = "1.0.134" niffler = "2.4.0" log = "0.4.22" diff --git a/src/utils/buildutils.rs b/src/utils/buildutils.rs index 035e28de..cdf26a5e 100644 --- a/src/utils/buildutils.rs +++ b/src/utils/buildutils.rs @@ -12,6 +12,7 @@ use sourmash::errors::SourmashError; use sourmash::manifest::Record; use sourmash::selection::Selection; use sourmash::signature::Signature; +use sourmash::signature::SigsTrait; use std::collections::HashMap; use std::collections::HashSet; use std::fmt::Display; @@ -889,7 +890,7 @@ impl BuildCollection { record.set_filename(Some(filename.clone())); record.set_md5(Some(sig.md5sum())); record.set_md5short(Some(sig.md5sum()[0..8].into())); - record.set_n_hashes(Some(sig.n_hashes())); + record.set_n_hashes(Some(sig.minhash().map(|mh| mh.size()).unwrap_or(0))); // note, this needs to be set when writing sigs (not here) // record.set_internal_location("")