Skip to content

Molecule formula atom order wrong #2927

@AlexeyGirin

Description

@AlexeyGirin

Steps to Reproduce

  1. Go to Macromolecules mode - Flex canvas (empty)
  2. Load from HELM: CHEM1{[CCC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(CNC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(C(NC(CNC(C(NC(C(NC(C(N)CC1NC=NC=1)=O)(C)C)=O)CCC(O)=O)=O)=O)C(O)C)=O)CC1C=CC=CC=1)=O)C(O)C)=O)CO)=O)CC(O)=O)=O)C(C)C)=O)CO)=O)CO)=O)CC1C=CC(O)=CC=1)=O)CC(C)C)=O)CCC(O)=O)=O)=O)CCC(N)=O)=O)C)=O)C)=O)CCCCNC(COCCOCCNC(COCCOCCNC(CCC(NC(CCCCCCCCCCCCCCCCC(O)=O)=O)C(O)=O)=O)=O)=O)=O)CCC(O)=O)=O)CC1C=CC=CC=1)=O)C(NC(C(NC(C(NC(C(NC(C(NC(C(NCC(NC(C(NCC(O)=O)=O)CCCNC(N)=N)=O)=O)CCCNC(N)=N)=O)C(C)C)=O)CC(C)C)=O)CC1C2C(=CC=CC=2)NC=1)=O)C)=O)C]}$$$$V2.0
    Image
  3. Open Calculate properties (press Alt+C)

Actual behavior
Molecular formula is C187N45O59H291
Image

Expected behavior
Molecular mass is C187H291N45O59
Image

As per requirement:

  1. Indigo should return a list of atoms with their number count in subscript. Atoms should be ordered: carbon first, hydrogen second, and all other atoms alphabetically.

Environment details:

  • Ketcher Version 3.4.0-rc.3 Build at 2025-05-15; 19:51:50
  • Indigo Version 1.32.0-rc.2.0-g94ab270bd-wasm32-wasm-clang-19.0.0
  • Chrome Version 136.0.7103.93 (Official Build) (64-bit)
  • Win10

Found while testing: epam/ketcher#5727

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions