Skip to content

Commit

Permalink
#1960 Fix error message in the SequenceLoader for an invalid sequence #…
Browse files Browse the repository at this point in the history
  • Loading branch information
even1024 authored May 21, 2024
1 parent 6f55c66 commit 2ba5462
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/tests/integration/ref/formats/fasta_to_ket.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ test_rna.ket:SUCCEED
test_dna.ket:SUCCEED
multiseq.ket:SUCCEED
break_peptide.ket:SUCCEED
break_rna.fasta:SEQUENCE loader: SequenceLoader::loadFasta(), Invalid symbols in the sequence: *
break_rna.fasta:SEQUENCE loader: Invalid symbols in the sequence: *
comment.ket:SUCCEED
test_1881.ket:SUCCEED
2 changes: 1 addition & 1 deletion api/tests/integration/ref/formats/idt_to_ket.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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 'SequenceLoader::loadIdt(), Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3'
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 '/': got expected error 'Unexpected end of data'
Test '//': got expected error 'Invalid modification: empty string.'
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/tests/formats/idt_to_ket.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def find_diff(a, b):
print(diff)

idt_errors = {
"!+-$#12w12r23e32e33": "SequenceLoader::loadIdt(), Invalid symbols in the sequence: !,-,$,#,1,2,w,1,2,2,3,e,3,2,e,3,3",
"!+-$#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.",
Expand Down
6 changes: 3 additions & 3 deletions core/indigo-core/molecule/src/sequence_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void SequenceLoader::loadFasta(BaseMolecule& mol, SeqType seq_type)
}

if (invalid_symbols.size())
throw Error("SequenceLoader::loadFasta(), Invalid symbols in the sequence: %s", invalid_symbols.c_str());
throw Error("Invalid symbols in the sequence: %s", invalid_symbols.c_str());

if (!properties.is_empty())
{
Expand Down Expand Up @@ -198,7 +198,7 @@ void SequenceLoader::loadSequence(BaseMolecule& mol, SeqType seq_type)
}

if (invalid_symbols.size())
throw Error("SequenceLoader::loadSequence(), Invalid symbols in the sequence: %s", invalid_symbols.c_str());
throw Error("Invalid symbols in the sequence: %s", invalid_symbols.c_str());
}

bool SequenceLoader::addTemplate(BaseMolecule& mol, const std::string alias, MonomerClass mon_type)
Expand Down Expand Up @@ -560,5 +560,5 @@ void SequenceLoader::loadIdt(BaseMolecule& mol)
}

if (invalid_symbols.size())
throw Error("SequenceLoader::loadIdt(), Invalid symbols in the sequence: %s", invalid_symbols.c_str());
throw Error("Invalid symbols in the sequence: %s", invalid_symbols.c_str());
}

0 comments on commit 2ba5462

Please sign in to comment.