Add AlphaDIA v2+ format compatibility to loader#29
Merged
Conversation
- Support both v1 and v2+ AlphaDIA column naming conventions - Implement automatic format detection based on available columns - Add column mappings for new dot notation format (e.g., precursor.mz.observed) - Maintain full backward compatibility with existing v1 format files - Enhance error messages to show both old and new expected column names - Support all file formats: CSV, parquet, and TSV Resolves compatibility issues with AlphaDIA v2.0.0+ breaking changes while preserving support for legacy v1 format datasets. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds compatibility in the AlphaDIA loader for both legacy v1 column names and AlphaDIA v2.0.0+ “dot notation” columns, aiming to automatically detect the available schema and keep backward compatibility.
Changes:
- Document v1 vs v2+ AlphaDIA column expectations in
__parse_alphadia. - Add a v1/v2+ column mapping table and auto-detection to select the present columns.
- Improve missing-column error reporting to reference both v1 and v2+ expected names.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
mschwoer
reviewed
Mar 18, 2026
Major improvements addressing all PR review feedback: - Extend existing ColumnMapper class with AlphaDIA column variants instead of separate function - Add comprehensive column mappings for both v1 and v2+ formats in COLUMN_VARIANTS - Remove redundant _detect_alphadia_columns function for cleaner codebase - Implement proper ion mobility width validation when require_im=True - Improve error message formatting with clear line breaks - Update documentation: V1/V2+ → "alphadia version < 2.0.0" / ">= 2.0.0" - Follow established codebase patterns for better maintainability This approach leverages existing infrastructure, provides better error messages, and maintains consistency with other software parsers in the codebase. Addresses all feedback from @mschwoer and GitHub Copilot review. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
mschwoer
reviewed
Mar 19, 2026
Improvements requested by @mschwoer: - Add version comments to all AlphaDIA entries in COLUMN_VARIANTS (# alphadia < 2, # alphadia >= 2) to distinguish input formats clearly - Add assumption comment explaining why observed values are used instead of calibrated values for v2+ (window placement assumption) - Extract error handling logic to dedicated _raise_alphadia_missing_columns_error() method for better code organization and maintainability These changes improve code readability, documentation, and organization while maintaining all existing functionality. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
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.
Resolves compatibility issues with AlphaDIA v2.0.0+ breaking changes while preserving support for legacy v1 format datasets.