Repository navigation
[FIX] TOPPView: opening an identification file in a window of its own crashed - #10701
Conversation
… crashed An identification layer has RT and m/z but no intensities. In a window of its own (an idXML or mzIdentML without a spectrum file to annotate) it is the only layer, so the intensity range of the canvas stayed empty and PlotCanvas::recalculateRanges_() threw Exception::InvalidRange from getMinIntensity(). Nothing caught it, so TOPPView aborted. Without intensities, the canvas now has the intensity range [0, 1] (the dot gradient and the snap and percentage factors read it too). Test: TOPPView_test opens an idXML without a spectrum file; it fails with InvalidRange without the fix. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
…nges natively - TOPPView_test: develop's test of an identification file in a window of its own (#10701) is kept next to testIdentifications and counts the identifications of the layer's identification data. Its peptide identifications get a q-value score type: TOPPView loads identification files into identification data, whose import needs the score type of every peptide identification with hits (documented in identification-data.md). - TextExporter: develop's USI mapper (#10593) is built from the exported protein runs of the consensus map. - ProteinGroupArrowExport_test, ConsensusMapArrowExport_test: develop's q-value sections (#10700, #10708) set the protein runs through the identification data converter instead of the removed map accessors. - bind_misc: the docstring of Bayesian inference on consensus maps names the protein run requirement without the removed accessor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B51nRFoHvZuVXD7cT8XZav
Problem
Opening an idXML or mzIdentML file in TOPPView aborts the program when the file gets a window of its own. That happens when no spectrum file for annotation is found or the annotation prompt is declined.
An identification layer has RT and m/z but no intensities (
LayerDataIdent::getRange()). When it is the only layer of the window, the intensity range of the canvas stays empty.PlotCanvas::recalculateRanges_()then callsgetMinIntensity(), which throwsException::InvalidRange("Empty or uninitalized range object"):Nothing catches the exception, so TOPPView ends with "FATAL: uncaught exception!" and SIGABRT. Opened on top of a peak map, the identifications are fine, because the peak layer provides the intensities.
Fix
If no layer has intensities,
PlotCanvas::recalculateRanges_()gives the canvas the intensity range [0, 1]. Guarding onlygetMinIntensity()is not enough: the dot gradient (Plot2DCanvas::recalculateDotGradient_()) and the snap and percentage factors read the maximum intensity next. Before this change, this case always threw, so no other case behaves differently.Test
TOPPView_test::testIdentificationFilewrites an idXML without a spectrum file next to it and opens it withaddDataFile(). It then checks that:Without the fix, the test fails with the
InvalidRangeabove, reproduced on develop at2e3ea32d11. With the fix,TOPPView_test,TSGDialog_testand the visual class tests pass, run offscreen (QT_QPA_PLATFORM=offscreen).Generated by Claude Code
Summary by CodeRabbit