Repository navigation
feat: Add PEFF (PSI Extended FASTA Format) file support - #8690
timosachsenberg merged 32 commits into
Conversation
Implements full PEFF format support for reading and writing protein sequence files with rich annotations. New features: - PEFFFile class with batch (load/store) and streaming APIs - Support for all PEFF annotation types: - Modifications (PSI-MOD, UNIMOD, custom) - Simple variants (single amino acid substitutions) - Complex variants (insertions, deletions, multi-residue changes) - Processed regions (signal peptides, transit peptides, etc.) - Proteoforms (ProForma notation) - Database metadata parsing (version, name, prefix, decoy flag, etc.) - AASequence integration methods: - getSequence() - unmodified sequence - getModifiedSequence() - with modifications applied - getVariantSequences() - all variant sequences - getProcessedSequence() - mature protein without signal peptide - File type detection via isPEFFFile() - pyOpenMS bindings with convenience methods Files: - PEFFFile.h/cpp - Core implementation - PEFFFile.pxd/pyx - Python bindings - PEFFFile_test.cpp - Unit tests - Test data files (*.peff) Co-Authored-By: Claude Opus 4.5 <[email protected]>
📝 WalkthroughWalkthroughAdds first-class PEFF support: new PEFF data model, parser/formatter and PEFFFile I/O (bulk + streaming), file-type registration, ProForma conversion, ModificationsDB resolution, Python/Cython bindings, multiple tests and PEFF test fixtures. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(220,230,241,0.5)
participant Client
end
rect rgba(200,255,200,0.5)
participant PEFFFile
end
rect rgba(255,240,200,0.5)
participant Filesystem
end
rect rgba(255,200,220,0.5)
participant ModificationsDB
end
Client->>PEFFFile: load(filename) / readStart(filename)
PEFFFile->>Filesystem: open(filename)
Filesystem-->>PEFFFile: file stream
PEFFFile->>PEFFFile: parse header -> PEFFDatabaseMetadata
PEFFFile->>PEFFFile: parse entry -> PEFFEntry
alt entry has modification annotations
PEFFFile->>ModificationsDB: resolve modification accessions/names
ModificationsDB-->>PEFFFile: mod details / not found
end
PEFFFile-->>Client: return entries / provide readNext()
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@src/openms/include/OpenMS/FORMAT/PEFFFile.h`:
- Around line 199-207: The documentation for getModifiedSequence() is incorrect:
the implementation logs and skips unresolved modifications instead of throwing;
update the comment for AASequence getModifiedSequence() to remove or replace the
`@throw` Exception::InvalidValue clause and clearly state that modifications with
unknown accessions are logged and skipped (and that modifications with position
== 0 are ignored), so the doc matches the actual behavior of the modifications
vector handling in getModifiedSequence().
In `@src/openms/source/FORMAT/PEFFFile.cpp`:
- Around line 543-555: PEFFFile::toProForma currently returns entry.sequence
even when entry.modifications is non-empty, which hides modifications; update
PEFFFile::toProForma to either (a) implement a minimal ProForma annotation:
iterate PEFFEntry.modifications, map each modification to its residue
position(s) and insert ProForma-style tags into the sequence string at the
correct offsets (use entry.sequence and the modifications' position fields to
compute insertion indices), or (b) explicitly signal unimplemented behavior by
returning or throwing a clear sentinel (e.g., a dedicated error or a string like
"<ProForma not implemented for modified entries>") when entry.modifications is
not empty; choose one approach and update callers/tests accordingly.
In `@src/pyOpenMS/pxds/PEFFFile.pxd`:
- Around line 249-254: The binding for PEFFFile::getProcessedSequence currently
drops the C++ default so Python callers must pass region_type; fix by adding the
default to the .pxd declaration—change the signature of getProcessedSequence in
src/pyOpenMS/pxds/PEFFFile.pxd to include String region_type = "PEFF:0001021"
(preserving except + nogil and doc comment); alternatively, if you prefer a
Python-only convenience, add a snake_case wrapper get_processed_sequence(self,
region_type="PEFF:0001021") in src/pyOpenMS/addons/PEFFFile.pyx that calls
self.getProcessedSequence(region_type) and returns the result.
In `@src/tests/class_tests/openms/data/PEFFFile_test.peff`:
- Around line 13-14: The PEFF entry for the header starting with "test:P12345"
has a mismatch: the metadata token "\Length=50" doesn't match the actual
sequence on the next line (49 residues); update the header's "\Length=50" to
"\Length=49" so the \Length value aligns with the sequence, leaving other tokens
(e.g., \SV, \EV, \PE, \ModRes, \VariantSimple, \Processed) unchanged.
🧹 Nitpick comments (4)
src/openms/source/FORMAT/PEFFFile.cpp (1)
1235-1245: UseSizefor chunk counts to match OpenMS size conventions.
int chunks(and the loop index) can truncate for very long sequences; useSizeconsistently with OpenMS container-size guidelines. As per coding guidelines, ...♻️ Suggested change
- int chunks = seq.size() / 80; - for (int i = 0; i < chunks; ++i) + Size chunks = seq.size() / 80; + for (Size i = 0; i < chunks; ++i)src/pyOpenMS/addons/PEFFFile.pyx (1)
6-72: Return numpy arrays to align with DataFrame pattern.These dictionary methods are intended for DataFrame creation. Following the established pattern in other addons (e.g.,
MSSpectrum.get_data_dict()), they should return numpy arrays rather than lists. Add numpy import and convert values:♻️ Suggested update (apply to all three helpers)
+cimport numpy as np +import numpy as np + def get_modifications_dict(self): """Return modifications as a dictionary of lists suitable for DataFrame creation. @@ - return data + return {k: np.asarray(v) for k, v in data.items()} def get_variants_dict(self): @@ - return data + return {k: np.asarray(v) for k, v in data.items()} def get_processed_regions_dict(self): @@ - return data + return {k: np.asarray(v) for k, v in data.items()}src/openms/include/OpenMS/FORMAT/PEFFFile.h (2)
185-189: Add full Doxygen blocks for the FASTA conversion helpers.These methods use
///comments without@brief/@paramand miss the required Doxygen structure for headers.📝 Suggested doc update
- /// Convert to a FASTAFile::FASTAEntry (loses PEFF-specific annotations) + /** + `@brief` Convert to a FASTAFile::FASTAEntry (loses PEFF-specific annotations). + + `@return` FASTA representation of this PEFF entry + */ FASTAFile::FASTAEntry toFASTAEntry() const; - /// Create a PEFFEntry from a FASTAEntry (basic fields only) + /** + `@brief` Create a PEFFEntry from a FASTAEntry (basic fields only). + + `@param`[in] fasta Input FASTA entry + `@return` PEFFEntry with basic fields populated + */ static PEFFEntry fromFASTAEntry(const FASTAFile::FASTAEntry& fasta);As per coding guidelines, please use the
@brief/@paramformat in header docs.
351-422: Align remaining method docs with Doxygen@brief/@PARAM requirements.A few methods still use short
///comments without@brief/@param(e.g.,atEnd,writeEnd, and the protected parse/format helpers). Please switch these to full Doxygen blocks and annotate parameters.📝 Example adjustment (apply similarly to the other helpers)
- /// Returns true if the end of the file has been reached + /** + `@brief` Returns true if the end of the file has been reached. + + `@return` true if EOF has been reached, otherwise false + */ bool atEnd() const; - /// Closes the output file (called automatically in destructor) + /** + `@brief` Closes the output file. + + Called automatically in the destructor. + */ void writeEnd(); - /// Parse a header line (# Key=Value or # //) + /** + `@brief` Parse a header line (# Key=Value or # //). + + `@param`[in] line Header line + `@param`[in,out] header Header metadata to update + `@param`[in,out] new_db Flag indicating a new database section + */ void parseHeaderLine_(const String& line, PEFFDatabaseMetadata& header, bool& new_db);As per coding guidelines, header docs should use
@briefwith full parameter annotations.
- Fix FileTypes_test to expect correct count (39 READABLE, 62 total) - Add PEFF test to FileHandler_test and FileTypes_test - Fix PEFFFile_test.peff \Length=50 -> \Length=49 to match sequence - Fix PEFFFile_test.cpp expected sequence_length to 49 - Fix getModifiedSequence() docs (doesn't throw, logs and skips) - Add warning log when toProForma() is called with modifications Co-Authored-By: Claude Opus 4.5 <[email protected]>
Implements full ProForma notation generation from PEFF entries: - Localised modifications: placed after the amino acid they modify - Unlocalised modifications (position 0): encoded as <?[mod]> prefix - Supports CV accessions (UNIMOD:, MOD:) and named modifications - Multiple modifications at same position supported Added comprehensive tests: - Single and multiple modifications - Unlocalised and mixed modifications - Named modifications without accessions - Round-trip verification with ProForma parser Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/openms/source/FORMAT/PEFFFile.cpp`:
- Around line 1320-1354: The helper formatModifications_ is unused and
duplicates logic in formatEntry_; either remove its declaration/definition
(formatModifications_ and any forward decl in PEFFFile.h) or refactor
formatEntry_ to call formatModifications_ for the modification formatting block
(the code handling PEFFModification entries around formatEntry_ where positions,
accession, name, evidence are serialized). If you refactor, replace the inline
loop in formatEntry_ with a call to formatModifications_(mods, key) and ensure
PEFFModification is used consistently and headers/visibility are updated; if you
delete it, remove both declaration and definition and any unused includes to
keep builds clean.
♻️ Duplicate comments (1)
src/openms/source/FORMAT/PEFFFile.cpp (1)
79-94: Accession-based lookup still not implemented.The
unimod_idvariable extracted on line 82 is never used. All three branches (UNIMOD, MOD, and name-only) call the samegetModification(mod.name, ...), ignoring the accession. If a PEFF entry has an accession but no name (valid per PEFF spec), the modification will be silently skipped.#!/bin/bash # Check if ModificationsDB has any accession-based lookup methods rg -n "getModification" src/openms/include/OpenMS/CHEMISTRY/ModificationsDB.h -A 3
🧹 Nitpick comments (4)
src/openms/source/FORMAT/PEFFFile.cpp (4)
104-104: Prefer"\n"overstd::endl.Per coding guidelines, avoid
std::endlfor better performance.Suggested fix
- OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")" << std::endl; + OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")" << "\n";
450-453: Minor:const_castusage inatEnd().The
const_castis needed becausepeek()is non-const. This is a minor code smell but acceptable sincepeek()doesn't modify stream content. Consider making the method non-const or documenting why the cast is safe.
943-995: Consider logging warnings for malformed tuple data.The parsing functions (
parseModification_,parseVariantSimple_,parseVariantComplex_,parseProcessedRegion_) return default-initialized objects when input doesn't meet minimum field requirements (e.g.,parts.size() < 2). This silent behavior could make debugging difficult when PEFF files contain malformed data.Example: Add warning for malformed modification tuples
PEFFModification PEFFFile::parseModification_(const String& tuple) { // Format: pos|accession|name|evidence (evidence is optional) // Position can be ? for unknown position PEFFModification mod; std::vector<String> parts; tuple.split('|', parts); if (parts.size() >= 2) { // ... existing parsing code ... } + else + { + OPENMS_LOG_WARN << "Malformed PEFF modification tuple (expected at least 2 fields): " << tuple << "\n"; + } return mod; }
1299-1315: Type mismatch: useSizeinstead ofintfor chunk count.Line 1301 uses
intforchunksbutseq.size()returnsSize(unsigned). Per coding guidelines, use OpenMS primitive types for STL container sizes. While unlikely to overflow in practice, this ensures type consistency.Suggested fix
// Write sequence (80 characters per line) const String& seq = entry.sequence; - int chunks = seq.size() / 80; + Size chunks = seq.size() / 80; Size chunk_pos = 0; - for (int i = 0; i < chunks; ++i) + for (Size i = 0; i < chunks; ++i) { out.write(&seq[chunk_pos], 80); out << "\n"; chunk_pos += 80; }
- Fix getModifiedSequence() to try accession first, then name (previously extracted unimod_id but never used it) - Remove unused formatModifications_() helper function - Add Python binding overload for getProcessedSequence() default param - Fix test to properly access ProForma variant elements Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Usage ExamplesPython (pyOpenMS)Basic Loading and Iterationfrom pyopenms import PEFFFile, PEFFEntry, PEFFDatabaseMetadata
# Load a PEFF file
peff = PEFFFile()
entries = []
headers = []
peff.load("proteins.peff", entries, headers)
# Print database info
for header in headers:
print(f"Database: {header.db_name} ({header.number_of_entries} entries)")
print(f" Version: {header.db_version}, Date: {header.db_date}")
print(f" Decoy: {header.is_decoy}")
# Iterate over entries
for entry in entries:
print(f"\n{entry.identifier}")
print(f" Gene: {entry.gene_name}")
print(f" Names: {', '.join(entry.protein_names)}")
print(f" Sequence ({entry.sequence_length} aa): {entry.sequence[:50]}...")
print(f" Modifications: {len(entry.modifications)}")
print(f" Variants: {len(entry.simple_variants)} simple, {len(entry.complex_variants)} complex")Working with Modificationsfrom pyopenms import PEFFFile, AASequence
peff = PEFFFile()
entries = []
headers = []
peff.load("uniprot_human.peff", entries, headers)
for entry in entries:
# Get unmodified sequence
seq = entry.getSequence()
print(f"{entry.identifier}: {seq.getMonoWeight():.2f} Da (unmodified)")
# Get sequence with all annotated modifications applied
if entry.modifications:
mod_seq = entry.getModifiedSequence()
print(f" Modified: {mod_seq.getMonoWeight():.2f} Da")
# List each modification
for mod in entry.modifications:
pos = "?" if mod.position == 0 else str(mod.position)
print(f" Position {pos}: {mod.name} ({mod.accession})")Working with Variantsfrom pyopenms import PEFFFile
peff = PEFFFile()
entries = []
headers = []
peff.load("proteins_with_variants.peff", entries, headers)
for entry in entries:
# Get all single amino acid variants
variants = entry.getVariantSequences()
print(f"{entry.identifier}: {len(variants)} variants")
for description, variant_seq in variants:
mass_diff = variant_seq.getMonoWeight() - entry.getSequence().getMonoWeight()
print(f" {description}: {mass_diff:+.4f} Da")
# Access variant details directly
for var in entry.simple_variants:
print(f" Position {var.position}: -> {chr(var.variant_aa)} ({var.sources})")Signal Peptide Processingfrom pyopenms import PEFFFile
peff = PEFFFile()
entries = []
headers = []
peff.load("secretome.peff", entries, headers)
for entry in entries:
# Check for signal peptide regions
for region in entry.processed_regions:
if region.type == "PEFF:0001021": # Signal peptide
print(f"{entry.identifier}: Signal peptide at {region.start_position}-{region.end_position}")
# Get mature protein (without signal peptide)
mature = entry.getProcessedSequence() # Uses default PEFF:0001021
print(f" Full length: {entry.sequence_length} aa")
print(f" Mature protein: {len(mature)} aa")Converting to ProForma Notationfrom pyopenms import PEFFFile
peff = PEFFFile()
entries = []
headers = []
peff.load("modified_proteins.peff", entries, headers)
for entry in entries:
if entry.modifications:
proforma = PEFFFile.toProForma(entry)
print(f"{entry.identifier}: {proforma}")
# Output: sp:P12345: PEPTM[UNIMOD:35]IDES[MOD:00046]EQUENCEStreaming API for Large Filesfrom pyopenms import PEFFFile, PEFFEntry
# Memory-efficient streaming for large files
peff = PEFFFile()
peff.readStart("huge_proteome.peff")
# Access headers after readStart
for header in peff.getHeaders():
print(f"Processing {header.db_name}...")
# Stream entries one at a time
entry = PEFFEntry()
phospho_count = 0
while peff.readNext(entry):
for mod in entry.modifications:
if "Phospho" in mod.name:
phospho_count += 1
print(f"Found {phospho_count} phosphorylation sites")Writing PEFF Filesfrom pyopenms import (PEFFFile, PEFFEntry, PEFFDatabaseMetadata,
PEFFModification, PEFFVariantSimple)
# Create metadata
header = PEFFDatabaseMetadata()
header.db_name = "MyProteins"
header.prefix = "mydb"
header.db_description = "Custom protein database"
header.db_version = "1.0"
header.db_date = "20240115"
header.number_of_entries = 2
# Create entries
entries = []
entry1 = PEFFEntry()
entry1.identifier = "mydb:P001"
entry1.sequence = "MSEQVENCEWITHMODIFICATIONS"
entry1.protein_names.append("My First Protein")
entry1.gene_name = "MFP1"
entry1.ncbi_tax_id = 9606
entry1.sequence_length = len(entry1.sequence)
# Add a modification
mod = PEFFModification()
mod.position = 10
mod.accession = "UNIMOD:35"
mod.name = "Oxidation"
entry1.modifications.append(mod)
# Add a variant
var = PEFFVariantSimple()
var.position = 5
var.variant_aa = ord('R') # R = Arginine
var.sources = "dbSNP:rs123456"
entry1.simple_variants.append(var)
entries.append(entry1)
# Write to file
peff = PEFFFile()
peff.store("output.peff", entries, header)Converting from FASTAfrom pyopenms import FASTAFile, PEFFFile, PEFFEntry, PEFFDatabaseMetadata
# Load existing FASTA
fasta_entries = []
FASTAFile().load("proteins.fasta", fasta_entries)
# Convert to PEFF entries
peff_entries = []
for fasta in fasta_entries:
peff_entry = PEFFEntry.fromFASTAEntry(fasta)
peff_entries.append(peff_entry)
# Create header and save
header = PEFFDatabaseMetadata()
header.db_name = "ConvertedDB"
header.prefix = "conv"
header.number_of_entries = len(peff_entries)
PEFFFile().store("converted.peff", peff_entries, header)C++ UsageBasic Loading#include <OpenMS/FORMAT/PEFFFile.h>
#include <iostream>
using namespace OpenMS;
int main()
{
PEFFFile peff;
std::vector<PEFFEntry> entries;
std::vector<PEFFDatabaseMetadata> headers;
peff.load("proteins.peff", entries, headers);
for (const auto& entry : entries)
{
std::cout << entry.identifier << ": " << entry.sequence.size() << " aa\n";
// Get modified sequence
AASequence mod_seq = entry.getModifiedSequence();
std::cout << " Mass: " << mod_seq.getMonoWeight() << " Da\n";
// Convert to ProForma
String proforma = PEFFFile::toProForma(entry);
std::cout << " ProForma: " << proforma << "\n";
}
return 0;
}Streaming for Large Files#include <OpenMS/FORMAT/PEFFFile.h>
using namespace OpenMS;
int main()
{
PEFFFile peff;
peff.readStart("large_proteome.peff");
PEFFEntry entry;
size_t mod_count = 0;
while (peff.readNext(entry))
{
mod_count += entry.modifications.size();
}
std::cout << "Total modifications: " << mod_count << "\n";
return 0;
}File Format ReferencePEFF files have a header section followed by FASTA-like entries with rich annotations: Key annotation types:
See the PEFF specification for full details. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/openms/include/OpenMS/FORMAT/PEFFFile.h`:
- Around line 325-332: Update the Doxygen for the method readStart(const String&
filename) to document that it can throw Exception::FileNotReadable in addition
to Exception::FileNotFound; locate the readStart declaration in PEFFFile.h and
add an `@exception` line describing Exception::FileNotReadable (when the file
exists but cannot be opened/read) so the docblock lists both possible
exceptions.
In `@src/pyOpenMS/pxds/PEFFFile.pxd`:
- Around line 12-103: The PEFFFile C++ static method toProForma(const
PEFFEntry&) is missing from the Python bindings; add a binding analogous to
isPEFFFile by declaring a free function mapping to OpenMS::PEFFFile::toProForma
that takes a const PEFFEntry& and returns a String (or appropriate
Python-exposed type) in the .pxd, e.g., declare: String toProForma
"OpenMS::PEFFFile::toProForma" (const PEFFEntry& entry) except + nogil, and
include a wrap-doc comment similar to isPEFFFile; ensure you reference PEFFEntry
and PEFFFile symbols exactly as in the file.
🧹 Nitpick comments (3)
src/tests/class_tests/openms/source/PEFFFile_test.cpp (2)
142-152: Round‑trip test should assert full entry equality.Right now only sizes are compared, so content regressions could slip. Since PEFFEntry has operator==, use it to validate the full round‑trip.
Proposed test tightening
- TEST_EQUAL(entries[i].identifier, entries2[i].identifier) - TEST_EQUAL(entries[i].sequence, entries2[i].sequence) - TEST_EQUAL(entries[i].protein_names.size(), entries2[i].protein_names.size()) - TEST_EQUAL(entries[i].modifications.size(), entries2[i].modifications.size()) - TEST_EQUAL(entries[i].simple_variants.size(), entries2[i].simple_variants.size()) - TEST_EQUAL(entries[i].complex_variants.size(), entries2[i].complex_variants.size()) - TEST_EQUAL(entries[i].processed_regions.size(), entries2[i].processed_regions.size()) + TEST_EQUAL(entries[i], entries2[i])
371-380: Strengthen getModifiedSequence test with a real modification.Right now it only checks size. Adding a known modification (e.g., UNIMOD:35) verifies ModificationsDB lookup and proper localization.
Proposed test enhancement
PEFFEntry entry; entry.sequence = "PEPTIDE"; - // Note: This test just verifies the method works; actual modification - // application would require valid modification names in ModificationsDB + entry.modifications.push_back(PEFFModification(3, "UNIMOD:35", "Oxidation")); AASequence seq = entry.getModifiedSequence(); TEST_EQUAL(seq.size(), 7) + TEST_EQUAL(seq[2].isModified(), true)src/openms/source/FORMAT/PEFFFile.cpp (1)
53-107: Avoid std::endl in warning logs.
std::endlforces a flush; prefer'\n'for logging streams.♻️ Suggested change
- OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")" << std::endl; + OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")" << '\n';As per coding guidelines, avoid
std::endlin logging/output.
PEFF keywords like \PName, \GName were interpreted as Doxygen commands. Escaped with double backslash to show literal text. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Cython cannot automatically convert vector<pair<String, AASequence>> to Python. Added wrap-ignore and implemented getVariantSequences() in Python addon instead. Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pyOpenMS/addons/PEFFFile.pyx`:
- Around line 112-117: Replace the bare except: in the PEFF parsing loop with a
specific exception handler (e.g., except Exception as e:) so that
SystemExit/KeyboardInterrupt can propagate; catch the parsing error around
AASequence.fromString(variant_seq_str) in the block that appends to result and
continue on parse failures, optionally logging or ignoring the caught Exception
object rather than silently swallowing all exceptions.
♻️ Duplicate comments (1)
src/pyOpenMS/pxds/PEFFFile.pxd (1)
97-102: Add the missingtoProFormastatic method binding.Per the past review comment, the C++ static method
PEFFFile::toProForma(const PEFFEntry&)exists but is not exposed in the bindings. The PR comments mentionPEFFFile.toProForma(entry)usage examples, indicating this is expected to be available.🔧 Proposed addition after `isPEFFFile`
bool isPEFFFile "OpenMS::PEFFFile::isPEFFFile" (const String& filename) except + nogil # wrap-doc: # Checks if a file appears to be a PEFF file # # :param filename: The file to check # :return: True if the file starts with PEFF headers + String toProForma "OpenMS::PEFFFile::toProForma" (const PEFFEntry& entry) except + nogil + # wrap-doc: + # Converts a PEFF entry to ProForma notation + # + # :param entry: The PEFF entry to convert + # :return: ProForma string representation
🧹 Nitpick comments (2)
src/pyOpenMS/addons/PEFFFile.pyx (2)
1-5: Minor: Remove excessive leading blank lines.The addon file starts with 5 blank lines. Per addon conventions, these should be minimal or removed.
75-89: Consider using snake_case for consistency.The method is named
getVariantSequences(camelCase) while other methods in this addon use snake_case (get_modifications_dict,get_variants_dict,get_processed_regions_dict). Per coding guidelines, Python-facing methods in addon files should use snake_case.♻️ Suggested rename
-def getVariantSequences(self): +def get_variant_sequences(self):
Add support for the PEFF HasAnnotationIdentifiers feature, which prefixes annotations with unique IDs in the format `annotationID:position`. Changes: - Add annotation_id field to PEFFModification, PEFFVariantSimple, PEFFVariantComplex, and PEFFProcessedRegion structs - Add has_annotation_identifiers flag to PEFFDatabaseMetadata - Update parse functions to detect and extract annotation IDs - Update format functions to output annotation IDs when present - Extend getVariantSequences() to optionally include complex variants Example formats supported: - Without IDs: \ModResPsi=(10|UNIMOD:35|Oxidation) - With IDs: \ModResPsi=(0:10|MOD:00046|Phosphorylation) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add missing PEFF 1.0 specification keywords found in UniProt examples: Entry keywords: - \DbUniqueId - Unique database identifier - \ID - Entry identifier (e.g., NPM_HUMAN) - \OX - Shorthand for NcbiTaxId - \AltAC - Alternative accessions - \DisulfideBond - Disulfide bond annotations Header keywords: - # Conversion - Conversion notes - # SpecificValue - Custom value type definitions - Multiple # GeneralComment lines (changed to vector) Also includes DRY refactoring: extract annotation ID parsing into helper function (was duplicated 4 times). Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/pyOpenMS/pxds/PEFFFile.pxd`:
- Around line 286-334: The PEFFDatabaseMetadata binding is missing the bool
field has_annotation_identifiers from the C++ struct; add a new member
declaration "bool has_annotation_identifiers" to the cdef cppclass
PEFFDatabaseMetadata block in src/pyOpenMS/pxds/PEFFFile.pxd (near the other
attributes like is_decoy, sequence_type, optional_tag_defs) so the Python
binding exposes the C++ field; ensure its placement follows the existing
attribute ordering and rebuild bindings.
- Around line 117-124: The Python Cython struct bindings are missing the
annotation_id field present in the C++ structs; add a String annotation_id
member to each corresponding cdef struct binding: add "String annotation_id"
inside the PEFFModification binding (near the existing Size position / String
accession fields), inside PEFFVariantSimple (after its current fields), inside
PEFFVariantComplex, and inside PEFFProcessedRegion so the UniProt-style
annotation identifiers are exposed to Python via the PEFF* bindings.
♻️ Duplicate comments (2)
src/openms/include/OpenMS/FORMAT/PEFFFile.h (1)
368-375: Update Doxygen documentation forreadStart()to documentFileNotReadableexception.The implementation throws both
Exception::FileNotFoundandException::FileNotReadable, but the Doxygen only documents the former. Add documentation for theFileNotReadablecase.📝 Suggested doc update
/** `@brief` Prepares a PEFF file for streamed reading using readNext(). `@param` filename The PEFF file to read `@exception` Exception::FileNotFound is thrown if the file does not exist. + `@exception` Exception::FileNotReadable is thrown if the file cannot be read. */src/pyOpenMS/pxds/PEFFFile.pxd (1)
97-103: AddPEFFFile::toProFormastatic method to Python bindings.The C++ static method
toProForma(const PEFFEntry&)is implemented and tested but is not exposed in the Python bindings. Add it following the pattern ofisPEFFFile:📝 Suggested addition after isPEFFFile
String toProForma "OpenMS::PEFFFile::toProForma" (const PEFFEntry& entry) except + nogil # wrap-doc: # Converts a PEFF entry to ProForma notation # # :param entry: The PEFF entry to convert # :return: ProForma string representation
Downloaded from EBI Proteins API variation endpoint: https://www.ebi.ac.uk/proteins/api/variation/P04637?format=peff Tests parsing of: - Real UniProt PEFF format with 1000+ variants - Stop codon variants (*) - Bracketed variant sources like [ExAC][gnomAD] - Multiple GeneralComment lines Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add method to generate all variant peptide combinations from enzymatic digestion. The method accepts a ProteaseDigestion object (allowing any enzyme like Trypsin, Chymotrypsin, etc.) and generates all 2^k combinations of simple variants within each peptide, where k is the number of variants in that peptide's span. This per-peptide approach is more efficient than generating all 2^n protein-level combinations, making it tractable for proteins with many variants like P53 (1000+ variants). Co-Authored-By: Claude Opus 4.5 <[email protected]>
Extend digestWithVariants to generate modification combinations in addition to variant combinations. New parameters: - include_variants: enable/disable variant combination generation - include_modifications: enable/disable modification combination generation For each peptide with k variants and m modifications, generates up to 2^(k+m) combinations. Modifications with unknown positions (position==0) are skipped. Modification application uses ModificationsDB for lookup. Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/openms/source/FORMAT/PEFFFile.cpp`:
- Around line 316-322: The loop computing num_combinations using 1ULL <<
total_elements is unsafe for large total_elements and can both overflow
(undefined behavior when total_elements >= word size) and cause combinatorial
explosion; add a guard before computing num_combinations that (a) checks
total_elements against a sensible hard cap (e.g. reject or bail out if
total_elements >= 63 or a lower practical limit like 30 to avoid 2^n explosion),
(b) handles the error by logging/throwing or skipping expansion (respecting
include_reference) instead of shifting, and (c) only computes num_combinations
when within the safe bound so the for loop over combo is never executed for
unsafe sizes; refer to the variables total_elements, num_combinations, combo and
include_reference when adding the check and error path.
♻️ Duplicate comments (7)
src/openms/include/OpenMS/FORMAT/PEFFFile.h (1)
399-406: Update Doxygen documentation forreadStart()to documentFileNotReadableexception.The implementation throws both
Exception::FileNotFoundandException::FileNotReadable, but the Doxygen only documents the former.📝 Suggested doc update
/** `@brief` Prepares a PEFF file for streamed reading using readNext(). `@param` filename The PEFF file to read `@exception` Exception::FileNotFound is thrown if the file does not exist. + `@exception` Exception::FileNotReadable is thrown if the file cannot be read. */ void readStart(const String& filename);src/pyOpenMS/pxds/PEFFFile.pxd (6)
119-126: Addannotation_idfield toPEFFModificationbinding.The C++ struct has an
annotation_idfield used for UniProt-style annotation identifiers, but it's not exposed in the Python binding.📝 Suggested addition
Size position String accession String name String evidence + String annotation_id
139-145: Addannotation_idfield toPEFFVariantSimplebinding.The C++ struct has an
annotation_idfield but it's not exposed in the Python binding.📝 Suggested addition
Size position char variant_aa String sources + String annotation_id
159-166: Addannotation_idfield toPEFFVariantComplexbinding.The C++ struct has an
annotation_idfield but it's not exposed in the Python binding.📝 Suggested addition
Size start_position Size end_position String replacement String sources + String annotation_id
181-189: Addannotation_idfield toPEFFProcessedRegionbinding.The C++ struct has an
annotation_idfield but it's not exposed in the Python binding.📝 Suggested addition
Size start_position Size end_position String type String name String description + String annotation_id
327-344: Addhas_annotation_identifiersfield toPEFFDatabaseMetadatabinding.The C++ struct has a
has_annotation_identifiersfield but it's not exposed in the Python binding.📝 Suggested addition
libcpp_map[String, String] specific_keys libcpp_map[String, String] specific_values libcpp_vector[String] optional_tag_defs + bool has_annotation_identifiers
99-105: AddPEFFFile::toProFormastatic method to Python bindings.The C++ static method
toProForma(const PEFFEntry&)exists and is tested, but is not exposed in the Python bindings. Add it following the same pattern asisPEFFFile:📝 Suggested addition after line 104
String toProForma "OpenMS::PEFFFile::toProForma" (const PEFFEntry& entry) except + nogil # wrap-doc: # Converts a PEFF entry to ProForma notation # # :param entry: The PEFF entry to convert # :return: ProForma string representation
🧹 Nitpick comments (2)
src/openms/source/FORMAT/PEFFFile.cpp (2)
119-124: Prefer\noverstd::endlfor logging.Per coding guidelines, avoid
std::endland prefer\nfor better performance in logging and output operations.♻️ Suggested fix
catch (const Exception::BaseException&) { // Skip if modification cannot be resolved - OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")" << std::endl; + OPENMS_LOG_WARN << "Could not resolve modification: " << mod.accession << " (" << mod.name << ")\n"; }
1721-1731: Use OpenMSSizetype instead ofintfor chunk calculation.Per coding guidelines, use OpenMS primitive types from
OpenMS/CONCEPT/Types.h(e.g.,Size) instead of standard types likeintfor STL container sizes.♻️ Suggested fix
// Write sequence (80 characters per line) const String& seq = entry.sequence; - int chunks = seq.size() / 80; + Size chunks = seq.size() / 80; Size chunk_pos = 0; - for (int i = 0; i < chunks; ++i) + for (Size i = 0; i < chunks; ++i) { out.write(&seq[chunk_pos], 80);
- Add safeguard for combinatorial explosion in digestWithVariants (limit to 20 elements = ~1M combinations max per peptide) - Add annotation_id field to Python bindings for PEFFModification, PEFFVariantSimple, PEFFVariantComplex, PEFFProcessedRegion - Add has_annotation_identifiers field to PEFFDatabaseMetadata binding - Replace bare except clause with except Exception in addon Co-Authored-By: Claude Opus 4.5 <[email protected]>
Refactor peptide generation to support additional variable modifications
(like Oxidation from sample handling) on top of PEFF annotations.
New method `generatePeptides()` provides a complete workflow:
1. Enzymatic digestion
2. PEFF variant enumeration (position-specific substitutions)
3. PEFF modification enumeration (position-specific PTMs)
4. Additional variable modifications via ModifiedPeptideGenerator
Also adds helper method `enumeratePEFFModifications_()` to separate
combinatorial logic from digestion.
Example usage:
```cpp
std::vector<String> sample_mods = {"Oxidation (M)", "Deamidated (N)"};
auto peptides = entry.generatePeptides(
digestor,
sample_mods, // additional variable mods
2, // max 2 variable mods per peptide
6, 40, // length range
true, // include reference
true, // include PEFF variants
true // include PEFF modifications
);
```
Co-Authored-By: Claude Opus 4.5 <[email protected]>
The generatePeptides method now accepts both fixed_mods and variable_mods parameters, enabling complete sample handling modification workflows: - Fixed mods (e.g., Carbamidomethyl) are applied to all compatible residues - Variable mods (e.g., Oxidation) generate combinatorial forms Co-Authored-By: Claude Opus 4.5 <[email protected]>
Implements pure Python versions of digestWithVariants() and generatePeptides() methods in the PEFFEntry addon since autowrap cannot handle the vector<pair> return type directly. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Reduce from 299 to 154 lines by removing verbose docstrings, dead code, and unnecessary nesting. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Change getVariantSequences, digestWithVariants, and generatePeptides to use output parameters (descriptions, sequences vectors) instead of returning vector<pair<String, AASequence>>. This allows autowrap to wrap them directly without custom type converters. Python addon simplified from 154 to 37 lines - now only contains DataFrame helper methods since the core methods are wrapped directly. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changes C++ API to use std::string instead of OpenMS::String for: - Output description parameters in getVariantSequences, digestWithVariants, generatePeptides - Input modification name parameters (fixed_mods, variable_mods) in generatePeptides This enables automatic Python str ↔ C++ string conversion via autowrap's libcpp_utf8_string/libcpp_utf8_output_string types, so Python bindings now return str instead of bytes for descriptions. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Thanks for the review! Will check and fix |
|
From checking the main file requirements:
|
|
do we want to support parsing of custom keys in the header with CustomKeyDef? |
Address multiple PEFF specification compliance issues: - Write modifications under type-specific keys (ModResPsi, ModResUnimod, ModRes) instead of all under ModRes, preserving round-trip semantics - Support comma-separated positions in modification tuples per spec sections 3.3.10-3.3.12 - Implement escape-aware splitting for pipes and parentheses, handling \|, \\, \(, \) escape sequences in values - Add ProteoformDb header field (is_proteoform_db) with parsing/writing - Add DisulfideBond annotation_id field and extract annotation IDs during parsing - Validate required header keys (Prefix, DbVersion, DbSource, NumberOfEntries) with warnings - Validate ProteoformDb/HasAnnotationIdentifiers mutual exclusion - Detect duplicate keys in entry description lines - Validate VariantSimple (position>0, non-empty AA) and VariantComplex (single AA substitution must use VariantSimple) - Reject semicolon-leading lines per spec section 3.3.3 - Write AltAC as single key with parenthesized list to avoid duplicate keys - Warn on missing modification name for PSI_MOD/UNIMOD types - Warn on empty GeneralComment values - Update pyOpenMS bindings for new fields Co-Authored-By: Claude Opus 4.5 <[email protected]>
…-trip Align annotation structs with PEFF spec: - Rename sources → optional_tag on PEFFVariantSimple/Complex - Rename description → optional_tag on PEFFDisulfideBond - Rename type → accession on PEFFProcessedRegion - Remove separate description field from PEFFProcessedRegion (was OptionalTag) - Add optional_tag to PEFFModification - Change annotation_id from String to UInt across all structs - Add prefix field to PEFFEntry (extracted from >Prefix:DbUniqueId) Fix header structure: - Write File Description Block and Database Description Block as separate # //-delimited sections per spec - Merge file description block into first database block on read - Add mandatory field validation warnings on write - Remove db_date from PEFFDatabaseMetadata (not in spec) - Store unrecognized header keys (e.g. DbDate) in a map for round-trip - Add PEFFCustomKeyDef struct and parsing/writing support Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add escape_peff() helper to escape \, |, (, ) in annotation values written by formatEntry_(), ensuring round-trip fidelity for values containing PEFF reserved characters - Open write stream in binary mode (ofstream::binary) to preserve LF-only line endings on all platforms - Store unrecognized header keys (e.g. DbDate from UniProt) in a map for round-trip preservation instead of silently dropping them - Add PEFFEntry struct doc comment describing the description line format per spec: >Prefix:DbUniqueId \key=value ... - Clarify PEFFDisulfideBond id1/id2 doc comments as cysteine AnnotationIdentifier references - Document FileNotReadable exception on readStart in pyOpenMS pxd Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pyOpenMS/pxds/PEFFFile.pxd`:
- Around line 328-337: The docstring for getVariantSequences currently claims
include_complex has a default of false but the Cython binding signature requires
the argument; either add a default value to the binding signature (e.g., change
the declaration of getVariantSequences to give include_complex a default of
False) or remove the “default: false” clause from the wrap-doc so the text
matches the required parameter; update the entry for include_complex in the
wrap-doc (or the signature) to keep the documentation and function prototype
consistent.
| void getVariantSequences( | ||
| libcpp_vector[libcpp_utf8_output_string]& descriptions, | ||
| libcpp_vector[AASequence]& sequences, | ||
| bool include_complex) except + nogil | ||
| # wrap-doc: | ||
| # Get all variant sequences (each variant applied individually). | ||
| # :param descriptions: Output list for variant descriptions | ||
| # :param sequences: Output list for variant sequences | ||
| # :param include_complex: Include complex variants (default: false) | ||
|
|
There was a problem hiding this comment.
Align getVariantSequences doc with the signature.
The doc claims a default for include_complex, but the binding requires the argument. Either add a default or remove the “default: false” note to avoid confusion.
📝 Suggested doc tweak
- # :param include_complex: Include complex variants (default: false)
+ # :param include_complex: Include complex variants🤖 Prompt for AI Agents
In `@src/pyOpenMS/pxds/PEFFFile.pxd` around lines 328 - 337, The docstring for
getVariantSequences currently claims include_complex has a default of false but
the Cython binding signature requires the argument; either add a default value
to the binding signature (e.g., change the declaration of getVariantSequences to
give include_complex a default of False) or remove the “default: false” clause
from the wrap-doc so the text matches the required parameter; update the entry
for include_complex in the wrap-doc (or the signature) to keep the documentation
and function prototype consistent.
|
ok I think I addressed all comments |
| } | ||
| else if (key == "CustomKeyDef") | ||
| { | ||
| // Format: CustomKeyDef=KeyName:description (simple form) |
There was a problem hiding this comment.
This isn't a real thing.
From the spec:
CustomKeyDef=(defKey=value|defKey=value|defKey=value…)
Where there defKeys may be any combination of:
• KeyName Name of the custom key. CamelCase preferred
• Description Free text description of the custom key. Enclose in ""
• ConceptCURIE CURIE from an external CV defining the concept behind this custom key
• RegExp Regular expression that can be used to parse this custom key. Enclose in ""
• FieldNames Comma-separated list of names for the fields
• FieldTypes Comma-separated list of data types of the fields
FieldTypes should use the xsd basic types without the xs: prefix. i.e.: string, decimal, integer,
boolean, date, time. Additionally, type "enumeration(string1|string2|string3|etc.)" MAY also be used.
For example, a SecondaryStructure term MAY be defined in the header:CustomKeyDef=(KeyName=SecondaryStructure|Description="Secondary structure
information"|ConceptCURIE=BAO:0000014|RegExp="([0-9]+)|([0-9]+)|([A-Za-z]+:[0-9]+)?|(.*)
|?(.+)?"|FieldNames=StartPosition,EndPosition,CURIE,Description,OptionalTag|FieldTypes=integer,i
nteger,string,string,string)
And then, if so defined, the term MAY be used in the sequence entry description lines like this:
\SecondaryStructure=(617|673|ncithesaurus:C47937|Helix
* feat: Add PEFF (PSI Extended FASTA Format) file support Implements full PEFF format support for reading and writing protein sequence files with rich annotations. New features: - PEFFFile class with batch (load/store) and streaming APIs - Support for all PEFF annotation types: - Modifications (PSI-MOD, UNIMOD, custom) - Simple variants (single amino acid substitutions) - Complex variants (insertions, deletions, multi-residue changes) - Processed regions (signal peptides, transit peptides, etc.) - Proteoforms (ProForma notation) - Database metadata parsing (version, name, prefix, decoy flag, etc.) - AASequence integration methods: - getSequence() - unmodified sequence - getModifiedSequence() - with modifications applied - getVariantSequences() - all variant sequences - getProcessedSequence() - mature protein without signal peptide - File type detection via isPEFFFile() - pyOpenMS bindings with convenience methods Files: - PEFFFile.h/cpp - Core implementation - PEFFFile.pxd/pyx - Python bindings - PEFFFile_test.cpp - Unit tests - Test data files (*.peff) Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address PR review comments for PEFF support - Fix FileTypes_test to expect correct count (39 READABLE, 62 total) - Add PEFF test to FileHandler_test and FileTypes_test - Fix PEFFFile_test.peff \Length=50 -> \Length=49 to match sequence - Fix PEFFFile_test.cpp expected sequence_length to 49 - Fix getModifiedSequence() docs (doesn't throw, logs and skips) - Add warning log when toProForma() is called with modifications Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Implement PEFFFile::toProForma() conversion Implements full ProForma notation generation from PEFF entries: - Localised modifications: placed after the amino acid they modify - Unlocalised modifications (position 0): encoded as <?[mod]> prefix - Supports CV accessions (UNIMOD:, MOD:) and named modifications - Multiple modifications at same position supported Added comprehensive tests: - Single and multiple modifications - Unlocalised and mixed modifications - Named modifications without accessions - Round-trip verification with ProForma parser Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address remaining PR review comments for PEFF - Fix getModifiedSequence() to try accession first, then name (previously extracted unimod_id but never used it) - Remove unused formatModifications_() helper function - Add Python binding overload for getProcessedSequence() default param - Fix test to properly access ProForma variant elements Co-Authored-By: Claude Opus 4.5 <[email protected]> * docs: Add PEFF support to CHANGELOG Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Escape backslashes in Doxygen comments PEFF keywords like \PName, \GName were interpreted as Doxygen commands. Escaped with double backslash to show literal text. Co-Authored-By: Claude Opus 4.5 <[email protected]> * ci: Trigger rebuild for flaky pyopenms generation * fix: Handle vector<pair> type in Python binding for getVariantSequences Cython cannot automatically convert vector<pair<String, AASequence>> to Python. Added wrap-ignore and implemented getVariantSequences() in Python addon instead. Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add annotation identifier support to PEFF parser Add support for the PEFF HasAnnotationIdentifiers feature, which prefixes annotations with unique IDs in the format `annotationID:position`. Changes: - Add annotation_id field to PEFFModification, PEFFVariantSimple, PEFFVariantComplex, and PEFFProcessedRegion structs - Add has_annotation_identifiers flag to PEFFDatabaseMetadata - Update parse functions to detect and extract annotation IDs - Update format functions to output annotation IDs when present - Extend getVariantSequences() to optionally include complex variants Example formats supported: - Without IDs: \ModResPsi=(10|UNIMOD:35|Oxidation) - With IDs: \ModResPsi=(0:10|MOD:00046|Phosphorylation) Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add UniProt-style PEFF keywords and DisulfideBond support Add missing PEFF 1.0 specification keywords found in UniProt examples: Entry keywords: - \DbUniqueId - Unique database identifier - \ID - Entry identifier (e.g., NPM_HUMAN) - \OX - Shorthand for NcbiTaxId - \AltAC - Alternative accessions - \DisulfideBond - Disulfide bond annotations Header keywords: - # Conversion - Conversion notes - # SpecificValue - Custom value type definitions - Multiple # GeneralComment lines (changed to vector) Also includes DRY refactoring: extract annotation ID parsing into helper function (was duplicated 4 times). Co-Authored-By: Claude Opus 4.5 <[email protected]> * test: Add real UniProt P53 PEFF test file Downloaded from EBI Proteins API variation endpoint: https://www.ebi.ac.uk/proteins/api/variation/P04637?format=peff Tests parsing of: - Real UniProt PEFF format with 1000+ variants - Stop codon variants (*) - Bracketed variant sources like [ExAC][gnomAD] - Multiple GeneralComment lines Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add digestWithVariants method to PEFFEntry Add method to generate all variant peptide combinations from enzymatic digestion. The method accepts a ProteaseDigestion object (allowing any enzyme like Trypsin, Chymotrypsin, etc.) and generates all 2^k combinations of simple variants within each peptide, where k is the number of variants in that peptide's span. This per-peptide approach is more efficient than generating all 2^n protein-level combinations, making it tractable for proteins with many variants like P53 (1000+ variants). Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add modification support to digestWithVariants Extend digestWithVariants to generate modification combinations in addition to variant combinations. New parameters: - include_variants: enable/disable variant combination generation - include_modifications: enable/disable modification combination generation For each peptide with k variants and m modifications, generates up to 2^(k+m) combinations. Modifications with unknown positions (position==0) are skipped. Modification application uses ModificationsDB for lookup. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address PR review comments - Add safeguard for combinatorial explosion in digestWithVariants (limit to 20 elements = ~1M combinations max per peptide) - Add annotation_id field to Python bindings for PEFFModification, PEFFVariantSimple, PEFFVariantComplex, PEFFProcessedRegion - Add has_annotation_identifiers field to PEFFDatabaseMetadata binding - Replace bare except clause with except Exception in addon Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add generatePeptides method with variable modification support Refactor peptide generation to support additional variable modifications (like Oxidation from sample handling) on top of PEFF annotations. New method `generatePeptides()` provides a complete workflow: 1. Enzymatic digestion 2. PEFF variant enumeration (position-specific substitutions) 3. PEFF modification enumeration (position-specific PTMs) 4. Additional variable modifications via ModifiedPeptideGenerator Also adds helper method `enumeratePEFFModifications_()` to separate combinatorial logic from digestion. Example usage: ```cpp std::vector<String> sample_mods = {"Oxidation (M)", "Deamidated (N)"}; auto peptides = entry.generatePeptides( digestor, sample_mods, // additional variable mods 2, // max 2 variable mods per peptide 6, 40, // length range true, // include reference true, // include PEFF variants true // include PEFF modifications ); ``` Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add fixed modification support to generatePeptides The generatePeptides method now accepts both fixed_mods and variable_mods parameters, enabling complete sample handling modification workflows: - Fixed mods (e.g., Carbamidomethyl) are applied to all compatible residues - Variable mods (e.g., Oxidation) generate combinatorial forms Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add Python bindings for digestWithVariants and generatePeptides Implements pure Python versions of digestWithVariants() and generatePeptides() methods in the PEFFEntry addon since autowrap cannot handle the vector<pair> return type directly. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Simplify PEFFFile Python addon Reduce from 299 to 154 lines by removing verbose docstrings, dead code, and unnecessary nesting. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Use output parameters for autowrap compatibility Change getVariantSequences, digestWithVariants, and generatePeptides to use output parameters (descriptions, sequences vectors) instead of returning vector<pair<String, AASequence>>. This allows autowrap to wrap them directly without custom type converters. Python addon simplified from 154 to 37 lines - now only contains DataFrame helper methods since the core methods are wrapped directly. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Use std::string for PEFF descriptions and mod inputs Changes C++ API to use std::string instead of OpenMS::String for: - Output description parameters in getVariantSequences, digestWithVariants, generatePeptides - Input modification name parameters (fixed_mods, variable_mods) in generatePeptides This enables automatic Python str ↔ C++ string conversion via autowrap's libcpp_utf8_string/libcpp_utf8_output_string types, so Python bindings now return str instead of bytes for descriptions. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address review issues in PEFFFile - Add toProForma() to Python bindings (was missing from pxd) - Fix var_combo==0 logic to allow mods-only peptides when include_reference=false - Add combined cap for variants+PEFF mods (was capped independently) - Add conflict detection for multiple variants at same position - Add file open verification in readStart() - Fix header parsing to not treat bare '#' as DB separator - Replace unused <regex> include with <set> Combinatorial limits (per peptide): - digestWithVariants(): 2^20 (~1M) combinations from variants+PEFF mods - generatePeptides(): 2^20 PEFF combinations × variable mod combinations (variable mods controlled by max_variable_mods_per_peptide parameter) Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address CodeRabbit review nitpicks - Document FileNotReadable exception in readStart() Doxygen - Use Size instead of int for chunk count in formatEntry_ - Replace std::endl with \n in logging for better performance Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address additional CodeRabbit review comments - Add warning when modification lookup fails silently (neither accession nor name could be resolved) in getModifiedSequence() - Fix tuple serialization to preserve empty intermediate fields (ModRes and Processed now emit placeholder separators when later fields exist) - Add PEFFModification::Type enum (PSI_MOD, UNIMOD, GENERIC) to Python bindings with type field exposed Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Fix RST docstring formatting in Peptidoform addons The multi-line ion_types parameter description was causing RST parsing errors due to unexpected indentation. Consolidated to single-line format. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Filter reference peptide from generatePeptides when include_reference=false When include_reference=false and there are PEFF modifications, enumeratePEFFModifications_ returns all 2^n combinations including combo=0 (no mods applied), which is the unmodified reference peptide. This fix filters out the base entry after enumeration to prevent the reference peptide from appearing in the output. Co-Authored-By: Claude Opus 4.5 <[email protected]> * test: Add regression test for generatePeptides reference filtering Tests that when include_reference=false and there are PEFF modifications, the unmodified reference peptide does not appear in the output. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: PEFF spec compliance fixes for parsing, writing, and validation Address multiple PEFF specification compliance issues: - Write modifications under type-specific keys (ModResPsi, ModResUnimod, ModRes) instead of all under ModRes, preserving round-trip semantics - Support comma-separated positions in modification tuples per spec sections 3.3.10-3.3.12 - Implement escape-aware splitting for pipes and parentheses, handling \|, \\, \(, \) escape sequences in values - Add ProteoformDb header field (is_proteoform_db) with parsing/writing - Add DisulfideBond annotation_id field and extract annotation IDs during parsing - Validate required header keys (Prefix, DbVersion, DbSource, NumberOfEntries) with warnings - Validate ProteoformDb/HasAnnotationIdentifiers mutual exclusion - Detect duplicate keys in entry description lines - Validate VariantSimple (position>0, non-empty AA) and VariantComplex (single AA substitution must use VariantSimple) - Reject semicolon-leading lines per spec section 3.3.3 - Write AltAC as single key with parenthesized list to avoid duplicate keys - Warn on missing modification name for PSI_MOD/UNIMOD types - Warn on empty GeneralComment values - Update pyOpenMS bindings for new fields Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: PEFF spec compliance for struct fields, header blocks, and round-trip Align annotation structs with PEFF spec: - Rename sources → optional_tag on PEFFVariantSimple/Complex - Rename description → optional_tag on PEFFDisulfideBond - Rename type → accession on PEFFProcessedRegion - Remove separate description field from PEFFProcessedRegion (was OptionalTag) - Add optional_tag to PEFFModification - Change annotation_id from String to UInt across all structs - Add prefix field to PEFFEntry (extracted from >Prefix:DbUniqueId) Fix header structure: - Write File Description Block and Database Description Block as separate # //-delimited sections per spec - Merge file description block into first database block on read - Add mandatory field validation warnings on write - Remove db_date from PEFFDatabaseMetadata (not in spec) - Store unrecognized header keys (e.g. DbDate) in a map for round-trip - Add PEFFCustomKeyDef struct and parsing/writing support Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Add PEFF escape on write, binary mode output, and doc improvements - Add escape_peff() helper to escape \, |, (, ) in annotation values written by formatEntry_(), ensuring round-trip fidelity for values containing PEFF reserved characters - Open write stream in binary mode (ofstream::binary) to preserve LF-only line endings on all platforms - Store unrecognized header keys (e.g. DbDate from UniProt) in a map for round-trip preservation instead of silently dropping them - Add PEFFEntry struct doc comment describing the description line format per spec: >Prefix:DbUniqueId \key=value ... - Clarify PEFFDisulfideBond id1/id2 doc comments as cysteine AnnotationIdentifier references - Document FileNotReadable exception on readStart in pyOpenMS pxd Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Sync pyOpenMS PEFFFile.pxd bindings with C++ struct changes Co-Authored-By: Claude Opus 4.5 <[email protected]> * [FIX,API,TEST] PEFF: CustomKeyDef validation + multi-db writing --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
* feat: Add PEFF (PSI Extended FASTA Format) file support Implements full PEFF format support for reading and writing protein sequence files with rich annotations. New features: - PEFFFile class with batch (load/store) and streaming APIs - Support for all PEFF annotation types: - Modifications (PSI-MOD, UNIMOD, custom) - Simple variants (single amino acid substitutions) - Complex variants (insertions, deletions, multi-residue changes) - Processed regions (signal peptides, transit peptides, etc.) - Proteoforms (ProForma notation) - Database metadata parsing (version, name, prefix, decoy flag, etc.) - AASequence integration methods: - getSequence() - unmodified sequence - getModifiedSequence() - with modifications applied - getVariantSequences() - all variant sequences - getProcessedSequence() - mature protein without signal peptide - File type detection via isPEFFFile() - pyOpenMS bindings with convenience methods Files: - PEFFFile.h/cpp - Core implementation - PEFFFile.pxd/pyx - Python bindings - PEFFFile_test.cpp - Unit tests - Test data files (*.peff) Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address PR review comments for PEFF support - Fix FileTypes_test to expect correct count (39 READABLE, 62 total) - Add PEFF test to FileHandler_test and FileTypes_test - Fix PEFFFile_test.peff \Length=50 -> \Length=49 to match sequence - Fix PEFFFile_test.cpp expected sequence_length to 49 - Fix getModifiedSequence() docs (doesn't throw, logs and skips) - Add warning log when toProForma() is called with modifications Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Implement PEFFFile::toProForma() conversion Implements full ProForma notation generation from PEFF entries: - Localised modifications: placed after the amino acid they modify - Unlocalised modifications (position 0): encoded as <?[mod]> prefix - Supports CV accessions (UNIMOD:, MOD:) and named modifications - Multiple modifications at same position supported Added comprehensive tests: - Single and multiple modifications - Unlocalised and mixed modifications - Named modifications without accessions - Round-trip verification with ProForma parser Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address remaining PR review comments for PEFF - Fix getModifiedSequence() to try accession first, then name (previously extracted unimod_id but never used it) - Remove unused formatModifications_() helper function - Add Python binding overload for getProcessedSequence() default param - Fix test to properly access ProForma variant elements Co-Authored-By: Claude Opus 4.5 <[email protected]> * docs: Add PEFF support to CHANGELOG Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Escape backslashes in Doxygen comments PEFF keywords like \PName, \GName were interpreted as Doxygen commands. Escaped with double backslash to show literal text. Co-Authored-By: Claude Opus 4.5 <[email protected]> * ci: Trigger rebuild for flaky pyopenms generation * fix: Handle vector<pair> type in Python binding for getVariantSequences Cython cannot automatically convert vector<pair<String, AASequence>> to Python. Added wrap-ignore and implemented getVariantSequences() in Python addon instead. Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add annotation identifier support to PEFF parser Add support for the PEFF HasAnnotationIdentifiers feature, which prefixes annotations with unique IDs in the format `annotationID:position`. Changes: - Add annotation_id field to PEFFModification, PEFFVariantSimple, PEFFVariantComplex, and PEFFProcessedRegion structs - Add has_annotation_identifiers flag to PEFFDatabaseMetadata - Update parse functions to detect and extract annotation IDs - Update format functions to output annotation IDs when present - Extend getVariantSequences() to optionally include complex variants Example formats supported: - Without IDs: \ModResPsi=(10|UNIMOD:35|Oxidation) - With IDs: \ModResPsi=(0:10|MOD:00046|Phosphorylation) Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add UniProt-style PEFF keywords and DisulfideBond support Add missing PEFF 1.0 specification keywords found in UniProt examples: Entry keywords: - \DbUniqueId - Unique database identifier - \ID - Entry identifier (e.g., NPM_HUMAN) - \OX - Shorthand for NcbiTaxId - \AltAC - Alternative accessions - \DisulfideBond - Disulfide bond annotations Header keywords: - # Conversion - Conversion notes - # SpecificValue - Custom value type definitions - Multiple # GeneralComment lines (changed to vector) Also includes DRY refactoring: extract annotation ID parsing into helper function (was duplicated 4 times). Co-Authored-By: Claude Opus 4.5 <[email protected]> * test: Add real UniProt P53 PEFF test file Downloaded from EBI Proteins API variation endpoint: https://www.ebi.ac.uk/proteins/api/variation/P04637?format=peff Tests parsing of: - Real UniProt PEFF format with 1000+ variants - Stop codon variants (*) - Bracketed variant sources like [ExAC][gnomAD] - Multiple GeneralComment lines Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add digestWithVariants method to PEFFEntry Add method to generate all variant peptide combinations from enzymatic digestion. The method accepts a ProteaseDigestion object (allowing any enzyme like Trypsin, Chymotrypsin, etc.) and generates all 2^k combinations of simple variants within each peptide, where k is the number of variants in that peptide's span. This per-peptide approach is more efficient than generating all 2^n protein-level combinations, making it tractable for proteins with many variants like P53 (1000+ variants). Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add modification support to digestWithVariants Extend digestWithVariants to generate modification combinations in addition to variant combinations. New parameters: - include_variants: enable/disable variant combination generation - include_modifications: enable/disable modification combination generation For each peptide with k variants and m modifications, generates up to 2^(k+m) combinations. Modifications with unknown positions (position==0) are skipped. Modification application uses ModificationsDB for lookup. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address PR review comments - Add safeguard for combinatorial explosion in digestWithVariants (limit to 20 elements = ~1M combinations max per peptide) - Add annotation_id field to Python bindings for PEFFModification, PEFFVariantSimple, PEFFVariantComplex, PEFFProcessedRegion - Add has_annotation_identifiers field to PEFFDatabaseMetadata binding - Replace bare except clause with except Exception in addon Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add generatePeptides method with variable modification support Refactor peptide generation to support additional variable modifications (like Oxidation from sample handling) on top of PEFF annotations. New method `generatePeptides()` provides a complete workflow: 1. Enzymatic digestion 2. PEFF variant enumeration (position-specific substitutions) 3. PEFF modification enumeration (position-specific PTMs) 4. Additional variable modifications via ModifiedPeptideGenerator Also adds helper method `enumeratePEFFModifications_()` to separate combinatorial logic from digestion. Example usage: ```cpp std::vector<String> sample_mods = {"Oxidation (M)", "Deamidated (N)"}; auto peptides = entry.generatePeptides( digestor, sample_mods, // additional variable mods 2, // max 2 variable mods per peptide 6, 40, // length range true, // include reference true, // include PEFF variants true // include PEFF modifications ); ``` Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add fixed modification support to generatePeptides The generatePeptides method now accepts both fixed_mods and variable_mods parameters, enabling complete sample handling modification workflows: - Fixed mods (e.g., Carbamidomethyl) are applied to all compatible residues - Variable mods (e.g., Oxidation) generate combinatorial forms Co-Authored-By: Claude Opus 4.5 <[email protected]> * feat: Add Python bindings for digestWithVariants and generatePeptides Implements pure Python versions of digestWithVariants() and generatePeptides() methods in the PEFFEntry addon since autowrap cannot handle the vector<pair> return type directly. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Simplify PEFFFile Python addon Reduce from 299 to 154 lines by removing verbose docstrings, dead code, and unnecessary nesting. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Use output parameters for autowrap compatibility Change getVariantSequences, digestWithVariants, and generatePeptides to use output parameters (descriptions, sequences vectors) instead of returning vector<pair<String, AASequence>>. This allows autowrap to wrap them directly without custom type converters. Python addon simplified from 154 to 37 lines - now only contains DataFrame helper methods since the core methods are wrapped directly. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: Use std::string for PEFF descriptions and mod inputs Changes C++ API to use std::string instead of OpenMS::String for: - Output description parameters in getVariantSequences, digestWithVariants, generatePeptides - Input modification name parameters (fixed_mods, variable_mods) in generatePeptides This enables automatic Python str ↔ C++ string conversion via autowrap's libcpp_utf8_string/libcpp_utf8_output_string types, so Python bindings now return str instead of bytes for descriptions. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address review issues in PEFFFile - Add toProForma() to Python bindings (was missing from pxd) - Fix var_combo==0 logic to allow mods-only peptides when include_reference=false - Add combined cap for variants+PEFF mods (was capped independently) - Add conflict detection for multiple variants at same position - Add file open verification in readStart() - Fix header parsing to not treat bare '#' as DB separator - Replace unused <regex> include with <set> Combinatorial limits (per peptide): - digestWithVariants(): 2^20 (~1M) combinations from variants+PEFF mods - generatePeptides(): 2^20 PEFF combinations × variable mod combinations (variable mods controlled by max_variable_mods_per_peptide parameter) Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address CodeRabbit review nitpicks - Document FileNotReadable exception in readStart() Doxygen - Use Size instead of int for chunk count in formatEntry_ - Replace std::endl with \n in logging for better performance Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Address additional CodeRabbit review comments - Add warning when modification lookup fails silently (neither accession nor name could be resolved) in getModifiedSequence() - Fix tuple serialization to preserve empty intermediate fields (ModRes and Processed now emit placeholder separators when later fields exist) - Add PEFFModification::Type enum (PSI_MOD, UNIMOD, GENERIC) to Python bindings with type field exposed Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Fix RST docstring formatting in Peptidoform addons The multi-line ion_types parameter description was causing RST parsing errors due to unexpected indentation. Consolidated to single-line format. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Filter reference peptide from generatePeptides when include_reference=false When include_reference=false and there are PEFF modifications, enumeratePEFFModifications_ returns all 2^n combinations including combo=0 (no mods applied), which is the unmodified reference peptide. This fix filters out the base entry after enumeration to prevent the reference peptide from appearing in the output. Co-Authored-By: Claude Opus 4.5 <[email protected]> * test: Add regression test for generatePeptides reference filtering Tests that when include_reference=false and there are PEFF modifications, the unmodified reference peptide does not appear in the output. Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: PEFF spec compliance fixes for parsing, writing, and validation Address multiple PEFF specification compliance issues: - Write modifications under type-specific keys (ModResPsi, ModResUnimod, ModRes) instead of all under ModRes, preserving round-trip semantics - Support comma-separated positions in modification tuples per spec sections 3.3.10-3.3.12 - Implement escape-aware splitting for pipes and parentheses, handling \|, \\, \(, \) escape sequences in values - Add ProteoformDb header field (is_proteoform_db) with parsing/writing - Add DisulfideBond annotation_id field and extract annotation IDs during parsing - Validate required header keys (Prefix, DbVersion, DbSource, NumberOfEntries) with warnings - Validate ProteoformDb/HasAnnotationIdentifiers mutual exclusion - Detect duplicate keys in entry description lines - Validate VariantSimple (position>0, non-empty AA) and VariantComplex (single AA substitution must use VariantSimple) - Reject semicolon-leading lines per spec section 3.3.3 - Write AltAC as single key with parenthesized list to avoid duplicate keys - Warn on missing modification name for PSI_MOD/UNIMOD types - Warn on empty GeneralComment values - Update pyOpenMS bindings for new fields Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: PEFF spec compliance for struct fields, header blocks, and round-trip Align annotation structs with PEFF spec: - Rename sources → optional_tag on PEFFVariantSimple/Complex - Rename description → optional_tag on PEFFDisulfideBond - Rename type → accession on PEFFProcessedRegion - Remove separate description field from PEFFProcessedRegion (was OptionalTag) - Add optional_tag to PEFFModification - Change annotation_id from String to UInt across all structs - Add prefix field to PEFFEntry (extracted from >Prefix:DbUniqueId) Fix header structure: - Write File Description Block and Database Description Block as separate # //-delimited sections per spec - Merge file description block into first database block on read - Add mandatory field validation warnings on write - Remove db_date from PEFFDatabaseMetadata (not in spec) - Store unrecognized header keys (e.g. DbDate) in a map for round-trip - Add PEFFCustomKeyDef struct and parsing/writing support Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Add PEFF escape on write, binary mode output, and doc improvements - Add escape_peff() helper to escape \, |, (, ) in annotation values written by formatEntry_(), ensuring round-trip fidelity for values containing PEFF reserved characters - Open write stream in binary mode (ofstream::binary) to preserve LF-only line endings on all platforms - Store unrecognized header keys (e.g. DbDate from UniProt) in a map for round-trip preservation instead of silently dropping them - Add PEFFEntry struct doc comment describing the description line format per spec: >Prefix:DbUniqueId \key=value ... - Clarify PEFFDisulfideBond id1/id2 doc comments as cysteine AnnotationIdentifier references - Document FileNotReadable exception on readStart in pyOpenMS pxd Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: Sync pyOpenMS PEFFFile.pxd bindings with C++ struct changes Co-Authored-By: Claude Opus 4.5 <[email protected]> * [FIX,API,TEST] PEFF: CustomKeyDef validation + multi-db writing --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
Summary
Implements full PEFF (PSI Extended FASTA Format) support in OpenMS, enabling reading and writing of protein sequence files with rich annotations for modifications, variants, processed regions, and proteoforms.
Key Features
load/store) and streaming (readStart/readNext/writeStart/writeNext/writeEnd) APIsisPEFFFile()static methodC++ Usage Examples
Loading a PEFF File (Batch)
Loading a PEFF File (Streaming)
Writing a PEFF File (Batch)
Writing a PEFF File (Streaming)
Working with Modifications
Working with Variants
Working with Processed Regions
Digest with Variant Enumeration
Generate Peptides with Sample Modifications
ProForma Conversion
File Type Detection
FASTA Interoperability
pyOpenMS Usage Examples
Loading a PEFF File (Batch)
Loading a PEFF File (Streaming)
Writing a PEFF File
Working with Modifications
Working with Variants
Digest with Variant Enumeration
Generate Peptides with Sample Modifications
ProForma Conversion
File Type Detection
Complete Workflow Example
Combinatorial Limits
To prevent memory issues, the following limits are enforced:
Files Added/Modified
PEFFFile.hPEFFFile.cppPEFFFile.pxdPEFFFile.pyxPEFFFile_test.cppPEFFFile_*.peffFileTypes.h/cppsources.cmakeTest plan
ctest --test-dir OpenMS-build -R PEFFFileReferences
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Python
Tests
✏️ Tip: You can customize this high-level summary in your review settings.