Rfam / rfam-production

Rfam production pipeline
Apache License 2.0
5 stars 3 forks source link

Recompute R-scape images using the latest R-scape #112

Open AntonPetrov opened 2 years ago

AntonPetrov commented 2 years ago

We need to re-compute all 2D diagrams using the latest version of R-scape for the next release (14.8) because the current images are generated using one or more old versions of R-scape and the users are confused when they can't reproduce the images they see on the Rfam website using R-scape and the SEED alignments.

This requires implementing a new pipeline post-processing step to remove the title as well as the following interactions from the SVG images generated by R-scape: sc, xc, and tr.

Screenshot 2022-03-02 at 11 05 48

Currently there is some JS code that removes the title on the secondary structure tab. This was probably done as a quick fix to avoid recomputing loads of images: https://github.com/Rfam/rfam-website/blob/101fc67ead688aee0fec31e7e48d2b6a199aecd6/RfamWeb/root/static/javascripts/rscape.js#L84

However, the images are also served in the API, and the API has no JS, so the title is also removed in Perl on server side 🤔 https://github.com/Rfam/rfam-website/blob/101fc67ead688aee0fec31e7e48d2b6a199aecd6/RfamWeb/lib/RfamWeb/Roles/Family/Methods.pm#L291

Clearly there is some duplication here, and the way to go seems to be to write a Perl/Python step to process R-scape SVG images and strip out the title and the interactions you don’t want (if it’s possible). Alternatively, we may need to ask Elena to add a special flag to R-scape to generate R2R images without certain elements like tr etc.