-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/score-type #144
Feature/score-type #144
Conversation
crates/sage/src/scoring.rs
Outdated
@@ -156,12 +163,45 @@ fn lnfact(n: u16) -> f64 { | |||
} | |||
} | |||
|
|||
fn log_factorial(n: u16, k: u16) -> f64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use this instead of the ln_fact function? If I wanted to calculate a precise log factorial instead of an approximation, I would already be doing so :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to stay true to the original implementation, but it should be equivalent to using the ln_fact
function with approximation instead, replaced it accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a big difference, we can generate a pre-computed lookup table and use that.
crates/sage/src/scoring.rs
Outdated
impl Score { | ||
/// Calculate the hyperscore for a given PSM choosing between implementations based on `score_type` | ||
fn hyperscore(&self, score_type: ScoreType) -> f64 { | ||
match score_type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match expression is unnecessary here, you can simply write score_type.score(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the changes. I will test it out!
I will work on getting this rebased and merged today. Next time, please don't merge in the master branch - makes it harder to clean up and fix later :) |
9014727
to
2e2bb14
Compare
Makes sense, thanks! |
This PR draft provides a slightly modified version of hyperscore as it can be found in the OpenMS repository, details in #139.