dieterich-lab / rp-bp

Rp-Bp is a Bayesian approach to predict, at base-pair resolution, ribosome occupancy and translation.
MIT License
7 stars 5 forks source link

Implement interactive reporting dashboard #131

Closed eboileau closed 1 year ago

eboileau commented 1 year ago

The app part 1 mostly relies on pre-processed data (call to summarize-rpbp-profile-construction), such that it quickly does the plotting and minor data wrangling.

For app-specific related problems/improvements, I will open separate issues, where relevant. This still needs to be integrated.

Here is a non-exhaustive list of things to do/consider

still WIP, but this should be done soon....

eboileau commented 1 year ago

For the app part 1:

I need to have a closer look at this...

If traces have arrays, then the axis type is automatically inferred to be multicategory. I guess for a DataFrame with MultiIndex this might work, but this is not a major issue, we can address that later.

Long term.

eboileau commented 1 year ago

For the app part 2:

We can, but the output is not synchronizing well, e.g. hover position for the lower circle appears far away, and this seem to depend on the position of the figure in the page... same problem appears on the circos Dash gallery for the histogram. I suggest we leave it out, the overall diagram is more important than the actual size of the bars.

I had to reformat the output for markdown. This works now, but if the transcript names are too long, we might have the same problem, we can adjust after testing on e.g. human data.

This has taken some time to figure out... that's because we're paginating the table in the back end. To get the whole filtered table, we'd have to either let the front end handle pagination (no), or implement a callback with the same filtering, and making sure it does not fire unless the download button is triggered (yes).

I've actually implement filtering on the whole table, but the functionality is limited by the search syntax and the column types, but I think this is doing the job until we can think of something more flexible/robust.

Long term.

Leave for now, we can add this to a minor/patch release in the future

eboileau commented 1 year ago
Traceback (most recent call last):
  File "/beegfs/prj/rpbp-dev/bullseye/rpbp_cmdstanpy/rp-bp/src/rpbp/analysis/profile_construction/dashboard/rpbp_profile_construction_dashboard.py", line 1123, in stacked_frames
    fig = px.bar(
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/express/_chart_types.py", line 373, in bar
    return make_figure(
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/express/_core.py", line 1988, in make_figure
    apply_default_cascade(args)
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/express/_core.py", line 969, in apply_default_cascade
    args["pattern_shape_sequence"] = [
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/express/_core.py", line 970, in <listcomp>
    bar.marker.pattern.shape for bar in args["template"].data.bar
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/graph_objs/bar/marker/_pattern.py", line 252, in shape
    return self["shape"]
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4733, in __getitem__
    elif self._props is not None and prop in self._props:
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4428, in _props
    return self.parent._get_child_props(self)
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4442, in _get_child_props
    if self._props is None:
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4428, in _props
    return self.parent._get_child_props(self)
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4442, in _get_child_props
    if self._props is None:
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4428, in _props
    return self.parent._get_child_props(self)
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4462, in _get_child_props
    child_ind = BaseFigure._index_is(children, child)
  File "/beegfs/prj/rpbp-dev/bullseye/envs/rpbp-cmdstan/lib/python3.10/site-packages/plotly/basedatatypes.py", line 3960, in _index_is
    raise ValueError("Invalid value")
ValueError: Invalid value
eboileau commented 1 year ago

I really don't know where the above error if coming from... it's not consistently reproducible... I guess we leave it for now, and keep an eye on this...