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

display extension name right-side-up #961

Open
dave-doty opened this issue Dec 22, 2023 · 1 comment
Open

display extension name right-side-up #961

dave-doty opened this issue Dec 22, 2023 · 1 comment
Assignees
Labels
invalid This doesn't seem right

Comments

@dave-doty
Copy link
Member

It was originally implemented this way, but also erroneously caused the DNA sequence of the extension to display backwards. See #959.

I made the call to quick-fix the DNA sequence issue, since it could lead to errors in DNA sequences if someone mistakenly reversed their DNA sequence to make it look "correct" in scadnano. The way I fixed it was to always draw the extension line starting at the 5' end and ending at the 3' end.

Previously, we drew it starting at the left and ending at the right, which makes textPath's tied to the line always display above it. So now extension names (and labels) appear like this:

image

Let's figure out a way to make the upside-down names and labels appear right-side-up, while preserving the correct display of DNA sequences:

image

@dave-doty dave-doty added the invalid This doesn't seem right label Dec 22, 2023
@dave-doty
Copy link
Member Author

dave-doty commented Dec 22, 2023

I think the straightforward fix for this is, in DesignMainExtension, to draw a second invisible line along with the visible extension line, but use the original left-to-right order, instead of 5' to 3' order, and then set xlinkHref in DesignMainStrandExtensionText to that invisible line for the extension name and label instead of the visible extension line.

UPDATE: It might be simpler to do the following. Check if the 3' end of the extension is to the left (has a smaller x coordinate) than the 5' end (implicitly, by checking the fields Extension.display_length and Extension.display_angle), and if so draw the line left to right (i.e., 3' to 5' in this case), render the DNA as before, but render the reverse of the original DNA sequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants