CartwrightLab / dawg

Simulating Sequence Evolution
GNU General Public License v2.0
11 stars 3 forks source link

Dawgjs #52

Closed zmertens closed 6 years ago

zmertens commented 6 years ago

This change is an experimental JavaScript DAWG module (see dawg_walker.js for sanity checks). You can run dawg.js as a module in node:

var dawg = require('./dawg.js');
console.log(Module.getRnaSequence("jc", root_length=100)); 

The library is generated using Emscripten which uses Embind which is inspired by Boost.Python. See the build_dawgjs.sh for commands.

This module is asm.js compatabile, there is an option to use WebAssembly using -s WASM=1 or whatever, which I haven't tried.

The dawg.js module can be used in HTML as well, but not using require. Instead, there's a global Module. For example:

<script> console.log(Module.getRnaSequence("jc", root_length=100)); </script>
dng-jenkins commented 6 years ago

Can one of the admins verify this patch?

dng-jenkins commented 6 years ago

Can one of the admins verify this patch?