AlphaPept Protein Group Reader - #327
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a new protein group reader for AlphaPept search engine outputs, enabling the parsing of AlphaPept protein group reports with custom regex-based protein identifier parsing.
- Adds
AlphaPeptPGReaderclass with custom preprocessing logic for parsing protein identifiers from FASTA headers - Extends the protein group column schema to support Ensembl IDs, source databases, and decoy indicators
- Implements comprehensive test coverage for the new reader functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
alphabase/pg_reader/alphapept_pg_reader.py |
Main implementation of AlphaPept reader with regex-based protein identifier parsing |
alphabase/pg_reader/keys.py |
Extends column schema with new fields for Ensembl IDs, source DB, and decoy indicators |
alphabase/pg_reader/pg_reader.py |
Modifies base reader to handle cases where no feature columns are specified |
alphabase/constants/const_files/pg_reader.yaml |
Configuration for AlphaPept reader with default measurement regex |
alphabase/pg_reader/__init__.py |
Exports the new AlphaPept reader class |
tests/unit/pg_reader/test_alphapept_pg_reader.py |
Comprehensive unit tests for protein identifier parsing logic |
tests/integration/test_pg_readers.py |
Integration tests for file import functionality |
tests/integration/test_pg_reader_provider.py |
Tests for reader provider integration |
tests/integration/conftest.py |
Test fixture for AlphaPept example data |
Currently, reverse (decoy) sequences are marked with a designated flag ( Example |
|
Added functionality to pre-configure regular expressions: Configuration in alphapept:
...
measurement_regex:
raw: "^.*(?<!_LFQ)$"
lfq: "_LFQ$"UsageGet available pre-configured regular expressions: AlphaPeptPGReader.get_preconfigured_regex()
> {'raw': '^.*(?<!_LFQ)$', 'lfq': '_LFQ$'}Read reader = AlphaPeptPGReader(measurement_regex="lfq")
results = reader.import_file(...)
# reads LFQ values |
|
Added explicit equivalence test in integration testing. |
…the length of feature_columns is 0
… reports which are also exported in parquet format
API documentation for PG reader
MZTab protein group reader
FragPipe PG Reader
Spectronaut PG Reader
MaxQuant ProteinGroup Reader
Implements the protein group reader for AlphaPept protein group reports. This is the first reader that requires regex logic for reading.
Key challenges are that alphapept dataframes do not contain a name in the feature column and that feature names are extracted from custom fasta headers, i.e. it is difficult to parse the feature names.
_pre_processlogic that supports standard uniprot + ensembl entries._parse_alphapept_index, which is tested based on the examples provided in the example data.