Skip to content

Conversation

@singjc
Copy link
Contributor

@singjc singjc commented Nov 28, 2025

This pull request improves the robustness and maintainability of the OSW file reading logic in pyprophet/io/export/osw.py by centralizing and standardizing how ion mobility (IM) columns are handled. The main changes ensure that the code gracefully supports both older and newer OSW files, regardless of whether specific IM columns are present, and reduces code duplication by introducing helper methods.

Ion Mobility (IM) column handling improvements:

  • Added helper methods _has_im_boundaries and _has_im to centralize checks for the presence of IM-related columns (EXP_IM, EXP_IM_LEFTWIDTH, EXP_IM_RIGHTWIDTH) in the FEATURE table, improving code clarity and maintainability.
  • Refactored SQL query composition in all relevant data reading methods (_read_unscored_data, _read_peptidoform_data, _read_augmented_data, _read_standard_data) to dynamically include IM columns or NULLs based on their presence, using the new helper methods. This ensures compatibility with both legacy and current OSW files. [1] [2] [3] [4] [5] [6] [7]

Code organization and imports:

  • Cleaned up and reorganized imports in osw.py, removing unused imports and grouping related functionality for better readability.

@singjc singjc merged commit 079586f into PyProphet:master Nov 28, 2025
4 checks passed
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.

1 participant