Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
This branch has not been deployed
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.
Summary
MSMSReaderpreviously copied MaxQuant short modification codes (such as(ox),(ac),(de),(gl)) and descriptive labels (such as(Oxidation (M)),(Acetyl (Protein N-term))) verbatim into ProForma brackets. On MaxQuant exports this either raisesModificationExceptionon descriptive labels or silently resolves short codes to the wrong Unimod entry — for example, in #138_ACVINGM(ox)QLK_parsed toACVINGM[ox]QLK/2, where[ox]matched Unimod:6 (Carboxymethyl,+58.005479 Da, theoretical mass1133.5573 Da) instead ofOxidation(+15.994915 Da, theoretical mass1091.5467 Da).Who hits this: proteomics users reading MaxQuant
msms.txtfiles withpsm_utils.io.maxquant.MSMSReader(orread_file(..., filetype="msms")) whose modified sequences contain MaxQuant short codes or descriptive modification labels (#138).Changes
psm_utils/io/maxquant.py:_NAMED_MODIFICATIONSand_SHORT_MODIFICATIONS) and cross-check short codes against the row'sModificationssummary when present (disambiguating site-dependent tags such as N-terminal(ca)->Carbamylvs cysteine(ca)->Carbamidomethyl, and N-terminal Q(gl)->Gln->pyro-Gluvs corroborated lysine(gl)->GG).modification_mapping: Mapping[str, str] | None = NonetoMSMSReader: caller entries override built-ins by exact label, whilemodification_mapping={}opts out to preserve raw labels.INFOlog when mapping is applied._parse_peptidoformwith balanced-parenthesis parsing that handles nested parentheses and distinguishes true C-terminal modifications from modifications on the C-terminal amino acid.psm_utils/psm_list.py:INFOlog per non-emptyPSMList.rename_modificationscall (as discussed in Peptidoforms parsed from MaxQuant output are not always valid #138).tests/test_io/test_maxquant.py,tests/test_psm_list.py,tests/test_data/issue_138_msms.txt:ACVINGM[Oxidation]QLK/2,1091.5467 Dawhile preservingmetadata["Mass"] == "1148.5682"), descriptive/short site disambiguation, C-terminal residue vs C-term placement,modification_mappingoverrides and{}opt-out, deduplicated warnings, andrename_modificationslogging.Note on fixed modifications: MaxQuant omits fixed modifications (such as carbamidomethylation on C in the #138 example) from
Modified sequence; this PR maps only labels present inModified sequenceand leavesmetadata["Mass"]untouched.Verification
main(ab50a617) and pass with this patch; the full test suite passes (142 passed).example_files/msms.txt.gzclears all 6,609 short tags ((ac),(de),(ox),(gl)), eliminating 6,230 theoretical-mass discrepancies> 0.05 Da(0 discrepancies patched).ruff check,ruff format --check, andmypypass on all modified files.Fixes #138
🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N