Skip to content
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

Merged

Conversation

sophiamersmann
Copy link
Contributor

If an isotope error is given (e.g. when using the search engine MSGF+), the calulated mass is corrected by subtracting (isotopeError * protonMass) / charge.

@jpfeuffer
Copy link
Contributor

Related to #3466

@@ -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;
Copy link
Contributor

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

@timosachsenberg
Copy link
Contributor

timosachsenberg commented Jul 6, 2018

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)
edit:
hmm did not find a meta value for comet. We might need to check if this is written out.

@timosachsenberg
Copy link
Contributor

Hmm did not find the meta value for comet. Can check tomorrow, maybe we don’t parse it?

@timosachsenberg
Copy link
Contributor

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

@timosachsenberg
Copy link
Contributor

I am not 100% sure that the caluclation is correct.
calc_mass as in this code does not need any isotopic correction as it is calculated from the theoretical composition. The actual istopic misassignment error is on the experimental precursor mass.

@sophiamersmann
Copy link
Contributor Author

You are absolutely right about calc_mass / exp_mass. I updated the code - exp_mass is now corrected rather than calc_mass.

@sophiamersmann
Copy link
Contributor Author

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/

@sophiamersmann
Copy link
Contributor Author

I will need to check if different search engines use the same MetaValue key and numbering scheme.


if (hit.metaValueExists("IsotopeError"))
{
float isoErr = stof(hit.getMetaValue("IsotopeError").toString());
Copy link
Contributor

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)

@timosachsenberg timosachsenberg merged commit 6e82634 into OpenMS:develop Jul 10, 2018
@sophiamersmann sophiamersmann deleted the fix/correct_observed_mass branch July 11, 2018 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants