Change the string type when pasting FASTA/Sequence/IDT onto canvas
- Dominant language
- C++
- Stars
- 406
- Forks
- 134
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 24
Description
### Background
Currently, pasting any string in these formats onto canvas (FASTA, Sequence or IDT) in Snake and Flex mode can be ambiguously interpreted since autorecognition is not always possible.
By implementing this feature, the user will be able to change the type of code after pasting it.
### Requirements
1. When pasting any string in one of these formats (FASTA, Sequence or IDT) onto canvas, if there is only one way to interpret it, the structure should be loaded as usual.
---
### **[Indigo]**
**2. When pasting any string in one of the mentioned formats onto canvas, if the string can be interpreted ambiguously:
2.1. The loader should check for every possible interpretation of the string,
2.2. The string should be pasted as one of these interpretations (keep current behavior),
2.3. All of the possible interpretations should be sent to Ketcher to be displayed in the UX element as options,
2.4. The user choosing a different interpretation (from the one already pasted) in Ketcher should be sent back to Indigo.**
---
3. When the string is pasted, an UX element (e.g. 'Paste options' button) should appear in the top-left corner of the pasted structure (string).
4. The user should be able to change the interpretation by clicking on the UX element and selecting available, case-dependent options.
5. The UX element should contain:
>1. **Format interpretations** - FASTA, Sequence (1-Letter or 3-Letter code), IDT
>2. **Polymer interpretations** - Nucleotides (RNA, DNA), Peptides (PEP)
6. If pasting a string in one of the formats result in only one polymer interpretation (either RNA, DNA or PEP), only this polymer interpretation should be available in the UX element for this format, the rest should be inactive (See Example 1, IDT - the string is always pasted as DNA).
7. Since the string is pasted as one of the possible interpretations, it should be obvious to the user which interpretation was pasted by appropriate visualization inside the UX element (e.g., by highlighting the option).
8. After pasting, if the user doesn't click on the button and proceeds with clicking elsewhere, the button should disappear.
Examples
**1. Pasting 'ACG' -->**
This string is a valid string in mentioned formats.
Interpretation:
|Polymer|FASTA|IDT|Sequence (1L) (3L)|
|---|---|---|---|
DNA|dR(A)P - dR(C)P - dR(G)P|dR(A)P - dR(C)P - dR(G)P|dR(A)P - dR(C)P - dR(G)P|
RNA|R(A)P - R(C)P - R(G)P|dR(A)P - dR(C)P - dR(G)P|R(A)P - R(C)P - R(G)P|
PEP|Alanine - Cysteine - Glycine||**(1L)** Alanine - Cysteine - Glycine|
For this string, all of the three formats have valid interpretations, so they would appear on the UX element. Since IDT format doesn't support peptides (PEP) and it is pasted as DNA, dR(A)P - dR(C)P - dR(G)P, the rest of the options (PEP, RNA) should be inactive when IDT is selected.
Illustration
**2. Pasting 'Ala' -->**
Interpretation:
|Polymer|FASTA|IDT|Sequence (1L) (3L)|
|---|---|---|---|
DNA||||
RNA||||
PEP|Alanine - Leucine - Alanine||**(1L)** Alanine - Leucine - Alanine
**(3L)** Alanine
|
Illustration
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.