Unable to use 'feature' argument in jexl functions
See original GitHub issueDescribe the bug
I’m trying to implement configuration callbacks accoding to the docs written here.
The function described in the docs don’t work for me somehow. Any function that has feature
as argument to the function call fails,
i.e. get(...)
fails while log(...)
works.
To Reproduce
- Use jexl expression in
config.json
// ...
{
"type": "FeatureTrack",
"trackId": "OrganismGenome_ChromatinStatesTp0",
"name": "TP0 4h",
"formatDetails": {
"feature": "jexl:{name:get(feature,'start')}" // <------
},
"adapter": {
"type": "BedTabixAdapter",
"bedGzLocation": {
// ...
- Load JBrowse2 web and click on a feature in the respective track.
Expected behavior
The “Feature details” panel should show the evaluated result of the jexl expression. In the case of the example above it would the the start position of the feature. Instead, the Panel remains white and the Console (F12) shows an error traceback:
[mobx] uncaught error in 'Reaction[Autorun]' Error: TypeError: e.get is not a function
Screenshots
Version:
JBrowse2 v2.1.2 Firefox 104.0 Google Chrome Version 105.0.5195.102 (Official Build) (64-bit) Ubuntu 20.04
Additional context
Using only variables in jexl (i.e. not a function call with feature as input) works, however:
// ...
{
"type": "FeatureTrack",
"trackId": "OrganismGenome_ChromatinStatesTp0",
"name": "TP0 4h",
"formatDetails": {
"feature": "jexl:{name:feature.start}" // <------
},
"adapter": {
"type": "BedTabixAdapter",
"bedGzLocation": {
// ...
Of course, this example above with the start of the feature does not make sense and I only use it to test it. Later on I have to integrate my own functions for more complex configuration callbacks, but these will need to access feature
as well.
Also, I’m not a web developer and have little to no experience with Typescript/Javascript. I’m just a Bioinformatics PhD student that was tasked to implement a genome browser by his PI. So I hope that I’m not just missing something really obvious here.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Ah, now I get it! Sorry for my confusion.
I now managed to implement the configuration callback for coloring the chromatin states with a custom plugin. Much like the example in JBrowse1.
Thanks a lot for the help and explanations. From my side it is now solved and I would close the issue.
Thanks again and have a nice day!
can check https://github.com/GMOD/jbrowse-components/blob/a7e7da90d75ad40104ebdf8933ae2e753f879a32/test_data/volvox/config.json#L989-L991 for format details example and https://github.com/GMOD/jbrowse-components/blob/a7e7da90d75ad40104ebdf8933ae2e753f879a32/test_data/volvox/config.json#L1430-L1467 for a color callback