Git Product home page Git Product logo

aioli's Introduction

biowasm logo

biowasm

Tests Deploy

A repository of genomics tools, compiled from C/C++ to WebAssembly so they can run in a web browser.

Getting started

Who uses biowasm?

Tool Why biowasm?
sandbox.bio Runs command-line tools in the browser to power interactive tutorials
42basepairs Runs samtools, bedtools, bcftools and other tools to preview genomic files
CZ ID (repo) Runs htsfile and seqtk to identify data issues before file upload
Nanopore Runs samtools to generate .bam files after basecalling in the browser
ViralWasm (repo) Runs minimap2 and ViralConsensus for viral molecular epidemiology analysis
Datagrok (repo) Runs kalign in the browser for multiple-sequence alignment analysis
bedqc (repo) Runs bedtools in the browser to validate BED files
Ribbon (repo) Runs samtools in the browser to parse, estimate coverage and subsample BAM files
fastq.bio (repo) Runs fastp in the browser to evaluate sequencing data quality

How it works

Tool Description Link
biowasm Recipes for compiling C/C++ genomics tools to WebAssembly This repo
biowasm CDN Free server hosting pre-compiled tools for use in your apps biowasm.com/cdn
Aioli Tool for running these modules in a browser, inside WebWorkers biowasm/aioli

Logo

Contributing

See CONTRIBUTING.md.

aioli's People

Contributors

daniel-ji avatar dependabot[bot] avatar robertaboukhalil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aioli's Issues

Deleting/unmounting files

RAM usage becomes a problem for my project after processing some files. I would appreciate if I had an option to delete files that are not needed any more. How do folks usually handle this?

Ability to provide custom arguments for main()

Currently, Aioli assumes arguments are space-separated, but it would be useful to have a way to explicitly provide Aioli with an array of arguments to use when calling the C module's main() function.

Mounting a Blob fails

Mounting a Blob currently fails with error TypeError: path is undefined.

This is because Emscripten FS treats File and Blob objects separately, so instead of

FS.mount(WORKERFS, { files: [ <File or Blob object here>, ... ] }, DIR_DATA_FILES);

we need:

FS.mount(WORKERFS, {
  files: [ <File object here>, ... ],
  blobs: [{ name: "blobName", data: <Blob object here> }, ...],
}, DIR_DATA_FILES);

Documentation

Testing aioli; module cannot be found.

I was writing some tests (RTL-JEST) for some components that imported Aioli.

Jest kept throwing errors that it could not find biowasm/aioli/aioli.js

When I looked at the package.json for biowasm/aioli main seems to be pointing aioli.js in the root directory. When I redirected it to the script in dist/ it was fine.

i.e. it is currently;

  "name": "@biowasm/aioli",
  "version": "2.4.0",
  "description": "A framework for building WebAssembly-based genomics tools",
  "browser": "dist/aioli.js",
  "worker": "dist/aioli.worker.js",
  main": "aioli.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/biowasm/aioli.git"
  },

I believe it should be:

"main": "dist/aioli.js",

[Aioli v2] Update README

  • Update README
  • Validate examples in the README once CDN v2 deployed
  • Add examples of file system commands (ls, cat)
  • Add example of loading multiple tools and using the output of 1 tool as the input of another
  • Mention additional options, e.g. printInterleaved
  • Mention how to run tests

Speed up initialization times

Currently, Aioli fetches config.json files serially while initializing each WebAssembly module. We could save some time if we preloaded all config.json files in parallel.

The same could be done with the .wasm / .js files

[Aioli v2] Main logic

  • Use Comlink for WebWorker management
  • Use wasm-feature-detect to detect support WebAssembly features
  • Add Cypress tests
  • Setup Rollup for bundling the library
  • Create WORKERFS filesystem for local files specified by the user
  • Create PROXYFS filesystem on base module that every tool mounts
  • Create PROXYFS filesystem that points each tool to other tools' preloaded data files
  • Support initializing with "samtools/1.10" in addition to object with custom URLs
  • Logic for .init()
  • Logic for .exec()
  • Logic for .mount()
  • Fix issues around creating a WebWorker with a script on the same origin
  • Add ability to interleave stdout/stderr
  • Deploy 2.0.0 to npm

(Details: biowasm/biowasm#48)

Mounting File object returns duplicate paths

The mount() function returns duplicate paths if we mount File objects.

Example:

const file = new File(["foo"], "file.name");
await CLI.mount(file);

// Returns [ "/shared/data/file.name", "/shared/data/file.name" ]
// instead of [ "/shared/data/file.name" ]

because of a duplicate mountedPaths.push() here

Mounting a URL fails

Mounting a URL fails because of a typo here:

name = name || url.split("").pop();

should be:

name = name || file.split("").pop();

Default to latest tool version if one is not specified

Currently, you need to explicitly specify the tool version you want to initialize:

let samtools = new Aioli("samtools/1.10");

Ideally, this would work too:

let samtools = new Aioli("samtools");

and default to the latest. This probably involves changes to cdn.sandbox.bio

Add support for Asyncify

Currently, if Asyncify is enabled, Aioli will correctly run the Asyncify-ed code but it won't return the stdout/stderr of what happens after e.g. emscripten_sleep() is called.

To address this, exec() inside aioli.worker.js should be updated to return a Promise if Asyncify is enabled.

Ability to lazy-load WebAssembly modules

Currently, we need to download all WebAssembly modules at initialization time, even if we don't necessarily need to use all of them. It would be useful to be able to denote certain tools as "lazy loaded" so that they are only downloaded when we are about to use them.

An example use case is sandbox.bio, where it would be useful to have access to a lot of tools, but where we don't want to necessary load them all at once at page load.

Add option to send custom FS commands

Currently, Aioli only supports file system commands such as ls and cat.

It would be useful to have a generic command that could be sent to an Aioli WebWorker for executing any supported Emscripten FS command (documentation).

Add support for sending in-progress messages to main thread

Currently, when using Aioli to send a message to a WebWorker, the WebWorker can only return data once before the Promise is resolved. However, there are many cases in which it would be useful for the WebWorker to regularly send status updates (e.g. send updates during a long computation) and only resolve the Promise once the last message is sent.

Implementation Sketch: Support sending 3 types of messages from WebWorker to main thread. Currently accept: resolve or reject; should also accept callback, which doesn't resolve the Promise.

Add option to disable using CDN

By default, Aioli uses the cdn.sandbox.bio CDN for convenience.

For users who need to self-host their files, add an option for specifying a custom path for the aioli.worker.js file, and the path to a WebAssembly module's .js/.wasm/.data files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.