Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to relative coordinates #131

Open
AntonPetrov opened this issue Dec 8, 2023 · 6 comments · Fixed by #156
Open

Switch to relative coordinates #131

AntonPetrov opened this issue Dec 8, 2023 · 6 comments · Fixed by #156

Comments

@AntonPetrov
Copy link
Member

The RNA 2D JSON Schema is switching from absolute to relative coordinates. This means that the code that uses R2DT JSON output needs to be updated or the SVG images that are generated using the new files will be incorrect.

It is necessary to update R2DT without breaking the integration with XRNA-React and RNAcanvas.

There is already a new version of Traveler that implements the change (thanks @davidhoksza!):
https://github.com/cusbg/traveler/tree/relative-labels

Here is the plan:

  • I can prepare a version of R2DT that generates new JSON files
  • @blakesweeney could push the updated docker image to the wwwdev API
  • @pzhaojohnson and @CaedenM could test the new JSON output files using the wwwdev API and prepare to update their apps
  • once everything is ready, the main R2DT API can be switched to generate new JSON files, and RNAcanvas and XRNA-React can be updated accordingly

Here are some example files provided by @davidhoksza that can be used for testing:

⚠️ This is a breaking change so other stakeholders need to be notified - hopefully they are watching this repo 🤞but I can also announce on X and add a warning on r2dt.bio.

Does this plan work? Any ideas or suggestions are very welcome!

cc @aspetr01

@davidhoksza
Copy link
Collaborator

Just a small comment regarding the attached files - the *_abs.* files are the original files with absolute label positions, while the non "abs" files are the ones with the new relative positioning of labels.

@pzhaojohnson
Copy link

Just to double-check, so it seems like residues still have absolute coordinates, but things like labels now have relative coordinates (relative to the coordinates of the corresponding residue I assume)?

To avoid this being a breaking change, would it be possible to include some sort of "flag" property that would specify whether coordinates are to be interpreted as absolute or relative (and then to still interpret coordinates as absolute by default)?

@AntonPetrov
Copy link
Member Author

@davidhoksza or @CaedenM - would you be able to comment on this please?

Just to double-check, so it seems like residues still have absolute coordinates, but things like labels now have relative coordinates (relative to the coordinates of the corresponding residue I assume)?
To avoid this being a breaking change, would it be possible to include some sort of "flag" property that would specify whether coordinates are to be interpreted as absolute or relative (and then to still interpret coordinates as absolute by default)?

Having a flag for absolute or relative coordinates sounds like a good idea to me - what does everyone else think?

@davidhoksza
Copy link
Collaborator

@pzhaojohnson Indeed, coordinates of the label and label lines relative to the coordinates of the corresponding residue

The flag should be added to the JSON schema, right? No problem with me to include it in the output from Traveler once it's in the schema...

@AntonPetrov
Copy link
Member Author

@CaedenM and @aspetr01, what do you think about adding the flag suggested by Philip to the schema?

Using a flag the transition can be made asynchronously. RNAcanvas and XRNA-React could deploy new code on their own schedule and use the flag if it's present or default to the absolute coordinates in its absence for backwards compatibility.

@pzhaojohnson
Copy link

Would using dx and dy (in place of x and y) to denote relative coordinates be a possibility?

@github-project-automation github-project-automation bot moved this to Backlog in R2DT Issues Oct 4, 2024
@AntonPetrov AntonPetrov moved this from Backlog to In progress in R2DT Issues Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants