Mercurial > repos > fubar > jbrowse2
annotate bedscoreplugin.js @ 129:d08080933718 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6d8a6a308c219c112dbfc09fe48ad462746d6fb0
author | fubar |
---|---|
date | Mon, 07 Oct 2024 08:55:19 +0000 |
parents | 5d1259b88c27 |
children |
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 })() |