Skip to content

Commit

Permalink
Merge pull request #56 from anergictcell/fix/bma-bwa
Browse files Browse the repository at this point in the history
fix: Fixes typo in SimilarityCombiner (BWA --> BMA)
  • Loading branch information
anergictcell authored Mar 30, 2024
2 parents 6497b9e + bb34a2c commit 6780277
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/similarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub enum StandardCombiner {
/// funSimMax algorithm from [Schlicker A, et. al., BMC Bioinf (2006)](https://pubmed.ncbi.nlm.nih.gov/16776819/)
FunSimMax,
/// BMA algorithm from [Wang JZ, et. al., Bioinformatics (2007)](https://pubmed.ncbi.nlm.nih.gov/17344234/)
Bwa,
Bma,
}

impl Default for StandardCombiner {
Expand All @@ -212,7 +212,7 @@ impl TryFrom<&str> for StandardCombiner {
match value.to_lowercase().as_str() {
"funsimavg" => Ok(StandardCombiner::FunSimAvg),
"funsimmax" => Ok(StandardCombiner::FunSimMax),
"bwa" => Ok(StandardCombiner::Bwa),
"bma" => Ok(StandardCombiner::Bma),
_ => Err(HpoError::NotImplemented),
}
}
Expand All @@ -237,7 +237,7 @@ impl StandardCombiner {
(row_maxes.iter().sum::<f32>() / rows).max(col_maxes.iter().sum::<f32>() / cols)
}

fn bwa(self, m: &Matrix<f32>) -> f32 {
fn bma(self, m: &Matrix<f32>) -> f32 {
let (rows, cols) = self.dim_f32(m);
let row_maxes = self.row_maxes(m);
let col_maxes = self.col_maxes(m);
Expand All @@ -251,7 +251,7 @@ impl SimilarityCombiner for StandardCombiner {
match self {
StandardCombiner::FunSimAvg => self.fun_sim_avg(m),
StandardCombiner::FunSimMax => self.fun_sim_max(m),
StandardCombiner::Bwa => self.bwa(m),
StandardCombiner::Bma => self.bma(m),
}
}
}
Expand Down

0 comments on commit 6780277

Please sign in to comment.