RNAcentral / rnacentral-webcode

RNAcentral website source code
https://rnacentral.org
Apache License 2.0
30 stars 9 forks source link

Add an edit button to all R2DT diagrams on RNAcentral #612

Open blakesweeney opened 1 year ago

blakesweeney commented 1 year ago

We should add the ability to edit any r2dt diagram on RNAcentral. This can work by adding a button to each diagram that:

  1. Submits sequence to R2DT (https://rnacentral.org/r2dt)
  2. Opens an intersital page in a new tab telling the user the sequence is being rendered (or some other text). This page should wait until the r2dt job is done.
  3. Once done, the page uses the job id of the job to redirect to the editor page like: https://ldwlab.github.io/XRNA-TypeScript/?r2dt_job_id=r2dt-R20230111-203900-0332-91533423-p1m to allow editing

This should be done for all sequences which have an r2dt result. There are a couple possible problems we will have to deal with. Since r2dt is using the latest version and not whatever version we used to precompute things it is possible the r2dt results will be out of sync with what is on rnacentral. It is probably rare but someone will run into a case where there is no longer a diagram. That and differences in what template is chosen or how the diagram looks will have to be dealt with somehow, probably documentation.

One other possibility is to add this to the r2dt widget. I think this is ok but we would have to make sure this is a configuration value that so people who use our widget can turn it off if they prefer.