Closed svengato closed 1 year ago
thanks for reporting this. I think I found a fix here https://github.com/cmdcolin/jbrowse-plugin-gwas/pull/9
I can probably go ahead and try to make a quick release
can also see the config, after this change, would look roughly like this
"displays": [
{
"displayId": "gwas_display_custom_color",
"type": "LinearManhattanDisplay",
"renderers": {
"LinearManhattanRenderer": {
"color": "green"
}
}
}
]
It is always a bit verbsoe to configure renderers unfortunately, and in this case, it is extending the "wiggle track" which uses this "renderers" config
published as 1.0.5 :)
Thanks - now I see the green dots when using "green" as in your example, but get an error message "TypeError: feature is undefined" when using my jexl:traitColor(feature) as in the original post.
Could it be missing a line contextVariable: ["feature"]
in jbrowse-plugin-gwas/src/LinearManhattanRenderer/index.ts?
export const configSchema = ConfigurationSchema(
"LinearManhattanRenderer",
{
color: {
type: "color",
description: "the color of the marks",
defaultValue: "darkblue",
contextVariable: ["feature"]
},
},
{ explicitlyTyped: true },
);
nice catch again :) added this fix as 1.0.6 from #10
The dots now have different colors according to their trait. Thanks!
I would like to color code the dots in the Manhattan plot by GWAS trait (my data files have a 'trait' column). For a LinearBasicDisplay, adding the following code to config.json works as expected:
where traitColor() is a jexl function that assigns a color to each trait.
For LinearManhattanDisplay, it seems that it should be as simple as replacing 'color1' with 'color' (defined in jbrowse-plugin-gwas/src/LinearManhattanRenderer/index.ts), but neither of these tags work. I have not been able to change the color through config.json at all, only through 'Set color' in the browser (which assigns all dots the same color).