From 72d204422a4bc7747f0278db324e7caacb6bb4de Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Tue, 15 Oct 2024 13:19:36 -0400 Subject: [PATCH] fix merge mistakes --- src/core/src/index/mod.rs | 1 - src/core/src/index/revindex/disk_revindex.rs | 14 +++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/src/index/mod.rs b/src/core/src/index/mod.rs index 306f479489..8ed7f63e07 100644 --- a/src/core/src/index/mod.rs +++ b/src/core/src/index/mod.rs @@ -17,7 +17,6 @@ use getset::{CopyGetters, Getters, Setters}; use log::trace; use serde::{Deserialize, Serialize}; use stats::{median, stddev}; -use std::cmp::max; use typed_builder::TypedBuilder; use crate::ani_utils::{ani_ci_from_containment, ani_from_containment}; diff --git a/src/core/src/index/revindex/disk_revindex.rs b/src/core/src/index/revindex/disk_revindex.rs index ba5720881f..7386e9ebbd 100644 --- a/src/core/src/index/revindex/disk_revindex.rs +++ b/src/core/src/index/revindex/disk_revindex.rs @@ -395,12 +395,20 @@ impl RevIndexOps for RevIndex { let match_sig = self.collection.sig_for_dataset(dataset_id)?; let match_mh = match_sig.minhash().unwrap().clone(); - let scaled = query.scaled(); + + // make downsampled minhashes + let max_scaled = max(match_mh.scaled(), query.scaled()); let match_mh = match_mh - .downsample_scaled(scaled) + .downsample_scaled(max_scaled) .expect("cannot downsample match"); ->>>>>>> 7d111732d66faa0f957f7612d39f50e0d05aff01 + + // repeatedly downsample query, then extract to KmerMinHash + // => calculate_gather_stats + query = query + .downsample_scaled(max_scaled) + .expect("cannot downsample query"); + let query_mh = KmerMinHash::from(query.clone()); // just calculate essentials here let gather_result_rank = matches.len();