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

Macro: Copy fragment from existing sequence on canvas and paste #3916

Closed
olganaz opened this issue Jan 17, 2024 · 2 comments · Fixed by #4330
Closed

Macro: Copy fragment from existing sequence on canvas and paste #3916

olganaz opened this issue Jan 17, 2024 · 2 comments · Fixed by #4330

Comments

@olganaz
Copy link
Collaborator

olganaz commented Jan 17, 2024

Background
This task covers copy and paste operations for all the fragments that are present on canvas.
Fragment - a set of monomers connected through bonds or single monomer.
Linear peptide fragment (chain) - a set of peptide monomers connected with R2-R1 bonds.
Linear RNA fragment (chain) is a set of nucleotides connected through R2-R1 bonds (bond established between phosphate R2 AP of first nucleotide and sugar R1 AP of the second nucleotide).
Nucleotide = sugar+base+phosphate, connected by the rules, defined in preset.

Requirements

Copy

  1. Copy (Ctrl+C) should work in all views and modes (Flex/Snake/Sequence) equally.
  2. All selected monomers and selected bonds connected those monomers are copied to the clipboard (in Ket-format)
  3. if at least one of the monomers that are connected by the bond is not selected, then the bond is not copied to clipboard.

Paste

  1. In flex view paste is performed where cursor is located.
  2. In snake view paste is performed under all fragments on canvas and newly added fragment is aligned according to the rules of snake mode. Additionally, visual frame should be moved to make pasted fragment visible.
  3. Sequence view. View mode
    - If canvas is empty, then pasted fragment should be aligned left and centered vertically on visible canvas.
    - If there is already at least one sequence on canvas, then paste should be performed in the next row. Additionally, the canvas should be moved to make newly added sequence visible.
    - Several fragments are pasted as several sequences.
  4. Sequence view. Text-editing mode.
    - Paste of several fragments (which are not connected through R2-R1 bonds) should be prohibited in text-editing mode.
    - Paste is performed where cursor is located.
    - If paste is performed between two monomers (or nucleotides), it means that the the bond R2-R1 between them is broken and pasted fragment is merged with existing chain via R2-R1 bonds (the last monomer before the break is connected with the first monomer of the pasted chain AND the last monomer of pasted chain is connected with the first monomer after the break).
    - If paste is performed before the first symbol of the chain or after the last symbol of the chain then pasted fragment should be merged with existing chain with one bond.
    - Pasted fragment should have available attachment points to establish bonds for merge. If not, then paste should not be performed.

Alternatives
System should ignore all other formats except sequence and KET not to perform paste.

@Zhirnoff
Copy link
Collaborator

Zhirnoff commented Mar 7, 2024

Tests added to the automation table. Except for single chems , micro structures tests, since there is no description of this interaction in the ticket.

@Zhirnoff
Copy link
Collaborator

Tested on 2.21.0-rc.1 No comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants