view bedscoreplugin.js @ 114:75f01bd05bd8 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2f823945594c6e61a7661c253b671a604b8fb959
author bgruening
date Tue, 20 Aug 2024 06:43:01 +0000
parents 5d1259b88c27
children
line wrap: on
line source

// 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,
    }
})()