Skip to content

Commit

Permalink
#5512 - System saves mixture ambiguous monomers as alternatives ambig…
Browse files Browse the repository at this point in the history
…uous monomers (#5522)

- fixed template id generation for ambiguous monomers
  • Loading branch information
rrodionov91 authored Sep 17, 2024
1 parent ebaa800 commit 379a2f7
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,15 @@ export class KetSerializer implements Serializer<Struct> {

if (monomer instanceof AmbiguousMonomer) {
templateId =
monomer.variantMonomerItem.id ||
monomer.monomers.reduce(
(templateId, monomer) =>
templateId + '_' + getMonomerUniqueKey(monomer.monomerItem),
monomer.variantMonomerItem.subtype +
'_' +
monomer.variantMonomerItem.options.reduce(
(templateId, option) =>
templateId +
'_' +
option.templateId +
'_' +
(option.probability || option.ratio || ''),
'',
);
} else {
Expand Down

0 comments on commit 379a2f7

Please sign in to comment.