Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backmerge: #2660 - Export to three letter amino acid codes cause convert error #2663

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading