Skip to content

Commit

Permalink
remove match_
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Nov 12, 2024
1 parent 11cab80 commit 4841d43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/core/src/index/linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.;
Expand Down Expand Up @@ -217,7 +216,6 @@ impl LinearIndex {
filename,
name,
md5,
match_,
f_match_orig,
unique_intersect_bp,
gather_result_rank,
Expand Down
21 changes: 7 additions & 14 deletions src/core/src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ pub struct GatherResult {
#[getset(get = "pub")]
md5: String,

#[serde(skip)]
match_: SigStore,

#[getset(get_copy = "pub")]
f_match_orig: f64,

Expand Down Expand Up @@ -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<Idx>;

pub trait Index<'a> {
Expand Down Expand Up @@ -219,8 +210,11 @@ pub fn calculate_gather_stats(
calc_ani_ci: bool,
confidence: Option<f64>,
) -> Result<(GatherResult, (Vec<u64>, 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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4841d43

Please sign in to comment.