Repository navigation
Add Thermo RAW input support to seven TOPP tools - #9418
Conversation
Build on the in-process ThermoRawFile reader (PR #9389) to accept .raw input directly in tools that previously gained Bruker .d support: - SimpleSearchEngine, ProSE, ProteomicsLFQ: add FileTypes::RAW to the FileHandler::loadExperiment allowed_types — .raw routes through the existing mzML processing path (no IM-specific code needed). - CometAdapter, SageAdapter: load .raw via FileHandler, write temp mzML for the external search engine. CometAdapter skips native-ID rewriting (Thermo scan=N is monotonic, unlike Bruker frame=F scan=S). SageAdapter preserves original .raw paths in PrimaryMSRunPath. - FileConverter: add RawToMzML:reader=external|inprocess parameter. Inprocess path falls through to the generic output writer, allowing conversion to any supported format (not just mzML) and enabling side-by-side comparison with the external ThermoRawFileParser. - OpenSwathWorkflow: new SwathFile::loadFromMSExperiment() builds SwathMaps directly from a pre-loaded MSExperiment, avoiding a temp mzML round-trip. Dispatched from OpenSwathBase for .raw input. Format guards harmonised across tools: WITH_OPENTIMS around "d" and WITH_THERMO_RAW around "raw" in setValidFormats_ everywhere (previously inconsistent — only CometAdapter guarded "d"). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds SwathFile::loadFromMSExperiment to build SWATH maps from an in-memory PeakMap and wires conditional Thermo RAW support into SWATH loading, search algorithms, and TOPP tools with per-tool RAW→mzML preprocessing and format-registration fixes. ChangesThermo RAW Loading and Format Support
Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/topp/SageAdapter.cpp`:
- Around line 582-595: The code currently replaces Thermo RAW inputs with temp
mzML files and stores a map sage_tmp_basename_to_original, but later code (the
block that sets PrimaryMSRunPath back to the original .raw paths) runs before
the mzML-based post-search native-ID/FAIMS metadata repair and breaks lookups
that expect temp mzML basenames; fix by deferring restoration of
PrimaryMSRunPath until after all mzML post-processing finishes
(post-search/repair stage), or alternatively keep the temp-mzML→original mapping
and update the lookup logic used in the native-ID/FAIMS repair to consult
sage_tmp_basename_to_original (or use input_files’ temp basenames) so the repair
routines use the temp mzML basenames for lookups while still allowing final
output paths to be set back to the original raw names.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ee29a626-7164-419a-b92f-afb09e55c73f
📒 Files selected for processing (12)
src/openms/include/OpenMS/FORMAT/SwathFile.hsrc/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppsrc/openms/source/ANALYSIS/ID/SimpleSearchEngineAlgorithm.cppsrc/openms/source/APPLICATIONS/OpenSwathBase.cppsrc/openms/source/FORMAT/SwathFile.cppsrc/topp/CometAdapter.cppsrc/topp/FileConverter.cppsrc/topp/OpenSwathWorkflow.cppsrc/topp/ProSE.cppsrc/topp/ProteomicsLFQ.cppsrc/topp/SageAdapter.cppsrc/topp/SimpleSearchEngine.cpp
…sing
The early restoration of PrimaryMSRunPath (temp mzML → original .raw)
ran before the native-ID repair and FAIMS annotation blocks. Those
blocks compare File::basename(idxToFile[...]) against keys in
file2specnr2nativeid, which are temp mzML basenames built from
input_files. With the original .raw basenames in idxToFile, lookups
silently failed and neither repair nor FAIMS annotation ran for .raw
inputs.
Keep temp mzML paths in PrimaryMSRunPath throughout post-processing
so basename lookups succeed, then translate back to original .raw paths
just before storeIdentifications. Also change the filenames fallback
to use input_files instead of getStringList_("in") — equivalent for
mzML/.d inputs, correct for .raw.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…tools (#9418) (#9421) Add per-tool changelog entries for PR #9418 which extends direct .raw file input (via the in-process ThermoRawFile reader introduced in #9389) to seven TOPP tools: - CometAdapter: in-process load + temp mzML; no native-ID rewriting needed - ProSE: direct .raw accepted for all search modes - SimpleSearchEngine: .raw via FileHandler::loadExperiment - ProteomicsLFQ: .raw alongside .mzML and .d - FileConverter: new RawToMzML:reader=external|inprocess parameter - SageAdapter: in-process load + temp mzML; original paths in PrimaryMSRunPath - OpenSwathWorkflow: new SwathFile::loadFromMSExperiment() avoids temp mzML round-trip All entries note the WITH_THERMO_RAW=ON requirement. Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
…and macOS (#10274) * [FIX] FileConverter: read Thermo .raw in-process by default 'FileConverter -in x.raw -out x.mzML' failed with exit code 14 in the 3.6.0 packages. RawToMzML:reader defaulted to 'external', which needs ThermoRawFileParser.exe on the PATH and, on Linux and macOS, mono. The packages provide neither: the DEB installs the .exe under share/OpenMS/THIRDPARTY and does not depend on mono. Yet every WITH_THERMO_RAW build contains the in-process reader, and that is now the default on all platforms. The 'external' default dates from #9418, when WITH_THERMO_RAW was still OFF by default, and nobody revisited it when #10206 switched it on everywhere. Builds with the in-process reader now default to it. 'external' stays available, and stays the default without WITH_THERMO_RAW. ThermoRawFile keeps profile scans by default, while ThermoRawFileParser applies vendor peak picking unless --noPeakPicking is given. Switching only the default would silently turn FileConverter's centroided output into profile data (ginkgotoxin-ms-switching.raw: 174162 instead of 11813 peaks). So the in-process path now honours -RawToMzML:no_peak_picking and -RawToMzML:include_noise through ThermoRawFile::Options, which #10077 added after the reader option. Only -RawToMzML:no_zlib_compression still warns that it is ignored. FileHandler cannot pass these options, so FileConverter calls ThermoRawFile directly, as it already does for BrukerTimsFile, and records the source directory as the file URI that FileHandler wrote. With -RawToMzML:no_peak_picking the output equals the previous '-RawToMzML:reader inprocess' output apart from the recorded parameters. The in-process reader needs a .NET 8 runtime, which the Windows installer does not bundle. There, the old default ran the bundled ThermoRawFileParser on the built-in .NET Framework. Windows users now need .NET 8 or '-RawToMzML:reader external'. So do pipelines that set -RawToMzML:ThermoRaw_executable. The CHANGELOG entry says so. Tests: TOPP_FileConverter_RAW_default_reader pins the default in the written INI. TOPP_FileConverter_RAW_1 converts the Thermo fixture with the default reader and checks that every spectrum is centroided; it runs where THERMO_RAW_TEST_DATA is available. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * FileConverter: say how to get the external Thermo reader back CodeRabbit's review of this PR notes that a machine without .NET 8 now fails with the default reader and gets no hint about the fix. Without the runtime, the in-process reader reports only "get_hostfxr_path failed: .NET runtime not found in standard locations. Set DOTNET_ROOT ...". It mentions neither .NET 8 nor -RawToMzML:reader external. When the in-process reader fails to read a file, FileConverter now first logs that the reader needs the .NET 8 runtime, and that if the runtime is missing, the user can install it or pass '-RawToMzML:reader external'. The error and exit code are unchanged. It does not fall back on its own, because the two readers do not write identical mzML. Checked with a FileConverter built from this branch against the nightly libraries. ginkgotoxin-ms-switching.raw still converts with .NET 8 (32 spectra). With /usr/lib/dotnet hidden, the hint is printed before the error and the exit code stays 3. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * FileConverter: warn when an external-reader executable is set in-process With the in-process default, a pipeline that still sets -RawToMzML:ThermoRaw_executable or -RawToMzML:NET_executable switches readers without a word, and the two readers write different mzML. FileConverter now warns for either option when it differs from its default, as it already does for -RawToMzML:no_zlib_compression. The check reads the raw parameter values: getStringOption_() looks executables up on the PATH and throws when they are missing, which would break the in-process conversion that needs neither. The ThermoRawFileParser default is named once, for the option and the check. The TOPP CMakeLists now says that the Thermo fixture tests only run with -DENABLE_THERMO_RAW_TESTS=ON, which is off by default and in the CI presets. Both come from the review of #10274. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * FileConverter: keep the external Thermo reader as the Windows default The in-process reader needs a .NET 8 runtime, which the Windows installer does not bundle. The external reader works there as installed: the installer puts THIRDPARTY\ThermoRawFileParser on the PATH, and ThermoRawFileParser.exe runs on the .NET Framework that Windows includes. On Linux and macOS the packages provide neither mono nor ThermoRawFileParser on the PATH, so the in-process reader stays the default there. TOPP_FileConverter_RAW_default_reader expects 'external' on Windows. TOPP_FileConverter_RAW_1 selects the in-process reader explicitly, since it checks that reader's vendor peak picking. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * [DOC] CHANGELOG: the in-process Thermo reader needs DOTNET_ROOT for a non-standard .NET nethost looks for the runtime only through DOTNET_ROOT and the global install location. On a hosted macOS runner, whose .NET is in ~/.dotnet, the in-process reader of the 2026-09-24 package failed with "get_hostfxr_path failed: .NET runtime not found in standard locations" although .NET 8, 9 and 10 were installed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 --------- Co-authored-by: Claude <[email protected]>
Summary
Builds on #9389 (in-process ThermoRawFile reader) to accept
.rawinput directly in seven TOPP tools. Each tool is wired in the way that fits its existing.dpath — no temp-mzML round-trip where it can be avoided.FileTypes::RAWtoFileHandler::loadExperimentallowed_types —.rawroutes through the existing mzML path; no IM-specific code neededFileHandler→ temp mzML → Comet. No native-ID rewriting needed (Thermoscan=Nis monotonic, unlike Brukerframe=F scan=S).raw→ temp mzML → external Sage; restore original.rawpaths inPrimaryMSRunPathRawToMzML:reader=external|inprocessparameter.inprocessfalls through to the generic output writer (any output format, not just mzML), enabling side-by-side comparison with the external ThermoRawFileParserSwathFile::loadFromMSExperiment()builds SwathMaps directly from a pre-loadedMSExperiment— avoids the disk round-trip the temp-mzML approach would impose. Dispatched fromOpenSwathBasefor.rawinputNotes
#ifdef WITH_OPENTIMSaround"d",#ifdef WITH_THERMO_RAWaround"raw"in everysetValidFormats_. Previously only CometAdapter guarded"d".FileTypes::RAWis always defined as an enum, soallowed_typesvectors don't need ifdefs —FileHandler::loadExperimentgates dispatch internally.PeakPickerIMwas deliberately not modified — it requires ion-mobility data, which Thermo.rawdoes not carry.Test plan
WITH_THERMO_RAW=ONand run each tool against a Thermo.rawtest file (e.g.Angiotensin_AllScans.raw)WITH_THERMO_RAW=OFFand verify clean compilation + that--helpdoes not listrawas a valid input formatspectrum_referencevalues in output use the originalscan=Nform (no rewriting corruption)PrimaryMSRunPathin the output references the original.rawpath, not the temp mzMLRawToMzML:reader=externalvsRawToMzML:reader=inprocessmzML outputs for feature parity.rawand verify SWATH window discovery matches a mzML-converted control🤖 Generated with Claude Code
Summary by CodeRabbit