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

Update the representation of sense and antisense chains in sequence mode (2/2) #6254

Closed
ljubica-milovic opened this issue Jan 10, 2025 · 1 comment · Fixed by #6575
Closed
Assignees
Labels
Antisense Bucket: Antisense related issues Hydrogen bonds Bucket: Bugs related to Hydrogen bonds Sequence mode Bucket: Sequence mode related issues Test Cases Written Test cases has been written for that issue

Comments

@ljubica-milovic
Copy link
Collaborator

ljubica-milovic commented Jan 10, 2025

Background

Continuation of the ticket from the previous release: #5942

Summary of differences between editing both chains and editing one chain

image

Removing/adding H-bonds

1.1. Right clicking on a symbol that has no hydrogen bonds with a symbol bellow/above it, should give the option to "Establish Hydrogen Bonds". If a symbol has H-bonds with a symbol opposite it, or there is no monomer opposite it, the option should be disabled.

A hydrogen bond should be established between the monomer that was clicked on and the monomer placed bellow/above it.
"Establish Hydrogen Bonds" is disabled if any of the symbols (the one that was clicked on, or the one opposite it) is the @ symbol representing multiple monomers.
If the symbol represents a nucleotide/nucleoside, a hydrogen bond should be established from the base (no need for a "sense base" check).

1.2. Right licking on a symbol that has any H-bonds should give the option to "Delete Hydrogen Bonds". If there are no H-bonds, the option should be disabled.

All hydrogen bonds from monomers that symbol represents should be deleted.

1.3. If multiple monomers/symbols are selected and at least one of them does not have hydrogen bonds established with the monomer/symbol above/bellow it the option "Establish Hydrogen Bonds" should be available from the r-click menu. If all symbols have H-bonds, the option should be disabled.

"Establish Hydrogen Bonds" is disabled if any of the symbols that do not have H-bonds already with the symbols opposite them are the @ symbol representing multiple monomers.
For all monomers/symbols that do not have H-bonds with their pairs, a H-bond should be established (if the symbols represent nucleotides/nucleotides, an H-bond comes from the base).
Edge case example:
image
image
If all symbols are selected the option "Establish Hydrogen Bonds" should be enabled, because no H-bond will be established with the CHEMs (the @ symbol already has an H-bond with the symbol bellow), but just between nucleotides/nucleosides:
image
image

1.4. If multiple monomers are selected, and any of them have hydrogen bonds, the option "Delete Hydrogen Bonds" should be available in the r-click menu. If no selected symbols have H-bonds, the option should be disabled.

All hydrogen bonds that the selected monomers have should be deleted.

1.5. If all hydrogen bonds between two chains are deleted, the user should get a warning message with the title "Deletion of all Hydrogen Bonds", and the text: "Deleting all hydrogen bonds will cause the separation of two chains. Do you wish to proceed?", and options "Cancel" (default) and "Continue".

When all H-bonds are deleted, the chain(s) that used to be placed bellow should be placed bellow the chain that was on top, one bellow the other starting from the chain on the left:
image
Remove all H-bonds for the first pair of sense and antisense:
image
The chain(s) that used to be antisense (placed bellow) should be oriented "normally" when all H-bonds are broken.
This can happen by individually deleting H-bonds, deleting all H-bonds at once, or by deleting all monomers that have H-bonds.


Editing both chains

2.1. It should be obvious to the user they they are editing both chains (see mockups).

Above and bellow the chains where the caret is placed there should be two triangles that will indicate that changes occur in both strands.
image
Up and down arrows on the keyboard should allow the user to switch between adding the typed symbol to one or the other chain - caret for the first or caret for the second example above.

2.2. If a line break (enter) is added, both backbone chains should be broken.

image
image

2.3. If a line (minus) is added to one side of the chain the backbone of the other chain should be broken.

Users can add either a minus or an em dash (from the keyboard/pasting) - but an em dash will always be displayed.
A line can not be added if at any of the four positions around the caret there is a gap - just like when the user enters some unsupported symbol - nothing happens.
image
A note for the second example above: Addition of a line just breaks the backbone of the opposite chain. This backbone is broken between two lines, so they are deleted because a line cannot be at the end or the beginning of a chain. For the chain above that one, the line is not visible because a line cannot be opposite multiple gaps (req 3.5)

2.4. If a symbol/line is deleted on one side of the chain, the symbol/line on the other side of the chain should also be deleted.

If a symbol is deleted, a backbone connection should be preserved. If a line (minus) is deleted, that means that the backbone should be broken.
image


Editing one chain

3.1. It should be obvious to the user that they are editing only one side of the sense/antisense duplex (see mockups) by graying out/dimming the chain that is not being edited.

The user is able to change the chain being edited by pressing up and down keys on the keyboard.
Editing both chains:
image
Editing one chain:
image

3.2. If a monomer/symbol is added to one chain (not to the left of a line), it should have no impact on the other chain (other than extending the backbone (adding lines) if there is a backbone in that place to accommodate the added monomers).

image
image
image
Establishment of backbone connections follows the same logic as for editing both chains, but just looking at positions around the caret for the chain being edited. If there is a monomer to the left, establish a backbone to the left, if there is one to the right establish a backbone to the right. No monomer is added to the other chain, and no new backbone needs to be established there.

3.3. If a monomer/symbol is added to one chain (to the left of a line), that line is replaced with the newly added monomer.

image
If there happens to be a monomer bellow the newly added monomer, no hydrogen bonds should be established automatically.

3.4. The lines can only be added left of a gap. When the user exits "Edit" mode, if the line(s) do not connect monomer symbols, all lines should be deleted. If the lines(s) connect monomer symbols, a new backbone should be established.

image
image

3.5. If a symbol is deleted on the chain, it should be replaced with a line. If a line is deleted on the chain, the backbone should be broken.

image

3.6. If a line break is added, only one chain backbone is broken.

image


Changing editing mode

4.1. The sync/non-sync switcher should be placed on the main toolbar and be visible only when there is at least one double stranded sequence on canvas. The default edit mode is sync (the toggle is on).

4.2. When a double stranded sequence is created (loaded from a file, pasted, or created using the "Create RNA/DNA Antisense Strand" icon #6252) the sync/non-sync switcher should appear and be toggled on by default.

4.3. When in view mode, right clicking on any monomer in a double stranded sequence should still give the option to "Edit Sequence". Based on the mode chosen by the sync switcher either the editing both chains/sync editing is entered or editing one chain/non-sync editing is entered.

4.4. While in edit mode, changing the sync switcher changes the editing mode.

image

UX

TBD
grayed out chain, editing one chain
removing and adding H-bonds in the drop-down menu
sync button

Image

@ljubica-milovic ljubica-milovic added feature request Sequence mode Bucket: Sequence mode related issues Hydrogen bonds Bucket: Bugs related to Hydrogen bonds labels Jan 10, 2025
@ljubica-milovic ljubica-milovic added this to the Refined Backlog milestone Jan 10, 2025
@AlexeyGirin AlexeyGirin added the Antisense Bucket: Antisense related issues label Jan 24, 2025
@rrodionov91 rrodionov91 self-assigned this Feb 25, 2025
@Zhirnoff Zhirnoff added the Test Cases Written Test cases has been written for that issue label Feb 27, 2025
rrodionov91 added a commit that referenced this issue Mar 4, 2025
…equence mode (2/2) (#6575)

- added h-bonds add and delete in sequence mode
- reworked antisense nodes adding in seq mode
- implemented counter hiding and new caret for sync mode
- added antisense edit sync mode
- fixed spacers nodes in sequence mode
- added splitting chains by press enter
- added entering minus symbol
- added space symbol entering
- fixed peptides adding
- updated screenshots
@Zhirnoff
Copy link
Collaborator

Tested.

Desktop:

  • OS: Windows 11
  • Browser Chrome
  • Version 133.0.6943.127 (Official Build) (64-bit)

Ketcher version
[Version 3.2.0-rc.1]
Indigo version
[Version 1.30.0-rc.1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Antisense Bucket: Antisense related issues Hydrogen bonds Bucket: Bugs related to Hydrogen bonds Sequence mode Bucket: Sequence mode related issues Test Cases Written Test cases has been written for that issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants