Skip to content

Commit

Permalink
#2660 - Export to three letter amino acid codes cause convert error (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
even1024 committed Dec 2, 2024
1 parent 969f552 commit f3357c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions api/wasm/indigo-ketcher/indigo-ketcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,16 @@ namespace indigo
input_format = it->second;

bool use_document = false;
static const std::set<std::string> document_formats{
"sequence", "chemical/x-sequence", "chemical/x-peptide-sequence-3-letter", "fasta", "chemical/x-fasta", "idt", "chemical/x-idt",
"helm", "chemical/x-helm"};
static const std::set<std::string> document_formats{"sequence",
"chemical/x-sequence",
"peptide-sequence-3-letter",
"chemical/x-peptide-sequence-3-letter",
"fasta",
"chemical/x-fasta",
"idt",
"chemical/x-idt",
"helm",
"chemical/x-helm"};
if ((input_format == "ket" || input_format == "application/json") && outputFormat.size() > 0 && document_formats.count(outputFormat) > 0)
use_document = true;
IndigoKetcherObject iko = loadMoleculeOrReaction(data, options_copy, library, use_document);
Expand Down
3 changes: 3 additions & 0 deletions api/wasm/indigo-ketcher/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ M END
options.set("output-content-type", "chemical/x-peptide-sequence-3-letter");
const peptide_seq = indigo.convert(peptide_ket_ref.toString(), "chemical/x-peptide-sequence-3-letter", options);
assert.equal(peptide_seq, peptide_seq_ref);
options.set("output-content-type", "peptide-sequence-3-letter");
const peptide_seq1 = indigo.convert(peptide_ket_ref.toString(), "peptide-sequence-3-letter", options);
assert.equal(peptide_seq1, peptide_seq_ref);
options.delete();
});
}
Expand Down

0 comments on commit f3357c5

Please sign in to comment.