annotate bedscoreplugin.js @ 134:ed3a21033188 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit bb6736899ac3029f73455637a04a006fcd857fc2
author bgruening
date Sun, 20 Oct 2024 07:11:16 +0000
parents 5d1259b88c27
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
108
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
1 // colour bed regions according to score - must have columns and score as part of the adapter setup
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
2 ;(function () {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
3 class Plugin {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
4 name = 'BedScorePlugin';
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
5 version = '1.0';
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
6
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
7 install(pluginManager) {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
8 pluginManager.jexl.addFunction('customColor', feature => {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
9 if (Number(feature.get('score')) > 0) {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
10 return 'red';
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
11 } else {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
12 return 'blue';
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
13 }
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
14 })
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
15 }
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
16
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
17 configure(pluginManager) {}
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
18 }
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
19
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
20 // the plugin will be included in both the main thread and web worker, so
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
21 // install plugin to either window or self (webworker global scope)
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
22 ;(typeof self !== 'undefined' ? self : window).JBrowsePluginBedScorePlugin =
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
23 {
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
24 default: Plugin,
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
25 }
5d1259b88c27 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9de1453a009c254ab11b16ae8a56cb5c22b131bf
fubar
parents:
diff changeset
26 })()