Skip to content

Commit

Permalink
#1979 Preview: IDT sequence with leading or trailing spaces will not…
Browse files Browse the repository at this point in the history
… open. (#1980)
  • Loading branch information
AliaksandrDziarkach authored May 30, 2024
1 parent 910d3ca commit b45d44a
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 128 deletions.
16 changes: 9 additions & 7 deletions api/tests/integration/ref/formats/idt_to_ket.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ idt_prefix_suffix.ket:SUCCEED
idt_singe_32moera_nucleoside.ket:SUCCEED
idt_single_nucleoside.ket:SUCCEED
idt_std_phosphates.ket:SUCCEED
Test '!+-$#12w12r23e32e33': got expected error 'Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3'
Test '+/5Phos/A': got expected error 'Sugar prefix could not be used with '/5Phos/''
Test '!+A-$#12w12r23e32e33': got expected error 'Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3'
Test '+/5Phos/A': got expected error 'Sugar prefix could not be used with modified monomer.'
Test '/': got expected error 'Unexpected end of data'
Test '//': got expected error 'Invalid modification: empty string.'
Test '/32MOErA/T': got expected error 'IDT alias 32MOErA not found at five-prime end position.'
Expand All @@ -21,11 +21,13 @@ Test '/a/': got expected error 'Invalid modification: a.'
Test '/i2MOErA/': got expected error 'IDT alias i2MOErA not found at three-prime end position.'
Test '/i2MOErA/T': got expected error 'IDT alias i2MOErA not found at five-prime end position.'
Test 'A*': got expected error 'Invalid IDT sequence: '*' couldn't be the last symbol.'
Test 'A+/3Phos/': got expected error 'Sugar prefix could not be used with '/3Phos/''
Test 'Am/3Phos/': got expected error 'Sugar prefix could not be used with '/3Phos/''
Test 'Ar/3Phos/': got expected error 'Sugar prefix could not be used with '/3Phos/''
Test 'A*/3Phos/': got expected error 'Phosphor /3Phos/ cannod be modified with '*'.'
Test 'A+/3Phos/': got expected error 'Sugar prefix could not be used with modified monomer.'
Test 'Am/3Phos/': got expected error 'Sugar prefix could not be used with modified monomer.'
Test 'Ar/3Phos/': got expected error 'Sugar prefix could not be used with modified monomer.'
Test 'T/52MOErA/': got expected error 'IDT alias 52MOErA not found at three-prime end position.'
Test 'T/5Phos/': got expected error 'IDT alias 5Phos not found at three-prime end position.'
Test 'T/i2MOErA/': got expected error 'IDT alias i2MOErA not found at three-prime end position.'
Test 'm/5Phos/A': got expected error 'Sugar prefix could not be used with '/5Phos/''
Test 'r/5Phos/A': got expected error 'Sugar prefix could not be used with '/5Phos/''
Test 'm/5Phos/A': got expected error 'Sugar prefix could not be used with modified monomer.'
Test 'r+A': got expected error 'Sugar prefix 'r' whithout base.'
Test 'r/5Phos/A': got expected error 'Sugar prefix could not be used with modified monomer.'
22 changes: 12 additions & 10 deletions api/tests/integration/tests/formats/idt_to_ket.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def find_diff(a, b):
ref_path = joinPathPy("ref/", __file__)

idt_data = {
"idt_single_nucleoside": "A",
"idt_bases": "ATCGUI",
"idt_prefix_suffix": "mA*rT*+C*G*+UrImA",
"idt_single_nucleoside": " A ",
"idt_bases": " ATCGUI ",
"idt_prefix_suffix": " mA*rT*+C*G*+UrImA ",
"idt_modifications": "/52MOErA/*/i2MOErA//32MOErA/",
"idt_52moera_with_3phos": "/52MOErA//3Phos/",
"idt_singe_32moera_nucleoside": "/32MOErA/",
Expand Down Expand Up @@ -60,10 +60,11 @@ def find_diff(a, b):
print(diff)

idt_errors = {
"!+-$#12w12r23e32e33": "Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3",
"!+A-$#12w12r23e32e33": "Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3",
"/": "Unexpected end of data",
"//": "Invalid modification: empty string.",
"/a/": "Invalid modification: a.",
"r+A": "Sugar prefix 'r' whithout base.",
"A*": "Invalid IDT sequence: '*' couldn't be the last symbol.",
"/i2MOErA/": "IDT alias i2MOErA not found at three-prime end position.",
"/i2MOErA/T": "IDT alias i2MOErA not found at five-prime end position.",
Expand All @@ -74,12 +75,13 @@ def find_diff(a, b):
"/3Phos/T": "IDT alias 3Phos not found at three-prime end position.",
"T/5Phos/": "IDT alias 5Phos not found at three-prime end position.",
"/5Phos/*A": "/5Phos/ cannot be modified to 'sP'",
"r/5Phos/A": "Sugar prefix could not be used with '/5Phos/'",
"+/5Phos/A": "Sugar prefix could not be used with '/5Phos/'",
"m/5Phos/A": "Sugar prefix could not be used with '/5Phos/'",
"Ar/3Phos/": "Sugar prefix could not be used with '/3Phos/'",
"A+/3Phos/": "Sugar prefix could not be used with '/3Phos/'",
"Am/3Phos/": "Sugar prefix could not be used with '/3Phos/'",
"r/5Phos/A": "Sugar prefix could not be used with modified monomer.",
"+/5Phos/A": "Sugar prefix could not be used with modified monomer.",
"m/5Phos/A": "Sugar prefix could not be used with modified monomer.",
"Ar/3Phos/": "Sugar prefix could not be used with modified monomer.",
"A+/3Phos/": "Sugar prefix could not be used with modified monomer.",
"Am/3Phos/": "Sugar prefix could not be used with modified monomer.",
"A*/3Phos/": "Phosphor /3Phos/ cannod be modified with '*'.",
}
for idt_seq in sorted(idt_errors.keys()):
error = idt_errors[idt_seq]
Expand Down
Loading

0 comments on commit b45d44a

Please sign in to comment.