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
[FIX] Correction of the observed mass if isotope error is given #3601
[FIX] Correction of the observed mass if isotope error is given #3601
Conversation
Related to #3466 |
src/topp/PercolatorAdapter.cpp
Outdated
@@ -415,6 +416,10 @@ class PercolatorAdapter : | |||
String unmodified_sequence = hit.getSequence().toUnmodifiedString(); | |||
|
|||
double calc_mass = hit.getSequence().getMonoWeight(Residue::Full, charge)/charge; | |||
if (hit.metaValueExists("IsotopeError")) { | |||
float isoErr = hit.getMetaValue("IsotopeError"); | |||
calc_mass = calc_mass - (isoErr * Constants::PROTON_MASS_U) / charge; |
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.
C13C12_MASSDIFF_U usually fits slightly better to the isotopic mass distances
thanks! did you check if different search engines: e.g., Comet, MSGFPlus and our SimpleSearchEngine write use the same MetaValue key? and also numbering scheme (e.g., one could use 1, the other -1) |
Hmm did not find the meta value for comet. Can check tomorrow, maybe we don’t parse it? |
we also use "isotope_error" error and use 0 for the monoisotopic peak and 1 if the experimental precursor annotation points to the first isotopic peak |
I am not 100% sure that the caluclation is correct. |
You are absolutely right about calc_mass / exp_mass. I updated the code - exp_mass is now corrected rather than calc_mass. |
Here are two histograms that show the feature DM (delta mass: difference between the experimental and theoretical mass) before and after the correction for MSGF+ search results: https://sophiamersmann.github.io///2018/07/10/isotope-error-correction/ |
I will need to check if different search engines use the same MetaValue key and numbering scheme. |
src/topp/PercolatorAdapter.cpp
Outdated
|
||
if (hit.metaValueExists("IsotopeError")) | ||
{ | ||
float isoErr = stof(hit.getMetaValue("IsotopeError").toString()); |
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.
stof uses the current locale and might thus not work for files produced on a system with a different locale.
use the toString().toFloat() instead (if toFloat() doesn't work)
If an isotope error is given (e.g. when using the search engine MSGF+), the calulated mass is corrected by subtracting
(isotopeError * protonMass) / charge
.