diff x/bedscoreplugin.js @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/x/bedscoreplugin.js	Sat Oct 05 23:58:05 2024 +0000
@@ -0,0 +1,26 @@
+// colour bed regions according to score - must have columns and score as part of the adapter setup
+;(function () {
+  class Plugin {
+    name = 'BedScorePlugin';
+    version = '1.0';
+
+    install(pluginManager) {
+      pluginManager.jexl.addFunction('customColor', feature => {
+        if (Number(feature.get('score')) > 0) {
+          return 'red';
+        } else {
+          return 'blue';
+        }
+      })
+    }
+
+    configure(pluginManager) {}
+  }
+
+  // the plugin will be included in both the main thread and web worker, so
+  // install plugin to either window or self (webworker global scope)
+  ;(typeof self !== 'undefined' ? self : window).JBrowsePluginBedScorePlugin =
+    {
+      default: Plugin,
+    }
+})()