A TypeScript implementation of the mzPeak file format. (work-in-progress)
This is an implementation of mzPeak that reads data in the browser and over the network. It provides (relatively) fast random access over data files, and handles quick access to metadata on-demand. All processing happens within the client, no backend server needed.
This is not a wrapper around an implementation in another language. This uses pre-existing JavaScript and WASM libraries to work with ZIP, Parquet, and Arrow, with all the gory details of mzPeak implemented directly in TypeScript. This work would not have been possible without:
parquet-wasm: https://github.com/kylebarron/parquet-wasmapache-arrow: https://arrow.apache.org/js/current/zip.js: https://github.com/gildas-lormeau/zip.js/
Try out the demo application for reading mzPeak files and visualizing their contents
Assuming you are running this in a web browser with a static asset hosted /static/small.mzpeak
import { MzPeakReader, Spectrum } from "mzpeakts"
const reader = await MzPeakReader.fromUrl("/static/small.mzpeak")
const spec = await reader.getSpectrum(0)
console.log(spec.id, spec.index, spec.dataArrays)
const ms2Spec = await reader.getSpectrum(3)
console.log(spec.id, spec.index, spec.dataArrays, spec.precursors, spec.selectedIons)- Reading
- Array indices
- File-level metadata
- Spectrum metadata
- Chromatogram metadata
- Spectrum data arrays
- Point Layout
- Chunked Layout
- Basic encoding
- Delta encoding
- Numpress and opaque chunk transforms
- Chromatogram data arrays
- Spectrum peak arrays
- Auxiliary arrays
- ZIP archive storage
- Directory storage