diff --git a/packages/ketcher-core/__tests__/domain/serializers/ket/KetSerializer.test.ts b/packages/ketcher-core/__tests__/domain/serializers/ket/KetSerializer.test.ts index 0779ec3afe..f0a318ee79 100644 --- a/packages/ketcher-core/__tests__/domain/serializers/ket/KetSerializer.test.ts +++ b/packages/ketcher-core/__tests__/domain/serializers/ket/KetSerializer.test.ts @@ -47,7 +47,7 @@ describe('deserialize (ToStruct)', () => { const preparedAtoms = parsedPrepareContent.mol0.atoms preparedAtoms.forEach((props, id) => { const locationWithNegativeY = props.location.map((coordinate, index) => { - return index === 1 && props.label ? -coordinate : coordinate + return index === 1 ? -coordinate : coordinate }) const relatedAtom = deserData.atoms.get(id) const label = props.type === 'rg-label' ? 'R#' : 'C' @@ -175,9 +175,7 @@ describe('serialize (ToKet)', () => { it('correct work with atoms', () => { parsedNewPrepareStruct.mol0.atoms.forEach((atom, id) => { const relatedAtom = parsedPrepareContent.mol0.atoms[id] - if (relatedAtom.label) { - relatedAtom.location[1] = -relatedAtom.location[1] - } + relatedAtom.location[1] = -relatedAtom.location[1] expect(atom).toEqual(relatedAtom) }) }) diff --git a/packages/ketcher-core/src/domain/serializers/ket/fromKet/moleculeToStruct.ts b/packages/ketcher-core/src/domain/serializers/ket/fromKet/moleculeToStruct.ts index e36a65b1d5..500b1bb000 100644 --- a/packages/ketcher-core/src/domain/serializers/ket/fromKet/moleculeToStruct.ts +++ b/packages/ketcher-core/src/domain/serializers/ket/fromKet/moleculeToStruct.ts @@ -90,7 +90,7 @@ export function rglabelToStruct(source) { params.label = 'R#' ifDef(params, 'pp', { x: source.location[0], - y: source.location[1], + y: -source.location[1], z: source.location[2] || 0.0 }) ifDef(params, 'attpnt', source.attachmentPoints) @@ -104,7 +104,7 @@ export function atomListToStruct(source) { params.label = 'L#' ifDef(params, 'pp', { x: source.location[0], - y: source.location[1], + y: -source.location[1], z: source.location[2] || 0.0 }) ifDef(params, 'attpnt', source.attachmentPoints) diff --git a/packages/ketcher-core/src/domain/serializers/ket/toKet/moleculeToKet.ts b/packages/ketcher-core/src/domain/serializers/ket/toKet/moleculeToKet.ts index 3e64a2e77d..f2591a8d35 100644 --- a/packages/ketcher-core/src/domain/serializers/ket/toKet/moleculeToKet.ts +++ b/packages/ketcher-core/src/domain/serializers/ket/toKet/moleculeToKet.ts @@ -90,7 +90,7 @@ function rglabelToKet(source) { const result = { type: 'rg-label' } - ifDef(result, 'location', [source.pp.x, source.pp.y, source.pp.z]) + ifDef(result, 'location', [source.pp.x, -source.pp.y, source.pp.z]) ifDef(result, 'attachmentPoints', source.attpnt, 0) const refsToRGroups = fromRlabel(source.rglabel).map( @@ -105,7 +105,7 @@ function atomListToKet(source) { const result = { type: 'atom-list' } - ifDef(result, 'location', [source.pp.x, source.pp.y, source.pp.z]) + ifDef(result, 'location', [source.pp.x, -source.pp.y, source.pp.z]) ifDef(result, 'attachmentPoints', source.attpnt, 0) ifDef(result, 'elements', source.atomList.labelList()) ifDef(result, 'notList', source.atomList.notList, false)