intermine / intermine/bluegenes

R visualizations defined by mine admins

Open
#581 0 comments 0 reactions 0 assignees View on GitHub
Discussion
Dominant language
Clojure
Stars
75
Forks
59
PR merge metrics
No merged PRs in 30d

Description

This issue outlines an idea that may be worth pursuing in the future. It's an evolution of the *R playground* idea, which instead focused on end-users writing R code to visualize the results of an im-table.

The greatest drawback of the current Tool API lies in its flexibility; the fact that each tool is a complete JS application, requiring its authors to be familiar with the modern JS stack, and learn new plotting libraries. They also tend to be mine-specific (although there are ways to improve this), which puts the burden on each mine admin to develop their own Tools.

There are lots of potential [bridges](https://github.com/scicloj/clojisr) between Bluegenes' backend and R. If combined with the new `bluegenes-properties` webservice, we could allow mine admins to define visualizations using R code with a pre-initialised dataframe based on the report page or lists analysis data, and ggplot2 (possibly other libraries). This R code would then be persisted and run for all users alongside existing visualizations (as only mine admins can define the R code, we *might* be able to sidestep the problem of sandboxing for security).

The tradeoff of the R visualizations is that they'll likely be static SVG or images. Introducing interactivity may be possible with R shiny or [plotly R](https://plotly-r.com/index.html) (places more load on the R backend) or [other tools](https://davidgohel.github.io/ggiraph/articles/offcran/using_ggiraph.html) for adding JS interactivity (usually in the form of tooltips) to R plots.

*Implementation notes:*
- Along with the R code as a string, we'd need to also persist an object similar to the Tool API's *config.json* which will be used to determine when the R visualization is displayed
- The R visualization will probably want to build its own query based on the database ID(s) passed from Bluegenes; for this using the existing InterMineR package might be suitable

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.