A fast tool to convert BioJS components into Galaxy visualization plugins.
Warning: This tool is in a ALPHA stage. Use at your own risk.
It was tested so far with the
- Define your data types in the package.json
"galaxy": {
"datatypes": ["sequence.Fasta", "sequences", "msa.clustal"]
}
- Add the
galaxy-vis
keyword to your package.json
So your keyword list could look like this.
keywords = ["biojs", "galaxy-vis"]
- Define a custom
galaxy.mako
(package root)
galaxy.getData(response){
galaxy.el.textContent = response;
console.log("datatype", galaxy.dataType);
});
- Check whether you have defined correct sniper settings.
There are some predefined variables in the galaxy
namespace.
url
raw URL to your data filedataType
dataType of your fileconfig
galaxy config parameters (e.g. id)meta
galaxy meta information (e.g. timestamps)el
an existing div for your componentrelativeURL
URL to your galaxy vis pluginjsonURL
URL to your data file (wrapped in a JSON object - only use this if the API throws an error for the raw file
TODO: read more settings like a data provider from the package.json
- Query npm: "give me all package with the "galaxy-vis tag"
- For every package (async)
a) Download the package and install its dependencies
b) Browserify the package and copy the output to /static/{{name}}
c) Copy the js and css resources defined in the biojs sniper settings to static (http links are downloaded)
d) Copy thegalaxy.mako
into a mako template
e) Generate a config file based on the specified data types
You can find a step for step example guide here.
Install:
npm install -g biojs2galaxy
Run:
biojs2galaxy
Specify a specific output folder (default: $(pwd)/build
biojs2galaxy <folder>
(You need npm & node, of course)
Usage: biojs2galaxy [packages]
Automated import of biojs components into galaxy
Options:
-h, --help output usage information
-V, --version output the version number
-v, --verbose Increase verbosity
-a, --all Download all packages from npm
-o, --output [folder] Output folder
-p, --path [path] Path to local package
-r, --remove Clear output folder
biojs2galaxy msa,biojs-vis-sequence
biojs2galaxy --all
biojs2galaxy -p ../msa
git clone https://github.com/biojs/biojs2galaxy
cd biojs2galaxy
npm install
node biojs2galaxy.js