Indexed gzip¶
Helpers for creating and detecting self-indexed .mzML.gz files. index_gzip is an alias
of write_indexed_gzip.
mzmlpy.write_indexed_gzip
¶
write_indexed_gzip(
source: str | Path,
output: str | Path,
*,
compression_level: int = 6
) -> IndexedGzipWriteResult
Create a deterministic, pyMZML-compatible self-indexed .mzML.gz file.
The input may be plain mzML or gzip-compressed mzML. Memory use depends on the largest XML section plus the embedded index. Gzip input is decompressed once to a temporary spool so the index can be sized before the output header is written.
Source code in src/mzmlpy/embedded_indexed_gzip.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | |
mzmlpy.is_embedded_indexed_gzip
¶
Return whether a gzip file starts with the pyMZML FU version 1 marker.
Source code in src/mzmlpy/embedded_indexed_gzip.py
mzmlpy.IndexedGzipWriteResult
dataclass
¶
IndexedGzipWriteResult(
output_path: Path,
spectrum_count: int,
chromatogram_count: int,
member_count: int,
index_entry_count: int,
)
Summary returned after creating a self-indexed gzip file.
AccessStrategy¶
The concrete storage route a reader chose, reported by Mzml.access_strategy.
mzmlpy.AccessStrategy
¶
Bases: StrEnum
Concrete storage strategy selected for an mzML reader.