Skip to content

Add msfragger tsv reader - #367

Merged
GeorgWa merged 7 commits into
mainfrom
add_msfragger_tsv_reader
Dec 6, 2025
Merged

GeorgWa merged 7 commits into
mainfrom
add_msfragger_tsv_reader

Conversation

@GeorgWa

@GeorgWa GeorgWa commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

This PR adds a reader for the fdr controlled precursor format of MSFragger

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for reading MSFragger's PSM TSV output format by implementing a new reader class and modification translation system.

Key Changes:

  • Implemented MSFragger_PSM_TSV_Reader to parse MSFragger's tab-separated PSM files
  • Added MSFraggerModificationTranslation class to convert MSFragger modification format to alphabase format
  • Comprehensive test coverage including unit tests for modification parsing and integration tests

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
alphabase/psm_reader/msfragger_reader.py Core implementation of MSFragger PSM TSV reader and modification translator
alphabase/psm_reader/keys.py Added ASSIGNED_MODS constant for modification column mapping
alphabase/constants/const_files/psm_reader.yaml Configuration for MSFragger PSM TSV format including column mappings and supported modifications
tests/unit/psm_reader/test_psm_reader_provider.py Updated provider test to include new reader types
tests/unit/psm_reader/test_msfragger_psm_tsv.py Unit tests for reader functionality and data processing
tests/unit/psm_reader/test_msfragger_modification_translation.py Unit tests for modification translation logic
tests/integration/test_psm_readers.py Integration test with sample data to verify end-to-end functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread alphabase/psm_reader/keys.py Resolved
- Rename MSFragger_PSM_TSV_Reader to MSFraggerPsmTsvReader
- Rename ASSIGNED_MODS to TMP_MODS (_tmp_mods) for clarity
- Add MsFraggerTokens class for string constants
- Make instance variables private (_mass_mapped_mods, _mod_mass_tol)
- Improve variable names (pos_aa_str -> position_and_amino_acid, etc.)
- Remove redundant empty check in __call__
- Combine preprocessing into single apply() call
- Simplify docstrings, add output example
- Add docs link to psm_reader.yaml
- Document TMP_MODS in PsmDfCols docstring
- Improve error message for unknown modifications
- Update tests to reference yaml config instead of hardcoded values

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@GeorgWa
GeorgWa merged commit 0e6a6d5 into main Dec 6, 2025
2 checks passed
@GeorgWa
GeorgWa deleted the add_msfragger_tsv_reader branch December 6, 2025 19:51
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.

4 participants