diff --git a/README.md b/README.md index b0f1ea3..61a31f9 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,44 @@ [![npm](https://img.shields.io/npm/v/@biowasm/aioli)](https://www.npmjs.com/package/@biowasm/aioli) -Aioli is a library for running genomics command-line tools in the browser using WebAssembly. The WebAssembly modules are obtained from the [biowasm](https://github.com/biowasm/biowasm) CDN. +Aioli is a library for running genomics command-line tools in the browser using WebAssembly. + +The WebAssembly modules are hosted on the [biowasm](https://github.com/biowasm/biowasm) CDN. ## Getting Started +Check out [biowasm.com](https://biowasm.com/) for a REPL environment. + ### A simple example -Running the genomics tool `samtools` on a small file: +Running `samtools` in the browser: ```html ``` +Note: you can simply copy-paste the code above into a text editor, save it as a `.html` file and load it in your browser with no setup! + ### Load multiple tools -Aioli supports running multiple bioinformatics tools at once: +Aioli supports running multiple tools at once: ```html ``` -### Working with user files +### Working with user-provided files -We can update the previous example to run `samtools` on a file provided by the user: +Here we ask the user to provide a local file and we run `samtools` on it: ```html @@ -74,6 +83,55 @@ document.getElementById("myfile").addEventListener("change", runSamtools, false) ``` +### Working with large remote files + +You can even mount URLs (as long as they are [CORS-enabled](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)): + +```html + + +``` + + +### Useful functions + +```javascript +// List files in a given directory on the virtual file system +await CLI.ls("/some/path"); + +// Convert a file on the virtual file system to a Blob object, and returns a URL so it can be downloaded by the user +const url = await CLI.download("/path/to/a/file"); +``` + + +### Using Aioli with npm + +Instead of using ``, you can install Aioli using `npm`: + +```bash +npm install --save "@biowasm/aioli" +``` + +Then you can import Aioli as follows: + +```js +import Aioli from "@biowasm/aioli"; +``` + ## Aioli Configuration @@ -99,6 +157,7 @@ new Aioli("seq-align/smith_waterman/2017.10.18"); new Aioli("seq-align/needleman_wunsch/2017.10.18"); ``` + ### Advanced By default, Aioli retrieves the `.wasm` modules and the Aioli WebWorker code from the biowasm CDN for convenience, but you can also load files from local sources. There are also additional configuration options you can pass along: