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

#5512 - System saves mixture ambiguous monomers as alternatives ambiguous monomers #5516

Merged
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
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 || ''),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both probability and ratio are not defined, we will end up with string having underscore in the end: 'TemplateId_TemplateId_'. I'm not sure if this case is possible and if so, will it affect anything, just wanted to highlight

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it should not affect I think

'',
);
} else {
Expand Down
Loading