You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NuXLDeisotoper: precursor mass uses PROTON_MASS (kg) and rejects unknown-charge precursors #10232
NuXLDeisotoper::deisotopeAndSingleCharge is a copy of Deisotoper::deisotopeAndSingleCharge and still has the two precursor-mass bugs that were fixed in Deisotoper itself by #10073 and #10075.
Bug 1 — an unknown precursor charge enables the mass constraint with mass 0
getCharge() == 0 means the precursor charge is unknown (see Precursor.h). With charge 0, precursor_mass stays 0 but has_precursor_data is still set to true, so the precursor mass constraint is enabled with a neutral mass of 0 and every fragment cluster is rejected as too heavy — the opposite of what an unknown charge should do (skip the constraint, as Deisotoper now does).
Bug 2 — Constants::PROTON_MASS is in kg, not Da
Every neutral-mass computation in the file (the precursor mass above, and the theoretical mass of each candidate isotope cluster, twice) subtracts Constants::PROTON_MASS, which is the proton mass in kg (Constants::PROTON_MASS_U is the one in Da/u — the unit every other mass in this function is in). So every computed mass is off by about 1 u per charge, and the mass constraint compares two values that are each wrong by a different, charge-dependent amount.
Impact
Both bugs affect OpenNuXL's deisotoping step for RNA-protein crosslink search, whenever a spectrum carries precursor charge/mass information — precursor clusters and candidate fragment clusters can be wrongly rejected or accepted.
Fix
PR incoming, mirroring the fix already applied to Deisotoper (#10073, #10075): only enable the precursor mass constraint when the charge is known, and use PROTON_MASS_U.
Activity
jpfeuffer commentedon Sep 22, 2026
Why is it even duplicated? How about subclassing or something?