What is this?
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/
Demo
Try out the demo application for reading mzPeak files and visualizing their contentsExample files
- Small, point layout: small.mzpeak
- Small, chunked layout: small.chunked.mzpeak
Usage
import { MzPeakReader, Spectrum } from "mzpeakts"
// Use the current window's context to find the file relative to this page.
const reader = await MzPeakReader.fromUrl("static/small.mzpeak")
const spec: Spectrum = await reader.getSpectrum(0)
console.log(spec.id, spec.index, spec.dataArrays)