forked from OpenMS/OpenMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Auto irt #6
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
Open
jcharkow
wants to merge
9
commits into
develop
Choose a base branch
from
auto_irt
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is not tested yet. Also compute the standard deviation at the end from the predicted amount which will be used as the extraction window for the non linear calibration.
fix runtime bugs. have a working implementation of the linear auto irt refinement!
jcharkow
commented
Aug 4, 2025
Comment on lines
+270
to
+301
| std::vector<double> predicted_values(pairs_corrected.size()); // these are the predicted values by applying the trafo on the values | ||
| std::vector<double> delta_true_predicted(pairs_corrected.size()); // these are the differences between the predicted and the true values | ||
| double sum_rt_differences = 0.0; | ||
| TransformationDescription trafo_inverse = trafo_out; | ||
| trafo_inverse.invert(); | ||
| for (size_t i = 0; i < pairs_corrected.size(); ++i) | ||
| { | ||
| predicted_values[i] = trafo_out.apply(pairs_corrected[i].first); | ||
| delta_true_predicted[i] = pairs_corrected[i].first - predicted_values[i]; | ||
| sum_rt_differences += delta_true_predicted[i]; // sum for computing the mean | ||
| OPENMS_LOG_DEBUG << "True - Predicted value: " << pairs_corrected[i].second << " " << predicted_values[i] << std::endl; | ||
| } | ||
| double mean_rt_difference = sum_rt_differences / delta_true_predicted.size(); | ||
|
|
||
| // compute the variance | ||
| double rt_variance = 0.0; | ||
| for (double delta: delta_true_predicted) | ||
| { | ||
| rt_variance += (delta - mean_rt_difference) * (delta - mean_rt_difference); | ||
| } | ||
| rt_variance /= delta_true_predicted.size(); | ||
| double rt_stdev = sqrt(rt_variance); | ||
| double rt_extraction_window = rt_stdev * 3.0 * 2; // 3 times the standard deviation, doubled since the window is the full length (not half) | ||
| std::cout << "RT variance: " << rt_stdev << std::endl; | ||
| std::cout << "RT Extraction Window to Use: " << rt_extraction_window << std::endl; | ||
|
|
||
|
|
||
| std::cout << "End of doDataNormalization_ method" << std::endl; | ||
|
|
||
| trafo_out.printSummary(std::cout); | ||
| } | ||
| { |
Owner
Author
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.
@singjc this is what I did for estimating RT calibration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI builds