Repository navigation
experimental opentims integration - #8975
Merged
Merged
Conversation
…_bridge Covers DDA-PASEF, DIA-PASEF, and raw frame-level 4D access with FileConverter integration, CMake FetchContent acquisition, and streaming support via IMSDataConsumer. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Use qualified Interfaces::IMSDataConsumer type - Fix IM FloatDataArray: use IMDataConverter::setIMUnit() with DriftTimeUnit::VSSC (name "raw inverse reduced ion mobility array", CV MS:1003008) instead of incorrect "Ion Mobility" + MS:1002815 - Fix typeToMZML string to PSI-MS term "Bruker TDF format" - Add FileConverter low-memory branch extension for BRUKER_TDF - Add directory-aware FileHandler flow (skip computeFileHash, handle trailing slash in basename) - Fix setExpectedSize computation per export mode - Add missing files: OpenMSConfig.cmake.in, FileTypes_test.cpp - Model timsrust_calibrate as string toggle per TOPP conventions - Add "d" to FileConverter input format list - Note tims_file_info() lacks instrument identity Co-Authored-By: Claude Opus 4.6 <[email protected]>
11 tasks covering CMake infrastructure, file type registration, FileHandler directory detection, BrukerTimsFile reader (DDA/DIA/frame), streaming, FileConverter integration, and test infrastructure. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Review checkpoints after each chunk boundary and critical tasks: - Gate 1: Infrastructure (CMake + FileTypes + FileHandler) - Gate 2: BrukerTimsFile skeleton and RAII wrappers - Gate 3: frameToSpectrum_ core conversion - Gate 4: DDA loading path - Gate 5: DIA loading path (critical, most complex) - Gate 6: Complete reader (full review before Chunk 3) - Gate 7: FileConverter integration - Gate 8: Final end-to-end review Co-Authored-By: Claude Opus 4.6 <[email protected]>
…p_bridge Add CMake infrastructure for optional Bruker TimsTOF .d file support: - WITH_TIMSRUST option (default ON) and ENABLE_TIMSRUST_TESTS option - FetchContent-based download of pre-built timsrust_cpp_bridge archives with platform detection (Linux x86_64/aarch64, macOS arm64, Windows) - Link timsrust_cpp_bridge as private dependency of libOpenMS - Propagate WITH_TIMSRUST compile definition and export in OpenMSConfig Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add BRUKER_TDF to the FileTypes enum with extension "d" and properties PROVIDES_EXPERIMENT + READABLE. Register in TypeNameBinding array (before XML which must remain last), add typeToMZML entry, and update test assertions for the new type count. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…r TDF Add BRUKER_TDF directory validation in getType() (checks for analysis.tdf or analysis.tdf_bin marker files), loadExperiment() dispatch stub behind WITH_TIMSRUST guard, hash computation skip for directories, and path normalization for trailing-slash handling in source file metadata. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Paths like sample.d/ (from shell tab-completion) would fail to be recognized as BRUKER_TDF because getTypeByFileName() sees an empty basename. Move slash-stripping before the type lookup call. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…dispatch Add BrukerTimsFile header and source skeleton guarded by WITH_TIMSRUST. Includes RAII wrappers for tims_dataset and tims_config handles, helper functions for error reporting and dataset opening, and stub implementations for load/transform/loadDDA_/loadDIA_/loadFrames_/ frameToSpectrum_ methods. Register in sources.cmake (conditional) and wire up FileHandler BRUKER_TDF case to use BrukerTimsFile. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the frameToSpectrum_ stub with full implementation that batch-converts TOF indices to m/z and scan indices to inverse ion mobility (1/K0), builds per-peak IM values from CSR scan offsets, and attaches a properly labeled FloatDataArray via IMDataConverter::setIMUnit(). Add BrukerTimsFile_test skeleton with #ifdef WITH_TIMSRUST guards and FileHandler detection tests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…vel) Co-Authored-By: Claude Opus 4.6 <[email protected]>
…-peak IM Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the loadFrames_ stub with an implementation that iterates both MS levels (1 and 2), loading all frames via frameToSpectrum_. Replace the load() placeholder with the real dispatch logic: FRAME mode calls loadFrames_(), SPECTRUM mode always calls loadDDA_(), and AUTO mode detects DDA vs DIA via isDIA_() and routes accordingly. Results are sorted by RT after loading. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…eters Co-Authored-By: Claude Opus 4.6 <[email protected]>
…l data Add FetchContent-based download of DDA and DIA test .d directories (gated by ENABLE_TIMSRUST_TESTS) and integration test sections that verify MS1/MS2 spectra, IM data, precursor info, and drift time units. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- getTimsError() now handles null dataset handle (possible on tims_open failure) - FileConverter warns that -process_lowmemory with .d input does not actually reduce memory usage yet Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix FetchContent URL to match release archive naming (v0.1.0 in filename)
- Replace default arg `Config() = {}` with overloads (GCC aggregate init issue)
- Fix FileNotReadable constructor call (4 args, not 5)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix metavalue key "selected_ion_mz" -> "selected ion m/z" to match mzML convention (MzMLHandler reads/writes "selected ion m/z") - Extract getTimsConfig_() helper in FileConverter to deduplicate config-building code between low-memory and normal branches - Check tims_get_swath_windows return status in transform() expected size computation Co-Authored-By: Claude Opus 4.6 <[email protected]>
Adapted from Sage's PeakBuffer/fastcentroid_frame algorithm (Lazear 2023, doi:10.1021/acs.jproteome.3c00486). Integrates IM-dimension centroiding as a config-driven load-time option to reduce MS1 peak counts. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix header visibility: FrameCentroider stays in .cpp, not exposed in frameToSpectrum_() signature. Centroiding handled in load methods. - Fix intensity type: uint32_t* from tims_frame::intensities, not float* - Fix expandScanOffsets: template<T> to serve both float and double callers - Fix MS1 processing description: MS1 always uses raw frames, never timsrust SpectrumReader - Add partial config validation (warn if only one param set) - Add SpectrumSettings::CENTROID metadata on centroided MS1 spectra - Clarify MAX_CENTROID_PEAKS drop behavior is intentional - Adjust test plan: black-box via public API (FrameCentroider not testable directly from anonymous namespace) Co-Authored-By: Claude Opus 4.6 <[email protected]>
4 tasks across 3 chunks: 1. Config + helpers + refactored call sites (single buildable commit) 2. FrameCentroider integration into load methods 3. FileConverter TOPP parameters 4. Integration tests (centroiding, partial config, IM array, m/z sort) Co-Authored-By: Claude Opus 4.6 <[email protected]>
…S1 IM centroiding Add FrameCentroider struct (adapted from Sage's PeakBuffer, Lazear 2023, doi:10.1021/acs.jproteome.3c00486) and expandScanOffsets<T> helper to BrukerTimsFile.cpp. Add ms1_centroid_mz_ppm/ms1_centroid_im_pct config fields to BrukerTimsFile::Config. Update loadDDA_/loadDIA_/loadFrames_ signatures to accept const Config&. Refactor inline scan-offset expansion to use the shared expandScanOffsets template. Co-Authored-By: Claude Opus 4.6 <[email protected]>
When ms1_centroid_mz_ppm and ms1_centroid_im_pct are both > 0, MS1 frames are centroided across the IM dimension before building MSSpectrum objects. Centroided spectra are marked with SpectrumType::CENTROID. Algorithm adapted from Sage (Lazear 2023, doi:10.1021/acs.jproteome.3c00486). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Adds timsrust:ms1_centroid_mz_ppm and timsrust:ms1_centroid_im_pct parameters for controlling IM-dimension centroiding of MS1 frames. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies centroiding reduces MS1 peak count, leaves MS2 unaffected, preserves IM FloatDataArray, and marks spectra as CENTROID type. Also tests that partial config (only one tolerance set) does not enable centroiding. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Rename in_mzML parameter to in_spectra since the file-based search methods now accept both mzML and Bruker .d (TDF) formats. Add FileTypes::BRUKER_TDF to loadExperiment calls and register "d" as a valid input format in the TOPP tool. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Clamp negative values in inverse_convert to prevent UB on double→uint32_t cast, use rounding instead of truncation for better round-trip accuracy - Document thread-safety constraint on global factory registration - Use actual window_group from SQL instead of array index in DIA nativeIDs Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use find_package(zstd) to prefer system/package-managed zstd for TDF frame decompression. Falls back to compiling opentims's bundled zstddeclib.c when no system zstd is available (e.g. isolated wheel builds). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
# Conflicts: # cmake/cmake_findExternalLibs.cmake
- Update opentims commit hash to 85e1dfba which includes proper CMakeLists.txt with OPENTIMS_BUILD_CPP_LIB, OPENTIMS_LINK_SQLITE_STATICALLY options — eliminates need for all our CMake patches - Remove dead needed_frames set and unused #include <set> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ation Merge PR #8982 which moves calibration converters into opentims upstream. Update opentims to 02ad97dc (includes OSS converters, CMake options, sqlite static linking). Removes ~300 lines of OpenMS converter code. - Delete OpenTimsCalibration.h/.cpp (now in opentims) - Replace setAsDefault<> calls with setup_opensource() - Fix include paths to match opentims's PUBLIC include directory Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The ZSTD fallback compiles zstddeclib.c (a C file), but opentims only declares CXX language. When system zstd is unavailable (wheel builds), CMake fails with "CMAKE_C_COMPILE_OBJECT not set". Fix by enabling C language before FetchContent. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Port timsrust's spectrum processing pipeline to C++: - group_and_sum: merge duplicate TOF bins across scans/frames - smooth(window=1): symmetric neighbor intensity sharing in TOF space - centroid(window=1): sparse local maximum apex picking Applied to DDA MS2 spectra before m/z conversion. This produces cleaner, centroided spectra matching timsrust's output quality. Search engine identification rates improve significantly (target PSMs +32%, decoy PSMs -57% on HeLa DDA test data). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Make the code a bit safer * Use opentims v1.2.0b1
7 tasks done
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 25, 2026
- Update QPX output filenames to quantms.* scheme (#8974) - Add GenericWrapper removal (BREAKING) (#8981) - Add ModifiedSincSmoother new algorithm (#8217) - Add experimental BrukerTimsFile/BRUKER_TDF format support (#8975) Co-authored-by: Copilot <[email protected]>
timosachsenberg
pushed a commit
that referenced
this pull request
Mar 25, 2026
- Update QPX output filenames to quantms.* scheme (#8974) - Add GenericWrapper removal (BREAKING) (#8981) - Add ModifiedSincSmoother new algorithm (#8217) - Add experimental BrukerTimsFile/BRUKER_TDF format support (#8975) Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
This was referenced Mar 26, 2026
This was referenced Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces support for reading Bruker TimsTOF
.dfiles using the open-source C++ libraryopentims, replacing the previous Rust-basedtimsrustbridge. It integratesopentimsinto the build system, patches it for compatibility, and provides options for open-source calibration converters. The public API remains unchanged, but all Rust dependencies are eliminated. The CMake build, configuration, and test infrastructure are updated accordingly. A detailed migration design document is also included.Build System & Dependency Integration:
WITH_OPENTIMS(default ON) andENABLE_OPENTIMS_TESTS(default OFF) to control the inclusion and testing ofopentimssupport. Test data for integration tests is fetched conditionally. (CMakeLists.txt, [1] [2]opentimsas a C++ dependency usingFetchContent. The build patchesopentimssource files for compatibility (e.g., direct SQLite linkage, public getter for internal paths, variadic template fix) and compiles only the necessary C++ sources, linking against OpenMS's ownsqlite3library. (cmake/cmake_findExternalLibs.cmake, cmake/cmake_findExternalLibs.cmakeR276-R385)opentims_cppand setWITH_OPENTIMS=1when enabled. (src/openms/CMakeLists.txt, [1] [2]WITH_OPENTIMSconfiguration in the OpenMS CMake config for downstream consumers. (cmake/OpenMSConfig.cmake.in, cmake/OpenMSConfig.cmake.inR72)Documentation & Design:
timsrusttoopentims. (docs/superpowers/specs/2026-03-23-opentims-migration-design.md, docs/superpowers/specs/2026-03-23-opentims-migration-design.mdR1-R311)Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
New Features
Behavior Changes
Tests & Docs
Build