Skip to content

Commit

Permalink
Backmerge: #2122 - Sugar R should not save in the IDT format (#2568)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliaksandrDziarkach authored Oct 17, 2024
1 parent 493ca18 commit 83a67a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/tests/integration/ref/formats/ket_to_idt.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Test ket-to-idt-alternatives-base: got expected error 'Cannot save IDT - only mi
Test ket-to-idt-invalid-last-phosphate: got expected error 'Sequence saver: Cannot save molecule in IDT format - phosphate R cannot be last monomer in sequence.'
Test ket-to-idt-invalid-nucleotide: got expected error 'IDT alias for group sugar:m2e2r base:z8c3G phosphate:mepo2 not found.'
Test ket-to-idt-invalid-posphates: got expected error 'Sequence saver: Cannot save in IDT format - nonstandard connection found.'
Test ket-to-idt-invalid-sugar: got expected error 'IDT alias for sugar:m2e2r not found.'
Test ket-to-idt-invalid-sugar: got expected error 'Cannot save molecule in IDT format - sugar whithout base.'
Test ket-to-idt-invalid-sugar-base: got expected error 'IDT alias for group sugar:m2e2r base:z8c3G not found.'
Test ket-to-idt-invalid-sugar-phosphate: got expected error 'IDT alias for group sugar:m2e2r phosphate:mepo2 not found.'
Test ket-to-idt-peptide: got expected error 'Sequence saver: Cannot save molecule in IDT format - expected sugar but found AminoAcid monomer DPhe4C.'
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/tests/formats/ket_to_idt.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def find_diff(a, b):
"ket-to-idt-invalid-last-phosphate": "Sequence saver: Cannot save molecule in IDT format - phosphate R cannot be last monomer in sequence.",
"ket-to-idt-invalid-nucleotide": "IDT alias for group sugar:m2e2r base:z8c3G phosphate:mepo2 not found.",
"ket-to-idt-invalid-sugar-phosphate": "IDT alias for group sugar:m2e2r phosphate:mepo2 not found.",
"ket-to-idt-invalid-sugar": "IDT alias for sugar:m2e2r not found.",
"ket-to-idt-invalid-sugar": "Cannot save molecule in IDT format - sugar whithout base.",
"ket-to-idt-invalid-sugar-base": "IDT alias for group sugar:m2e2r base:z8c3G not found.",
"ket-to-idt-alternatives-base": "Cannot save IDT - only mixture supported but found alternatives.",
}
Expand Down
4 changes: 4 additions & 0 deletions core/indigo-core/molecule/src/sequence_saver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,10 @@ void SequenceSaver::saveIdt(KetDocument& doc, std::vector<std::deque<std::string
}
}
}
else
{
throw Error("Cannot save molecule in IDT format - sugar whithout base.");
}

if (sequence.size() > 0)
{ // process phosphate
Expand Down

0 comments on commit 83a67a4

Please sign in to comment.