npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

jaspagate

v0.1.7

Published

Read and save objects in the takane format. This is a Javascript equivalent to the alabaster (R) and dolomite (Python) frameworks.

Downloads

32

Readme

Read and save takane objects in Javascript

Unit tests Build docs NPM Version

Overview

The jaspagate package provides methods for reading and saving takane-formatted objects in Javascript. This enables web applications to interoperate with R and Python workflows involving complex data structures like the SummarizedExperiment. For example, kana can use jaspagate to pull datasets managed by the scRNAseq R package; conversely, analysis results can be downloaded for further inspection in Python via the dolomite framework.

Getting started

First, we have to tell jaspagate how to read and write a HDF5 file. This requires application-specific implementations of the H5Group and H5DataSet interfaces. For example, we could use the h5wasm package (as shown in tests/h5.js) or the HDF5-reading utilities in scran.js. The exact implementation is left to the application developer to ensure that only one copy of the HDF5-parsing library (typically a WebAssembly binary) is bundled into the application.

We then define a globals object that specifies how to open a "file" in our Javascript-based application. This should implement the GlobalFsInterface and GlobalH5Interface interfaces. In a backend environment like Node.js, setting up this object is pretty easy as described in tests/globals.js. For the browser, the process of acquiring a file path is more involved as direct access to the filesystem is not typically allowed; instead, we need to either return the contents of the file as a Uint8Array or write to a virtual filesystem.

Phew. Once we've done all that, we can finally read our objects.

import * as jsp from "jaspagate";
let obj = await jsp.readObject(path, /* metadata = */ null, globals);
await jsp.saveObject(obj, "new/copy/of/object", globals);

Check out the reference documentation for more details.

Supported objects

Currently, we only support a small number of takane formats.

  • list objects are loaded as List instances.
  • data_frame objects are loaded as DataFrame instances, with the following caveats:
    • Annotations on the columns are not loaded.
  • summarized_experiment objects are loaded as SummarizedExperiment instances, with the following caveats:
    • To read or save assays, each application should define and register their own functions in readObjectRegistry and saveObjectRegistry. This ensures that large datasets are directly converted to application-specific representations for optimal efficiency.
  • ranged_summarized_experiment objects are loaded as RangedSummarizedExperiment instances, with the following caveats:
    • Everything mentioned for summarized_experiment.
    • Non-empty row ranges are not loaded or saved.
  • single_cell_experiment objects are loaded as SingleCellExperiment instances, with the following caveats:
    • Everything mentioned for ranged_summarized_experiment.

If you need something for your application, make an issue and we'll see what we can do.

Links

The takane specifications, which describe the file representation of each object.

The alabaster.base R package, to read and write takane-formatted objects in R.

The dolomite-base Python package, to read and write takane-formatted objects in Python.