Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mzpeakts

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:

  1. parquet-wasm: https://github.com/kylebarron/parquet-wasm
  2. apache-arrow: https://arrow.apache.org/js/current/
  3. zip.js: https://github.com/gildas-lormeau/zip.js/

Demo

Try out the demo application for reading mzPeak files and visualizing their contents

Library Usage

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)

Status

  • 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

About

A TypeScript implementation of mzPeak

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages