diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ca74f04d64f98014e4ac25d0b8327d3ef1e6ea6..38e721395628d2c57df9bbb9b888a274b327746a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Note that since we don't clearly distinguish between a public and private interf - Fix camera project/unproject when using offset viewport - Add support for loading all blocks from a mmcif file as a trajectory - Add `Frustum3D` and `Plane3D` math primitives +- Include `occupancy` and `B_iso_or_equiv` when creating `Conformation` from `Model` - Remove LazyImports (introduced in v3.31.1) ## [v3.32.0] - 2023-03-20 diff --git a/src/mol-model/structure/coordinates/coordinates.ts b/src/mol-model/structure/coordinates/coordinates.ts index d7e294b7bb8ddafd6b7360142ed2717a890fa03a..d86b2ed3833c2d2d814537215954ff84e9f8eb7b 100644 --- a/src/mol-model/structure/coordinates/coordinates.ts +++ b/src/mol-model/structure/coordinates/coordinates.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2019-2023 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author David Sehnal <david.sehnal@gmail.com> @@ -99,7 +99,7 @@ namespace Coordinates { /** * Only use ordering if it's not identity. */ - export function getAtomicConformation(frame: Frame, atomId: Column<number>, ordering?: ArrayLike<number>): AtomicConformation { + export function getAtomicConformation(frame: Frame, fields: { atomId: Column<number>, occupancy?: Column<number>, B_iso_or_equiv?: Column<number> }, ordering?: ArrayLike<number>): AtomicConformation { let { x, y, z } = frame; if (frame.xyzOrdering.frozen) { @@ -143,9 +143,9 @@ namespace Coordinates { return { id: UUID.create22(), - atomId, - occupancy: Column.ofConst(1, frame.elementCount, Column.Schema.int), - B_iso_or_equiv: Column.ofConst(0, frame.elementCount, Column.Schema.float), + atomId: fields.atomId, + occupancy: fields.occupancy ?? Column.ofConst(1, frame.elementCount, Column.Schema.int), + B_iso_or_equiv: fields.B_iso_or_equiv ?? Column.ofConst(0, frame.elementCount, Column.Schema.float), xyzDefined: true, x, y, diff --git a/src/mol-model/structure/model/model.ts b/src/mol-model/structure/model/model.ts index 206d98f91a44cf2304d2e12bb51f9d12085a236c..6e2386abc4c836d8cc52bbafb8eb7b5f1217077e 100644 --- a/src/mol-model/structure/model/model.ts +++ b/src/mol-model/structure/model/model.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2017-2023 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> @@ -112,7 +112,11 @@ export namespace Model { ...model, id: UUID.create22(), modelNum: i, - atomicConformation: Coordinates.getAtomicConformation(f, model.atomicConformation.atomId, srcIndexArray), + atomicConformation: Coordinates.getAtomicConformation(f, { + atomId: model.atomicConformation.atomId, + occupancy: model.atomicConformation.occupancy, + B_iso_or_equiv: model.atomicConformation.B_iso_or_equiv + }, srcIndexArray), // TODO: add support for supplying sphere and gaussian coordinates in addition to atomic coordinates? // coarseConformation: coarse.conformation, customProperties: new CustomProperties(),