molstar 3.0.0-dev.8 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/build/viewer/index.html +2 -2
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/viewer/app.d.ts +230 -0
- package/lib/apps/viewer/app.js +528 -0
- package/lib/apps/viewer/index.d.ts +2 -225
- package/lib/apps/viewer/index.html +2 -2
- package/lib/apps/viewer/index.js +2 -509
- package/lib/commonjs/apps/viewer/app.d.ts +230 -0
- package/lib/commonjs/apps/viewer/app.js +534 -0
- package/lib/commonjs/apps/viewer/index.d.ts +2 -225
- package/lib/commonjs/apps/viewer/index.js +2 -512
- package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
- package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/commonjs/extensions/anvil/representation.js +1 -1
- package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
- package/lib/commonjs/extensions/model-export/export.js +129 -0
- package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
- package/lib/commonjs/extensions/model-export/index.js +36 -0
- package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
- package/lib/commonjs/extensions/model-export/ui.js +77 -0
- package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/commonjs/mol-canvas3d/canvas3d.js +2 -2
- package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
- package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
- package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
- package/lib/commonjs/mol-gl/renderer.js +3 -3
- package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
- package/lib/commonjs/mol-io/reader/mol2/parser.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/mol2/parser.js +33 -3
- package/lib/commonjs/mol-io/reader/mol2/schema.d.ts +12 -1
- package/lib/commonjs/mol-io/reader/mol2/schema.js +1 -1
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
- package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/commonjs/mol-model/structure/structure/element/stats.js +8 -0
- package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
- package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.js +11 -2
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +20 -10
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +21 -11
- package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
- package/lib/commonjs/mol-model/volume/volume.js +18 -0
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
- package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
- package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
- package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
- package/lib/commonjs/mol-model-formats/structure/mol2.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/mol2.js +37 -7
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
- package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
- package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
- package/lib/commonjs/mol-plugin/config.d.ts +1 -1
- package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
- package/lib/commonjs/mol-plugin/spec.js +3 -1
- package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
- package/lib/commonjs/mol-plugin-state/actions/structure.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/actions/structure.js +41 -8
- package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
- package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
- package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/commonjs/mol-repr/visual.d.ts +1 -1
- package/lib/commonjs/mol-repr/visual.js +2 -1
- package/lib/commonjs/mol-state/transform.js +12 -2
- package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
- package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
- package/lib/commonjs/mol-theme/color/element-symbol.d.ts +289 -3
- package/lib/commonjs/mol-theme/color/element-symbol.js +25 -15
- package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/commonjs/mol-theme/color/entity-id.js +29 -5
- package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
- package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
- package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
- package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
- package/lib/commonjs/mol-theme/color.d.ts +253 -15
- package/lib/commonjs/mol-util/color/color.d.ts +1 -1
- package/lib/commonjs/mol-util/color/color.js +1 -1
- package/lib/commonjs/mol-util/color/params.d.ts +10 -0
- package/lib/commonjs/mol-util/color/params.js +19 -0
- package/lib/commonjs/servers/volume/config.js +3 -3
- package/lib/commonjs/servers/volume/query.js +1 -1
- package/lib/examples/basic-wrapper/index.js +7 -3
- package/lib/examples/proteopedia-wrapper/index.js +7 -1
- package/lib/extensions/anvil/representation.js +1 -1
- package/lib/extensions/model-export/export.d.ts +9 -0
- package/lib/extensions/model-export/export.js +125 -0
- package/lib/extensions/model-export/index.d.ts +7 -0
- package/lib/extensions/model-export/index.js +33 -0
- package/lib/extensions/model-export/ui.d.ts +11 -0
- package/lib/extensions/model-export/ui.js +74 -0
- package/lib/extensions/mp4-export/encoder.js +1 -1
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
- package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
- package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
- package/lib/mol-canvas3d/canvas3d.js +2 -2
- package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
- package/lib/mol-canvas3d/controls/trackball.js +51 -12
- package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/mol-canvas3d/passes/draw.js +3 -3
- package/lib/mol-gl/renderer.d.ts +2 -2
- package/lib/mol-gl/renderer.js +3 -3
- package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
- package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
- package/lib/mol-io/reader/mol/parser.d.ts +23 -1
- package/lib/mol-io/reader/mol/parser.js +112 -3
- package/lib/mol-io/reader/mol2/parser.d.ts +1 -1
- package/lib/mol-io/reader/mol2/parser.js +33 -3
- package/lib/mol-io/reader/mol2/schema.d.ts +12 -1
- package/lib/mol-io/reader/mol2/schema.js +1 -1
- package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
- package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
- package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
- package/lib/mol-io/reader/sdf/parser.js +12 -3
- package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
- package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
- package/lib/mol-math/geometry/symmetry-operator.js +10 -4
- package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
- package/lib/mol-model/structure/export/mmcif.js +8 -5
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
- package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/mol-model/structure/structure/element/stats.js +8 -0
- package/lib/mol-model/structure/structure/properties.d.ts +1 -0
- package/lib/mol-model/structure/structure/properties.js +2 -1
- package/lib/mol-model/structure/structure/symmetry.js +1 -3
- package/lib/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
- package/lib/mol-model/structure/structure/unit/bonds/common.js +9 -1
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -11
- package/lib/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
- package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +22 -12
- package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
- package/lib/mol-model/volume/volume.d.ts +7 -0
- package/lib/mol-model/volume/volume.js +18 -0
- package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
- package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
- package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
- package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
- package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
- package/lib/mol-model-formats/structure/basic/entities.js +25 -22
- package/lib/mol-model-formats/structure/basic/parser.js +19 -10
- package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
- package/lib/mol-model-formats/structure/basic/properties.js +12 -25
- package/lib/mol-model-formats/structure/mol.d.ts +2 -1
- package/lib/mol-model-formats/structure/mol.js +17 -3
- package/lib/mol-model-formats/structure/mol2.d.ts +1 -1
- package/lib/mol-model-formats/structure/mol2.js +37 -7
- package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
- package/lib/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
- package/lib/mol-model-props/common/custom-property.d.ts +1 -1
- package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
- package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
- package/lib/mol-plugin/animation-loop.d.ts +2 -0
- package/lib/mol-plugin/animation-loop.js +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/mol-plugin/commands.d.ts +6 -2
- package/lib/mol-plugin/config.d.ts +1 -1
- package/lib/mol-plugin/spec.d.ts +1 -1
- package/lib/mol-plugin/spec.js +3 -1
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/actions/file.d.ts +3 -2
- package/lib/mol-plugin-state/actions/file.js +67 -31
- package/lib/mol-plugin-state/actions/structure.d.ts +1 -0
- package/lib/mol-plugin-state/actions/structure.js +41 -8
- package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/mol-plugin-state/actions/volume.js +3 -3
- package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
- package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
- package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
- package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
- package/lib/mol-plugin-state/animation/model.d.ts +4 -0
- package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
- package/lib/mol-plugin-state/formats/volume.js +1 -11
- package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
- package/lib/mol-plugin-state/manager/animation.js +5 -5
- package/lib/mol-plugin-ui/structure/superposition.js +2 -2
- package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
- package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
- package/lib/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/mol-repr/shape/loci/common.js +3 -3
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/mol-repr/visual.d.ts +1 -1
- package/lib/mol-repr/visual.js +2 -1
- package/lib/mol-state/transform.js +12 -2
- package/lib/mol-state/tree/immutable.d.ts +18 -0
- package/lib/mol-state/tree/transient.d.ts +3 -4
- package/lib/mol-theme/color/element-symbol.d.ts +289 -3
- package/lib/mol-theme/color/element-symbol.js +25 -15
- package/lib/mol-theme/color/entity-id.d.ts +1 -1
- package/lib/mol-theme/color/entity-id.js +29 -5
- package/lib/mol-theme/color/illustrative.d.ts +100 -29
- package/lib/mol-theme/color/illustrative.js +26 -7
- package/lib/mol-theme/color/molecule-type.d.ts +19 -1
- package/lib/mol-theme/color/molecule-type.js +10 -5
- package/lib/mol-theme/color/residue-name.d.ts +77 -1
- package/lib/mol-theme/color/residue-name.js +10 -5
- package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
- package/lib/mol-theme/color/secondary-structure.js +10 -5
- package/lib/mol-theme/color.d.ts +253 -15
- package/lib/mol-util/color/color.d.ts +1 -1
- package/lib/mol-util/color/color.js +1 -1
- package/lib/mol-util/color/params.d.ts +10 -0
- package/lib/mol-util/color/params.js +15 -0
- package/lib/servers/volume/config.js +3 -3
- package/lib/servers/volume/query.js +1 -1
- package/package.json +36 -38
package/lib/mol-gl/renderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -37,7 +37,7 @@ export declare const enum MarkingType {
|
|
|
37
37
|
interface Renderer {
|
|
38
38
|
readonly stats: RendererStats;
|
|
39
39
|
readonly props: Readonly<RendererProps>;
|
|
40
|
-
clear: (toBackgroundColor: boolean) => void;
|
|
40
|
+
clear: (toBackgroundColor: boolean, ignoreTransparentBackground?: boolean) => void;
|
|
41
41
|
clearDepth: () => void;
|
|
42
42
|
update: (camera: ICamera) => void;
|
|
43
43
|
renderPick: (group: Scene.Group, camera: ICamera, variant: GraphicsRenderVariant, depthTexture: Texture | null, pickType: PickType) => void;
|
package/lib/mol-gl/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -379,12 +379,12 @@ var Renderer;
|
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
return {
|
|
382
|
-
clear: function (toBackgroundColor) {
|
|
382
|
+
clear: function (toBackgroundColor, ignoreTransparentBackground) {
|
|
383
383
|
state.enable(gl.SCISSOR_TEST);
|
|
384
384
|
state.enable(gl.DEPTH_TEST);
|
|
385
385
|
state.colorMask(true, true, true, true);
|
|
386
386
|
state.depthMask(true);
|
|
387
|
-
if (transparentBackground) {
|
|
387
|
+
if (transparentBackground && !ignoreTransparentBackground) {
|
|
388
388
|
state.clearColor(0, 0, 0, 0);
|
|
389
389
|
}
|
|
390
390
|
else if (toBackgroundColor) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'BIRD' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'CCD' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'mmCIF' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'mmCIF' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -670,7 +670,7 @@ export declare const mmCIF_Schema: {
|
|
|
670
670
|
/**
|
|
671
671
|
* An abbreviation that identifies the database.
|
|
672
672
|
*/
|
|
673
|
-
database_id: Schema.Aliased<"CAS" | "CSD" | "EMDB" | "ICSD" | "MDF" | "NDB" | "NBS" | "PDB" | "PDF" | "RCSB" | "EBI" | "PDBE" | "BMRB" | "WWPDB" | "PDB_ACC">;
|
|
673
|
+
database_id: Schema.Aliased<"AFDB" | "CAS" | "CSD" | "EMDB" | "ICSD" | "MA" | "MDF" | "MODBASE" | "NDB" | "NBS" | "PDB" | "PDF" | "RCSB" | "SMR" | "EBI" | "PDBE" | "BMRB" | "WWPDB" | "PDB_ACC">;
|
|
674
674
|
/**
|
|
675
675
|
* The code assigned by the database identified in
|
|
676
676
|
* _database_2.database_id.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
|
-
* Code-generated 'mmCIF' schema file. Dictionary versions: mmCIF 5.
|
|
4
|
+
* Code-generated 'mmCIF' schema file. Dictionary versions: mmCIF 5.354, IHM 1.17, MA 1.3.3.
|
|
5
5
|
*
|
|
6
6
|
* @author molstar/ciftools package
|
|
7
7
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
2
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
5
6
|
*/
|
|
6
7
|
import { Column } from '../../../mol-data/db';
|
|
7
8
|
import { Task } from '../../../mol-task';
|
|
@@ -18,6 +19,7 @@ export interface MolFile {
|
|
|
18
19
|
readonly y: Column<number>;
|
|
19
20
|
readonly z: Column<number>;
|
|
20
21
|
readonly type_symbol: Column<string>;
|
|
22
|
+
readonly formal_charge: Column<number>;
|
|
21
23
|
};
|
|
22
24
|
readonly bonds: {
|
|
23
25
|
readonly count: number;
|
|
@@ -25,7 +27,27 @@ export interface MolFile {
|
|
|
25
27
|
readonly atomIdxB: Column<number>;
|
|
26
28
|
readonly order: Column<number>;
|
|
27
29
|
};
|
|
30
|
+
readonly formalCharges: {
|
|
31
|
+
readonly atomIdx: Column<number>;
|
|
32
|
+
readonly charge: Column<number>;
|
|
33
|
+
};
|
|
28
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @param key - The value found at the atom block.
|
|
37
|
+
* @returns The actual formal charge based on the mapping.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formalChargeMapper(key: number): 0 | 1 | 3 | 2 | -3 | -1 | -2;
|
|
29
40
|
export declare function handleAtoms(tokenizer: Tokenizer, count: number): MolFile['atoms'];
|
|
30
41
|
export declare function handleBonds(tokenizer: Tokenizer, count: number): MolFile['bonds'];
|
|
42
|
+
interface FormalChargesRawData {
|
|
43
|
+
atomIdx: Array<number>;
|
|
44
|
+
charge: Array<number>;
|
|
45
|
+
}
|
|
46
|
+
export declare function handleFormalCharges(tokenizer: Tokenizer, lineStart: number, formalCharges: FormalChargesRawData): void;
|
|
47
|
+
/** Call an appropriate handler based on the property type.
|
|
48
|
+
* (For now it only calls the formal charge handler, additional handlers can
|
|
49
|
+
* be added for other properties.)
|
|
50
|
+
*/
|
|
51
|
+
export declare function handlePropertiesBlock(tokenizer: Tokenizer): MolFile['formalCharges'];
|
|
31
52
|
export declare function parseMol(data: string): Task<Result<MolFile>>;
|
|
53
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
2
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
5
6
|
*/
|
|
6
7
|
import { __awaiter, __generator } from "tslib";
|
|
7
8
|
import { Column } from '../../../mol-data/db';
|
|
@@ -9,11 +10,57 @@ import { Task } from '../../../mol-task';
|
|
|
9
10
|
import { TokenColumnProvider as TokenColumn } from '../common/text/column/token';
|
|
10
11
|
import { TokenBuilder, Tokenizer } from '../common/text/tokenizer';
|
|
11
12
|
import { ReaderResult as Result } from '../result';
|
|
13
|
+
/*
|
|
14
|
+
The atom lines in a .mol file have the following structure:
|
|
15
|
+
|
|
16
|
+
xxxxx.xxxxyyyyy.yyyyzzzzz.zzzz aaaddcccssshhhbbbvvvHHHrrriiimmmnnneee
|
|
17
|
+
---------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
Below is a breakdown of each component and its start/end indices:
|
|
20
|
+
|
|
21
|
+
xxxxx.xxxx (X COORDINATE, 1-10)
|
|
22
|
+
yyyyy.yyyy (Y COORDINATE, 10-20)
|
|
23
|
+
zzzzz.zzzz (Z COORDINATE, 20-30)
|
|
24
|
+
_ (30 IS EMPTY)
|
|
25
|
+
aaa (ATOM SYMBOL, 31-34)
|
|
26
|
+
dd (MASS DIFF, 34-36)
|
|
27
|
+
ccc (FORMAL CHARGE, 36-39)
|
|
28
|
+
sss (ATOM STEREO PARITY, 39-42)
|
|
29
|
+
hhh (HYDROGEN COUNT+1, 42-45)
|
|
30
|
+
bbb (STEREO CARE BOX, 45-48)
|
|
31
|
+
vvv (VALENCE, 48-51)
|
|
32
|
+
HHH (H0 DESIGNATOR, 51-54)
|
|
33
|
+
rrr (UNUSED, 54-57)
|
|
34
|
+
iii (UNUSED, 57-60)
|
|
35
|
+
mmm (ATOM-ATOM MAPPING NUMBER, 60-63)
|
|
36
|
+
nnn (INVERSION/RETENTION FLAG, 63-66)
|
|
37
|
+
eee (EXACT CHANGE FLAG, 66-69)
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @param key - The value found at the atom block.
|
|
41
|
+
* @returns The actual formal charge based on the mapping.
|
|
42
|
+
*/
|
|
43
|
+
export function formalChargeMapper(key) {
|
|
44
|
+
switch (key) {
|
|
45
|
+
case 7: return -3;
|
|
46
|
+
case 6: return -2;
|
|
47
|
+
case 5: return -1;
|
|
48
|
+
case 0: return 0;
|
|
49
|
+
case 3: return 1;
|
|
50
|
+
case 2: return 2;
|
|
51
|
+
case 1: return 3;
|
|
52
|
+
case 4: return 0;
|
|
53
|
+
default:
|
|
54
|
+
console.error("Value ".concat(key, " is outside the 0-7 range, defaulting to 0."));
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
12
58
|
export function handleAtoms(tokenizer, count) {
|
|
13
59
|
var x = TokenBuilder.create(tokenizer.data, count * 2);
|
|
14
60
|
var y = TokenBuilder.create(tokenizer.data, count * 2);
|
|
15
61
|
var z = TokenBuilder.create(tokenizer.data, count * 2);
|
|
16
62
|
var type_symbol = TokenBuilder.create(tokenizer.data, count * 2);
|
|
63
|
+
var formal_charge = TokenBuilder.create(tokenizer.data, count * 2);
|
|
17
64
|
for (var i = 0; i < count; ++i) {
|
|
18
65
|
Tokenizer.markLine(tokenizer);
|
|
19
66
|
var s = tokenizer.tokenStart, position = tokenizer.position;
|
|
@@ -25,6 +72,8 @@ export function handleAtoms(tokenizer, count) {
|
|
|
25
72
|
TokenBuilder.addUnchecked(z, tokenizer.tokenStart, tokenizer.tokenEnd);
|
|
26
73
|
Tokenizer.trim(tokenizer, s + 31, s + 34);
|
|
27
74
|
TokenBuilder.addUnchecked(type_symbol, tokenizer.tokenStart, tokenizer.tokenEnd);
|
|
75
|
+
Tokenizer.trim(tokenizer, s + 36, s + 39);
|
|
76
|
+
TokenBuilder.addUnchecked(formal_charge, tokenizer.tokenStart, tokenizer.tokenEnd);
|
|
28
77
|
tokenizer.position = position;
|
|
29
78
|
}
|
|
30
79
|
return {
|
|
@@ -32,7 +81,8 @@ export function handleAtoms(tokenizer, count) {
|
|
|
32
81
|
x: TokenColumn(x)(Column.Schema.float),
|
|
33
82
|
y: TokenColumn(y)(Column.Schema.float),
|
|
34
83
|
z: TokenColumn(z)(Column.Schema.float),
|
|
35
|
-
type_symbol: TokenColumn(type_symbol)(Column.Schema.str)
|
|
84
|
+
type_symbol: TokenColumn(type_symbol)(Column.Schema.str),
|
|
85
|
+
formal_charge: TokenColumn(formal_charge)(Column.Schema.int)
|
|
36
86
|
};
|
|
37
87
|
}
|
|
38
88
|
export function handleBonds(tokenizer, count) {
|
|
@@ -57,6 +107,63 @@ export function handleBonds(tokenizer, count) {
|
|
|
57
107
|
order: TokenColumn(order)(Column.Schema.int)
|
|
58
108
|
};
|
|
59
109
|
}
|
|
110
|
+
export function handleFormalCharges(tokenizer, lineStart, formalCharges) {
|
|
111
|
+
Tokenizer.trim(tokenizer, lineStart + 6, lineStart + 9);
|
|
112
|
+
var numOfCharges = parseInt(Tokenizer.getTokenString(tokenizer));
|
|
113
|
+
for (var i = 0; i < numOfCharges; ++i) {
|
|
114
|
+
/*
|
|
115
|
+
M CHG 3 1 -1 2 0 2 -1
|
|
116
|
+
| | | | |
|
|
117
|
+
| | | | |__charge2 (etc.)
|
|
118
|
+
| | | |
|
|
119
|
+
| | | |__atomIdx2
|
|
120
|
+
| | |
|
|
121
|
+
| | |__charge1
|
|
122
|
+
| |
|
|
123
|
+
| |__atomIdx1 (cursor at position 12)
|
|
124
|
+
|
|
|
125
|
+
|___numOfCharges
|
|
126
|
+
*/
|
|
127
|
+
var offset = 9 + (i * 8);
|
|
128
|
+
Tokenizer.trim(tokenizer, lineStart + offset, lineStart + offset + 4);
|
|
129
|
+
var _atomIdx = Tokenizer.getTokenString(tokenizer);
|
|
130
|
+
formalCharges.atomIdx.push(+_atomIdx);
|
|
131
|
+
Tokenizer.trim(tokenizer, lineStart + offset + 4, lineStart + offset + 8);
|
|
132
|
+
var _charge = Tokenizer.getTokenString(tokenizer);
|
|
133
|
+
formalCharges.charge.push(+_charge);
|
|
134
|
+
}
|
|
135
|
+
/* Once the line is read, move to the next one. */
|
|
136
|
+
Tokenizer.eatLine(tokenizer);
|
|
137
|
+
}
|
|
138
|
+
/** Call an appropriate handler based on the property type.
|
|
139
|
+
* (For now it only calls the formal charge handler, additional handlers can
|
|
140
|
+
* be added for other properties.)
|
|
141
|
+
*/
|
|
142
|
+
export function handlePropertiesBlock(tokenizer) {
|
|
143
|
+
var _atomIdx = [];
|
|
144
|
+
var _charge = [];
|
|
145
|
+
var _formalCharges = { atomIdx: _atomIdx, charge: _charge };
|
|
146
|
+
while (tokenizer.position < tokenizer.length) {
|
|
147
|
+
var s = tokenizer.position;
|
|
148
|
+
Tokenizer.trim(tokenizer, s + 3, s + 6);
|
|
149
|
+
var propertyType = Tokenizer.getTokenString(tokenizer);
|
|
150
|
+
if (propertyType === 'END')
|
|
151
|
+
break;
|
|
152
|
+
Tokenizer.eatLine(tokenizer);
|
|
153
|
+
switch (propertyType) {
|
|
154
|
+
case 'CHG':
|
|
155
|
+
handleFormalCharges(tokenizer, s, _formalCharges);
|
|
156
|
+
break;
|
|
157
|
+
default:
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
var formalCharges = {
|
|
162
|
+
atomIdx: Column.ofIntArray(_formalCharges.atomIdx),
|
|
163
|
+
charge: Column.ofIntArray(_formalCharges.charge)
|
|
164
|
+
};
|
|
165
|
+
return formalCharges;
|
|
166
|
+
}
|
|
60
167
|
function parseInternal(data) {
|
|
61
168
|
var tokenizer = Tokenizer(data);
|
|
62
169
|
var title = Tokenizer.readLine(tokenizer).trim();
|
|
@@ -66,12 +173,14 @@ function parseInternal(data) {
|
|
|
66
173
|
var atomCount = +counts.substr(0, 3), bondCount = +counts.substr(3, 3);
|
|
67
174
|
var atoms = handleAtoms(tokenizer, atomCount);
|
|
68
175
|
var bonds = handleBonds(tokenizer, bondCount);
|
|
176
|
+
var formalCharges = handlePropertiesBlock(tokenizer);
|
|
69
177
|
var result = {
|
|
70
178
|
title: title,
|
|
71
179
|
program: program,
|
|
72
180
|
comment: comment,
|
|
73
181
|
atoms: atoms,
|
|
74
|
-
bonds: bonds
|
|
182
|
+
bonds: bonds,
|
|
183
|
+
formalCharges: formalCharges,
|
|
75
184
|
};
|
|
76
185
|
return Result.success(result);
|
|
77
186
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2017-
|
|
2
|
+
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Zepei Xu <xuzepei19950617@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2017-
|
|
2
|
+
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Zepei Xu <xuzepei19950617@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -241,9 +241,38 @@ function handleBonds(state) {
|
|
|
241
241
|
});
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
+
function handleCrysin(state) {
|
|
245
|
+
var tokenizer = state.tokenizer;
|
|
246
|
+
while (tokenizer.position < tokenizer.data.length) {
|
|
247
|
+
var l = getTokenString(tokenizer);
|
|
248
|
+
if (l === '@<TRIPOS>MOLECULE') {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
else if (l === '@<TRIPOS>CRYSIN') {
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
markLine(tokenizer);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (tokenizer.position >= tokenizer.data.length)
|
|
259
|
+
return;
|
|
260
|
+
markLine(tokenizer);
|
|
261
|
+
var values = getTokenString(tokenizer).trim().split(reWhitespace);
|
|
262
|
+
return {
|
|
263
|
+
a: parseFloat(values[0]),
|
|
264
|
+
b: parseFloat(values[1]),
|
|
265
|
+
c: parseFloat(values[2]),
|
|
266
|
+
alpha: parseFloat(values[3]),
|
|
267
|
+
beta: parseFloat(values[4]),
|
|
268
|
+
gamma: parseFloat(values[5]),
|
|
269
|
+
spaceGroup: parseInt(values[6], 10),
|
|
270
|
+
setting: parseInt(values[7], 10),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
244
273
|
function parseInternal(ctx, data, name) {
|
|
245
274
|
return __awaiter(this, void 0, void 0, function () {
|
|
246
|
-
var tokenizer, structures, state, atoms, bonds, result;
|
|
275
|
+
var tokenizer, structures, state, atoms, bonds, crysin, result;
|
|
247
276
|
return __generator(this, function (_a) {
|
|
248
277
|
switch (_a.label) {
|
|
249
278
|
case 0:
|
|
@@ -261,7 +290,8 @@ function parseInternal(ctx, data, name) {
|
|
|
261
290
|
return [4 /*yield*/, handleBonds(state)];
|
|
262
291
|
case 3:
|
|
263
292
|
bonds = _a.sent();
|
|
264
|
-
|
|
293
|
+
crysin = handleCrysin(state);
|
|
294
|
+
structures.push({ molecule: state.molecule, atoms: atoms, bonds: bonds, crysin: crysin });
|
|
265
295
|
skipWhitespace(tokenizer);
|
|
266
296
|
while (getTokenString(tokenizer) !== '@<TRIPOS>MOLECULE' && tokenizer.position < tokenizer.data.length) {
|
|
267
297
|
markLine(tokenizer);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
2
|
+
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -37,10 +37,21 @@ export interface Mol2Bonds {
|
|
|
37
37
|
bond_type: Column<string>;
|
|
38
38
|
status_bits: Column<string>;
|
|
39
39
|
}
|
|
40
|
+
export interface Mol2Crysin {
|
|
41
|
+
a: number;
|
|
42
|
+
b: number;
|
|
43
|
+
c: number;
|
|
44
|
+
alpha: number;
|
|
45
|
+
beta: number;
|
|
46
|
+
gamma: number;
|
|
47
|
+
spaceGroup: number;
|
|
48
|
+
setting: number;
|
|
49
|
+
}
|
|
40
50
|
export interface Mol2Structure {
|
|
41
51
|
molecule: Readonly<Mol2Molecule>;
|
|
42
52
|
atoms: Readonly<Mol2Atoms>;
|
|
43
53
|
bonds: Readonly<Mol2Bonds>;
|
|
54
|
+
crysin?: Readonly<Mol2Crysin>;
|
|
44
55
|
}
|
|
45
56
|
export interface Mol2File {
|
|
46
57
|
name: string;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Jason Pattle <jpattle@exscientia.co.uk>
|
|
5
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
6
|
+
*/
|
|
1
7
|
import { MolFile } from '../mol/parser';
|
|
2
8
|
import { Tokenizer } from '../common/text/tokenizer';
|
|
3
9
|
export declare function isV3(versionLine: string): boolean;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Jason Pattle <jpattle@exscientia.co.uk>
|
|
5
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
6
|
+
*/
|
|
1
7
|
import { Column } from '../../../mol-data/db';
|
|
2
8
|
import { Tokenizer, TokenBuilder } from '../common/text/tokenizer';
|
|
3
9
|
import { TokenColumnProvider as TokenColumn } from '../common/text/column/token';
|
|
@@ -44,6 +50,9 @@ export function handleAtomsV3(tokenizer, atomCount) {
|
|
|
44
50
|
y: TokenColumn(y)(Column.Schema.float),
|
|
45
51
|
z: TokenColumn(z)(Column.Schema.float),
|
|
46
52
|
type_symbol: TokenColumn(type_symbol)(Column.Schema.str),
|
|
53
|
+
/* No support for formal charge parsing in V3000 molfiles at the moment,
|
|
54
|
+
so all charges default to 0.*/
|
|
55
|
+
formal_charge: Column.ofConst(0, atomCount, Column.Schema.int)
|
|
47
56
|
};
|
|
48
57
|
}
|
|
49
58
|
export function handleBondsV3(tokenizer, bondCount) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
* @author Jason Pattle <jpattle@exscientia.co.uk>
|
|
7
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
6
8
|
*/
|
|
7
9
|
import { Column } from '../../../mol-data/db';
|
|
8
10
|
import { MolFile } from '../mol/parser';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
* @author Jason Pattle <jpattle@exscientia.co.uk>
|
|
7
|
+
* @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
|
|
6
8
|
*/
|
|
7
9
|
import { __awaiter, __generator } from "tslib";
|
|
8
10
|
import { Column } from '../../../mol-data/db';
|
|
9
|
-
import { handleAtoms, handleBonds } from '../mol/parser';
|
|
11
|
+
import { handleAtoms, handleBonds, handlePropertiesBlock } from '../mol/parser';
|
|
10
12
|
import { Task } from '../../../mol-task';
|
|
11
13
|
import { ReaderResult as Result } from '../result';
|
|
12
14
|
import { Tokenizer, TokenBuilder } from '../common/text/tokenizer';
|
|
@@ -69,11 +71,18 @@ function handleMolFile(tokenizer) {
|
|
|
69
71
|
}
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
74
|
+
/* No support for formal charge parsing in V3000 molfiles at the moment,
|
|
75
|
+
so all charges default to 0.*/
|
|
76
|
+
var nullFormalCharges = {
|
|
77
|
+
atomIdx: Column.ofConst(0, atomCount, Column.Schema.int),
|
|
78
|
+
charge: Column.ofConst(0, atomCount, Column.Schema.int)
|
|
79
|
+
};
|
|
72
80
|
var atoms = molIsV3 ? handleAtomsV3(tokenizer, atomCount) : handleAtoms(tokenizer, atomCount);
|
|
73
81
|
var bonds = molIsV3 ? handleBondsV3(tokenizer, bondCount) : handleBonds(tokenizer, bondCount);
|
|
82
|
+
var formalCharges = molIsV3 ? nullFormalCharges : handlePropertiesBlock(tokenizer);
|
|
74
83
|
var dataItems = handleDataItems(tokenizer);
|
|
75
84
|
return {
|
|
76
|
-
molFile: { title: title, program: program, comment: comment, atoms: atoms, bonds: bonds },
|
|
85
|
+
molFile: { title: title, program: program, comment: comment, atoms: atoms, bonds: bonds, formalCharges: formalCharges },
|
|
77
86
|
dataItems: dataItems
|
|
78
87
|
};
|
|
79
88
|
}
|
|
@@ -170,8 +170,15 @@ function getFieldData(field, arrayCtor, totalCount, data) {
|
|
|
170
170
|
allPresent = false;
|
|
171
171
|
}
|
|
172
172
|
else {
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
var value = getter(key, d, offset);
|
|
174
|
+
if (typeof value === 'string' && !value) {
|
|
175
|
+
mask[offset] = 1 /* NotPresent */;
|
|
176
|
+
allPresent = false;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
mask[offset] = 0 /* Present */;
|
|
180
|
+
}
|
|
181
|
+
array[offset] = value;
|
|
175
182
|
}
|
|
176
183
|
offset++;
|
|
177
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import { __spreadArray } from "tslib";
|
|
8
8
|
import { Vec3, Mat4, EPSILON } from '../../linear-algebra';
|
|
9
9
|
import { OrderedSet } from '../../../mol-data/int';
|
|
10
|
+
import { Axes3D } from './axes3d';
|
|
11
|
+
import { PrincipalAxes } from '../../linear-algebra/matrix/principal-axes';
|
|
10
12
|
function Sphere3D() {
|
|
11
13
|
return Sphere3D.zero();
|
|
12
14
|
}
|
|
@@ -193,11 +195,22 @@ function Sphere3D() {
|
|
|
193
195
|
return out;
|
|
194
196
|
}
|
|
195
197
|
if (hasExtrema(sphere)) {
|
|
198
|
+
var positions = new Float32Array(sphere.extrema.length * 3);
|
|
199
|
+
for (var i = 0; i < sphere.extrema.length; i++) {
|
|
200
|
+
Vec3.toArray(sphere.extrema[i], positions, i * 3);
|
|
201
|
+
}
|
|
202
|
+
var axes_1 = PrincipalAxes.calculateMomentsAxes(positions);
|
|
203
|
+
Axes3D.scale(axes_1, Axes3D.normalize(axes_1, axes_1), delta);
|
|
196
204
|
setExtrema(out, sphere.extrema.map(function (e) {
|
|
197
205
|
Vec3.sub(tmpDir, e, sphere.center);
|
|
198
|
-
var
|
|
199
|
-
Vec3.
|
|
200
|
-
|
|
206
|
+
var out = Vec3.clone(e);
|
|
207
|
+
var sA = Vec3.dot(tmpDir, axes_1.dirA) < 0 ? -1 : 1;
|
|
208
|
+
Vec3.scaleAndAdd(out, out, axes_1.dirA, sA);
|
|
209
|
+
var sB = Vec3.dot(tmpDir, axes_1.dirB) < 0 ? -1 : 1;
|
|
210
|
+
Vec3.scaleAndAdd(out, out, axes_1.dirB, sB);
|
|
211
|
+
var sC = Vec3.dot(tmpDir, axes_1.dirC) < 0 ? -1 : 1;
|
|
212
|
+
Vec3.scaleAndAdd(out, out, axes_1.dirC, sC);
|
|
213
|
+
return out;
|
|
201
214
|
}));
|
|
202
215
|
}
|
|
203
216
|
return out;
|
|
@@ -42,7 +42,7 @@ declare namespace SymmetryOperator {
|
|
|
42
42
|
hkl?: Vec3;
|
|
43
43
|
spgrOp?: number;
|
|
44
44
|
};
|
|
45
|
-
function create(name: string, matrix: Mat4, info?: CreateInfo): SymmetryOperator;
|
|
45
|
+
function create(name: string, matrix: Mat4, info?: CreateInfo | SymmetryOperator): SymmetryOperator;
|
|
46
46
|
function checkIfRotationAndTranslation(rot: Mat3, offset: Vec3): boolean;
|
|
47
47
|
function ofRotationAndOffset(name: string, rot: Mat3, offset: Vec3, ncsId?: number): SymmetryOperator;
|
|
48
48
|
function lerpFromIdentity(out: Mat4, op: SymmetryOperator, t: number): Mat4;
|
|
@@ -19,8 +19,9 @@ var SymmetryOperator;
|
|
|
19
19
|
var _hkl = hkl ? Vec3.clone(hkl) : Vec3();
|
|
20
20
|
spgrOp = defaults(spgrOp, -1);
|
|
21
21
|
ncsId = ncsId || -1;
|
|
22
|
-
var
|
|
23
|
-
|
|
22
|
+
var isIdentity = Mat4.isIdentity(matrix);
|
|
23
|
+
var suffix = getSuffix(info, isIdentity);
|
|
24
|
+
if (isIdentity)
|
|
24
25
|
return { name: name, assembly: assembly, matrix: matrix, inverse: Mat4.identity(), isIdentity: true, hkl: _hkl, spgrOp: spgrOp, ncsId: ncsId, suffix: suffix };
|
|
25
26
|
if (!Mat4.isRotationAndTranslation(matrix, SymmetryOperator.RotationTranslationEpsilon)) {
|
|
26
27
|
console.warn("Symmetry operator (".concat(name, ") should be a composition of rotation and translation."));
|
|
@@ -28,11 +29,16 @@ var SymmetryOperator;
|
|
|
28
29
|
return { name: name, assembly: assembly, matrix: matrix, inverse: Mat4.invert(Mat4(), matrix), isIdentity: false, hkl: _hkl, spgrOp: spgrOp, ncsId: ncsId, suffix: suffix };
|
|
29
30
|
}
|
|
30
31
|
SymmetryOperator.create = create;
|
|
31
|
-
function
|
|
32
|
+
function isSymmetryOperator(x) {
|
|
33
|
+
return !!x && !!x.matrix && !!x.inverse && typeof x.name === 'string';
|
|
34
|
+
}
|
|
35
|
+
function getSuffix(info, isIdentity) {
|
|
32
36
|
if (!info)
|
|
33
37
|
return '';
|
|
34
38
|
if (info.assembly) {
|
|
35
|
-
|
|
39
|
+
if (isSymmetryOperator(info))
|
|
40
|
+
return info.suffix;
|
|
41
|
+
return isIdentity ? '' : "_".concat(info.assembly.operId);
|
|
36
42
|
}
|
|
37
43
|
if (typeof info.spgrOp !== 'undefined' && typeof info.hkl !== 'undefined' && info.spgrOp !== -1) {
|
|
38
44
|
var _a = info.hkl, i = _a[0], j = _a[1], k = _a[2];
|
|
@@ -28,5 +28,5 @@ declare type encode_mmCIF_categories_Params = {
|
|
|
28
28
|
};
|
|
29
29
|
/** Doesn't start a data block */
|
|
30
30
|
export declare function encode_mmCIF_categories(encoder: CifWriter.Encoder, structures: Structure | Structure[], params?: encode_mmCIF_categories_Params): void;
|
|
31
|
-
declare function to_mmCIF(name: string, structure: Structure, asBinary?: boolean): string | Uint8Array;
|
|
31
|
+
declare function to_mmCIF(name: string, structure: Structure, asBinary?: boolean, params?: encode_mmCIF_categories_Params): string | Uint8Array;
|
|
32
32
|
export { to_mmCIF };
|