Skip to content

Replace numeric UUID with RFC 4122 UUID in QPX metadata - #8757

Merged
timosachsenberg merged 2 commits into
feature/rename-quantmsio-to-qpxfilefrom
copilot/sub-pr-8756
Feb 12, 2026
Merged

timosachsenberg merged 2 commits into
feature/rename-quantmsio-to-qpxfilefrom
copilot/sub-pr-8756

Conversation

Copilot AI commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor

The QPX file metadata "uuid" field was using UniqueIdGenerator::getUniqueId() which produces a numeric UInt64 string instead of a proper RFC 4122 UUID format compatible with Python's uuid.uuid4().

Changes

  • Replace UniqueIdGenerator::getUniqueId() with boost::uuids::random_generator() in QPX Parquet metadata generation
  • Add Boost UUID headers (boost/uuid/uuid.hpp, boost/uuid/uuid_generators.hpp, boost/uuid/uuid_io.hpp)
  • Generate RFC 4122 compliant UUID strings (e.g., 550e8400-e29b-41d4-a716-446655440000) instead of numeric values

Before:

{"uuid", String(UniqueIdGenerator::getUniqueId())}  // "12345678901234567890"

After:

boost::uuids::random_generator uuid_gen;
boost::uuids::uuid uuid = uuid_gen();
std::string uuid_str = boost::uuids::to_string(uuid);
{"uuid", uuid_str}  // "550e8400-e29b-41d4-a716-446655440000"

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Rename QuantmsIO to QPXFile with new QPX implementation Replace numeric UUID with RFC 4122 UUID in QPX metadata Feb 12, 2026
@timosachsenberg
timosachsenberg marked this pull request as ready for review February 12, 2026 20:12
@timosachsenberg
timosachsenberg merged commit f5c95e3 into feature/rename-quantmsio-to-qpxfile Feb 12, 2026
1 check passed
@timosachsenberg
timosachsenberg deleted the copilot/sub-pr-8756 branch February 12, 2026 20:12
timosachsenberg added a commit that referenced this pull request Feb 13, 2026
* Rename QuantmsIO to QPXFile and rewrite with new QPX implementation

Replace the old QuantmsIO class and QuantmsIOConverter TOPP tool with
QPXFile and QPXConverter, using the newer QPX export pattern from
ConsensusMapArrowExport. Key improvements over the old QuantmsIO:

- ProForma canonical peptidoform notation (not bracket substitution)
- Structured modifications with UniMod accessions
  (list<struct{name, accession, positions}>)
- Structured additional_scores with higher_better flag
  (list<struct{score_name, score_value, higher_better}>)
- protein_accessions as list<utf8> (not comma-separated string)
- float64 precision for PEP, calculated_mz, observed_mz, rt
- calculated_mz via seq.getMZ(charge) (correct m/z calculation)
- Scan extraction from native IDs via SpectrumNativeIDParser
- Nullable is_decoy (null when target_decoy metavalue missing)
- predicted_rt and ion_mobility from metavalues
- psm_metavalues and spectrum_metavalues structured columns
- OpenMS-specific columns: spectrum_reference, score, score_type,
  rank (0-based), P_ID
- QPX file metadata in Parquet key-value metadata matching
  Python to_psm_qpx() output
- Static API (exportToArrow/exportToParquet) matching
  ConsensusMapArrowExport pattern
- ParquetWriteConfig support with ZSTD compression
- Builder capacity reservation for OOM safety

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Address CodeRabbit review: use OpenMS APIs, add NaN guard, add pyOpenMS .pxd

- Replace std::gmtime/std::random with DateTime::now() and UniqueIdGenerator
- Add NaN guard for observed_mz matching RT handling
- Fix ProForma test assertion to check for bracket notation
- Add QPXFile.pxd for pyOpenMS bindings

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Add QPXFile.h to header sources.cmake and fix pxd exclusion filter

QPXFile.h was missing from the header sources.cmake (WITH_PARQUET block),
causing pyOpenMS wheel builds to fail with "No such file or directory".
Also update the pxd exclusion filter to skip QPXFile.pxd when WITH_PARQUET
is disabled.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Replace numeric UUID with RFC 4122 UUID in QPX metadata (#8757)

* Initial plan

* Replace numeric UUID with RFC 4122 UUID using Boost

Co-authored-by: timosachsenberg <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: timosachsenberg <[email protected]>

* Add DateTime::nowUTC() and use UTC for QPXFile creation_date metadata

The creation_date field in QPX parquet metadata now uses UTC with an
ISO 8601 'Z' suffix instead of ambiguous local time.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: replace Boost UUID with std::random to fix Windows build

Boost's uuid::random_generator requires bcrypt.lib on Windows, causing
LNK2019 linker errors. Use standard C++ <random> for UUID v4 generation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

2 participants