diff --git a/src/core/src/index/linear.rs b/src/core/src/index/linear.rs index 489e69c86e..6f833b7fca 100644 --- a/src/core/src/index/linear.rs +++ b/src/core/src/index/linear.rs @@ -183,7 +183,6 @@ impl LinearIndex { let intersect_bp: u64 = match_mh.scaled() as u64 * intersect_orig; let f_unique_to_query = intersect_orig as f64 / query.size() as f64; - let match_ = match_sig; // TODO: all of these let f_unique_weighted = 0.; @@ -217,7 +216,6 @@ impl LinearIndex { filename, name, md5, - match_, f_match_orig, unique_intersect_bp, gather_result_rank, diff --git a/src/core/src/index/mod.rs b/src/core/src/index/mod.rs index 0bd9d9fec8..c894d1c02b 100644 --- a/src/core/src/index/mod.rs +++ b/src/core/src/index/mod.rs @@ -65,9 +65,6 @@ pub struct GatherResult { #[getset(get = "pub")] md5: String, - #[serde(skip)] - match_: SigStore, - #[getset(get_copy = "pub")] f_match_orig: f64, @@ -118,12 +115,6 @@ pub struct GatherResult { max_containment_ani: f64, } -impl GatherResult { - pub fn get_match(&self) -> Signature { - self.match_.clone().into() - } -} - type SigCounter = counter::Counter; pub trait Index<'a> { @@ -219,8 +210,11 @@ pub fn calculate_gather_stats( calc_ani_ci: bool, confidence: Option, ) -> Result<(GatherResult, (Vec, u64))> { + let match_filename = match_sig.filename(); + let match_name = match_sig.name(); + let match_md5 = match_sig.md5sum(); // get match_mh - let match_mh = match_sig.minhash().expect("cannot retrieve sketch"); + let match_mh: KmerMinHash = match_sig.try_into()?; // it's ok to downsample match, but query is often big and repeated, // so we do not allow downsampling of query in this function. @@ -330,10 +324,9 @@ pub fn calculate_gather_stats( .average_abund(average_abund) .median_abund(median_abund) .std_abund(std_abund) - .filename(match_sig.filename()) - .name(match_sig.name()) - .md5(match_sig.md5sum()) - .match_(match_sig) + .filename(match_filename) + .name(match_name) + .md5(match_md5) .f_match_orig(f_match_orig) .unique_intersect_bp(unique_intersect_bp) .gather_result_rank(gather_result_rank)