Skip to content

Commit

Permalink
remove match_
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Oct 14, 2024
1 parent c5d3623 commit 00cbecf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 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 = (match_mh.scaled() * intersect_orig) as usize;

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
22 changes: 7 additions & 15 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,15 +210,17 @@ pub fn calculate_gather_stats(
calc_ani_ci: bool,
confidence: Option<f64>,
) -> Result<GatherResult> {
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()?;

let max_scaled = max(match_mh.scaled(), query.scaled());
let query = query
.downsample_scaled(max_scaled)
.expect("cannot downsample query");
let match_mh = match_mh
.clone()
.downsample_scaled(max_scaled)
.expect("cannot downsample match");

Expand Down Expand Up @@ -327,10 +320,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 00cbecf

Please sign in to comment.