Skip to content
Snippets Groups Projects
Unverified Commit 0def474f authored by Alexander Rose's avatar Alexander Rose Committed by GitHub
Browse files

Merge pull request #773 from molstar/model-conf-fields

include occupancy & B_iso_or_equiv in model conformation
parents 2bc381fe e0ea9a28
Branches
Tags
No related merge requests found
...@@ -20,6 +20,7 @@ Note that since we don't clearly distinguish between a public and private interf ...@@ -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 - Fix camera project/unproject when using offset viewport
- Add support for loading all blocks from a mmcif file as a trajectory - Add support for loading all blocks from a mmcif file as a trajectory
- Add `Frustum3D` and `Plane3D` math primitives - 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) - Remove LazyImports (introduced in v3.31.1)
## [v3.32.0] - 2023-03-20 ## [v3.32.0] - 2023-03-20
......
/** /**
* 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 Alexander Rose <alexander.rose@weirdbyte.de>
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
...@@ -99,7 +99,7 @@ namespace Coordinates { ...@@ -99,7 +99,7 @@ namespace Coordinates {
/** /**
* Only use ordering if it's not identity. * 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; let { x, y, z } = frame;
if (frame.xyzOrdering.frozen) { if (frame.xyzOrdering.frozen) {
...@@ -143,9 +143,9 @@ namespace Coordinates { ...@@ -143,9 +143,9 @@ namespace Coordinates {
return { return {
id: UUID.create22(), id: UUID.create22(),
atomId, atomId: fields.atomId,
occupancy: Column.ofConst(1, frame.elementCount, Column.Schema.int), occupancy: fields.occupancy ?? Column.ofConst(1, frame.elementCount, Column.Schema.int),
B_iso_or_equiv: Column.ofConst(0, frame.elementCount, Column.Schema.float), B_iso_or_equiv: fields.B_iso_or_equiv ?? Column.ofConst(0, frame.elementCount, Column.Schema.float),
xyzDefined: true, xyzDefined: true,
x, x,
y, y,
......
/** /**
* 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 David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
...@@ -112,7 +112,11 @@ export namespace Model { ...@@ -112,7 +112,11 @@ export namespace Model {
...model, ...model,
id: UUID.create22(), id: UUID.create22(),
modelNum: i, 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? // TODO: add support for supplying sphere and gaussian coordinates in addition to atomic coordinates?
// coarseConformation: coarse.conformation, // coarseConformation: coarse.conformation,
customProperties: new CustomProperties(), customProperties: new CustomProperties(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment