molstar 3.26.0 → 3.28.0
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/LICENSE +20 -20
- package/README.md +202 -202
- package/build/viewer/embedded.html +52 -52
- package/build/viewer/index.html +115 -115
- package/build/viewer/molstar.css +1 -1
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/docking-viewer/index.html +36 -36
- package/lib/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/apps/docking-viewer/viewport.js +1 -0
- package/lib/apps/viewer/app.d.ts +3 -1
- package/lib/apps/viewer/app.js +4 -0
- package/lib/apps/viewer/embedded.html +52 -52
- package/lib/apps/viewer/index.html +115 -115
- package/lib/cli/structure-info/volume.js +1 -1
- package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/commonjs/apps/docking-viewer/viewport.js +1 -0
- package/lib/commonjs/apps/viewer/app.d.ts +3 -1
- package/lib/commonjs/apps/viewer/app.js +4 -0
- package/lib/commonjs/cli/structure-info/volume.js +1 -1
- package/lib/commonjs/examples/lighting/index.js +1 -1
- package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/cellpack/model.js +2 -1
- package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/meshes/choice.d.ts +26 -0
- package/lib/commonjs/extensions/meshes/choice.js +31 -0
- package/lib/commonjs/extensions/meshes/examples.d.ts +26 -0
- package/lib/commonjs/extensions/meshes/examples.js +337 -0
- package/lib/commonjs/extensions/meshes/mesh-cif-schema.d.ts +29 -0
- package/lib/commonjs/extensions/meshes/mesh-cif-schema.js +34 -0
- package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +66 -0
- package/lib/commonjs/extensions/meshes/mesh-extension.js +221 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.js +379 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.js +30 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.js +273 -0
- package/lib/commonjs/extensions/meshes/mesh-utils.d.ts +41 -0
- package/lib/commonjs/extensions/meshes/mesh-utils.js +357 -0
- package/lib/commonjs/extensions/meshes/metadata.d.ts +108 -0
- package/lib/commonjs/extensions/meshes/metadata.js +72 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/prop.js +16 -4
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.js +156 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.js +96 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.js +576 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.js +200 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.js +32 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.js +234 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/external-api.js +85 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/global-state.js +83 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/helpers.js +171 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/index.d.ts +20 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/index.js +130 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/transformers.js +85 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/ui.d.ts +29 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/ui.js +232 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.js +83 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.js +7 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.js +78 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +2 -0
- package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
- package/lib/commonjs/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +2 -1
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +27 -13
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -2
- package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -2
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
- package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +4 -6
- package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +1 -0
- package/lib/commonjs/mol-gl/renderable/cylinders.js +1 -1
- package/lib/commonjs/mol-gl/renderable/spheres.d.ts +1 -0
- package/lib/commonjs/mol-gl/renderable/spheres.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.vert.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.vert.js +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/outlines.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/outlines.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.vert.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.vert.js +2 -2
- package/lib/commonjs/mol-gl/webgl/renderbuffer.d.ts +1 -1
- package/lib/commonjs/mol-gl/webgl/renderbuffer.js +15 -0
- package/lib/commonjs/mol-gl/webgl/state.d.ts +12 -0
- package/lib/commonjs/mol-gl/webgl/state.js +136 -0
- package/lib/commonjs/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
- package/lib/commonjs/mol-io/reader/cif/schema/segmentation.js +22 -0
- package/lib/commonjs/mol-io/reader/cif.d.ts +3 -1
- package/lib/commonjs/mol-io/reader/cif.js +3 -1
- package/lib/commonjs/mol-model/location.d.ts +2 -1
- package/lib/commonjs/mol-model/loci.d.ts +11 -11
- package/lib/commonjs/mol-model/loci.js +13 -1
- package/lib/commonjs/mol-model/sequence/alignment/sequence.d.ts +4 -1
- package/lib/commonjs/mol-model/sequence/alignment/sequence.js +4 -1
- package/lib/commonjs/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
- package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
- package/lib/commonjs/mol-model/structure/structure/util/superposition.d.ts +1 -0
- package/lib/commonjs/mol-model/structure/structure/util/superposition.js +2 -1
- package/lib/commonjs/mol-model/volume/volume.d.ts +35 -2
- package/lib/commonjs/mol-model/volume/volume.js +77 -2
- package/lib/commonjs/mol-model-formats/volume/segmentation.d.ts +23 -0
- package/lib/commonjs/mol-model-formats/volume/segmentation.js +138 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/commonjs/mol-plugin/commands.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/model-index.js +4 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +6 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/formats/provider.d.ts +2 -2
- package/lib/commonjs/mol-plugin-state/formats/provider.js +11 -3
- package/lib/commonjs/mol-plugin-state/formats/registry.js +6 -5
- package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +27 -0
- package/lib/commonjs/mol-plugin-state/formats/volume.js +65 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js +18 -13
- package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +1 -2
- package/lib/commonjs/mol-plugin-state/transforms/representation.js +5 -6
- package/lib/commonjs/mol-plugin-state/transforms/volume.d.ts +11 -1
- package/lib/commonjs/mol-plugin-state/transforms/volume.js +55 -2
- package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
- package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
- package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +1 -0
- package/lib/commonjs/mol-plugin-ui/controls/parameters.js +22 -5
- package/lib/commonjs/mol-plugin-ui/sequence/sequence.d.ts +25 -17
- package/lib/commonjs/mol-plugin-ui/sequence.d.ts +19 -1
- package/lib/commonjs/mol-plugin-ui/sequence.js +8 -1
- package/lib/commonjs/mol-plugin-ui/state/apply-action.d.ts +2 -10
- package/lib/commonjs/mol-plugin-ui/state/apply-action.js +2 -2
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +2 -2
- package/lib/commonjs/mol-plugin-ui/structure/superposition.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/structure/volume.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/structure/volume.js +3 -2
- package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/params.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/registry.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/line.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/point.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/units-visual.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-cross.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-cross.js +2 -1
- package/lib/commonjs/mol-repr/structure/visual/element-point.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-point.js +2 -1
- package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/element-sphere.js +3 -1
- package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +7 -0
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +18 -7
- package/lib/commonjs/mol-repr/structure/visual/util/common.d.ts +4 -1
- package/lib/commonjs/mol-repr/structure/visual/util/common.js +10 -6
- package/lib/commonjs/mol-repr/structure/visual/util/element.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/util/element.js +2 -3
- package/lib/commonjs/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
- package/lib/commonjs/mol-repr/volume/direct-volume.d.ts +4 -4
- package/lib/commonjs/mol-repr/volume/direct-volume.js +8 -6
- package/lib/commonjs/mol-repr/volume/isosurface.d.ts +4 -4
- package/lib/commonjs/mol-repr/volume/isosurface.js +17 -16
- package/lib/commonjs/mol-repr/volume/registry.d.ts +54 -1
- package/lib/commonjs/mol-repr/volume/registry.js +3 -1
- package/lib/commonjs/mol-repr/volume/representation.d.ts +11 -7
- package/lib/commonjs/mol-repr/volume/representation.js +142 -47
- package/lib/commonjs/mol-repr/volume/segment.d.ts +291 -0
- package/lib/commonjs/mol-repr/volume/segment.js +289 -0
- package/lib/commonjs/mol-repr/volume/slice.d.ts +2 -2
- package/lib/commonjs/mol-repr/volume/slice.js +5 -5
- package/lib/commonjs/mol-repr/volume/util.d.ts +12 -3
- package/lib/commonjs/mol-repr/volume/util.js +72 -6
- package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
- package/lib/commonjs/mol-theme/color/volume-segment.d.ts +41 -0
- package/lib/commonjs/mol-theme/color/volume-segment.js +58 -0
- package/lib/commonjs/mol-theme/color/volume-value.js +2 -1
- package/lib/commonjs/mol-theme/color.d.ts +15 -0
- package/lib/commonjs/mol-theme/color.js +2 -0
- package/lib/commonjs/mol-theme/label.d.ts +1 -1
- package/lib/commonjs/mol-theme/label.js +13 -1
- package/lib/commonjs/mol-util/param-definition.d.ts +4 -1
- package/lib/commonjs/mol-util/param-definition.js +5 -2
- package/lib/examples/alpha-orbitals/index.html +72 -72
- package/lib/examples/basic-wrapper/index.html +137 -137
- package/lib/examples/lighting/index.html +88 -88
- package/lib/examples/lighting/index.js +1 -1
- package/lib/examples/proteopedia-wrapper/index.html +236 -236
- package/lib/extensions/anvil/behavior.d.ts +1 -0
- package/lib/extensions/cellpack/model.js +2 -1
- package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/extensions/meshes/choice.d.ts +26 -0
- package/lib/extensions/meshes/choice.js +28 -0
- package/lib/extensions/meshes/examples.d.ts +26 -0
- package/lib/extensions/meshes/examples.js +325 -0
- package/lib/extensions/meshes/mesh-cif-schema.d.ts +29 -0
- package/lib/extensions/meshes/mesh-cif-schema.js +30 -0
- package/lib/extensions/meshes/mesh-extension.d.ts +66 -0
- package/lib/extensions/meshes/mesh-extension.js +218 -0
- package/lib/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
- package/lib/extensions/meshes/mesh-streaming/behavior.js +375 -0
- package/lib/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
- package/lib/extensions/meshes/mesh-streaming/server-info.js +26 -0
- package/lib/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
- package/lib/extensions/meshes/mesh-streaming/transformers.js +270 -0
- package/lib/extensions/meshes/mesh-utils.d.ts +41 -0
- package/lib/extensions/meshes/mesh-utils.js +346 -0
- package/lib/extensions/meshes/metadata.d.ts +108 -0
- package/lib/extensions/meshes/metadata.js +69 -0
- package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
- package/lib/extensions/model-archive/quality-assessment/prop.js +16 -4
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
- package/lib/extensions/volumes-and-segmentations/entry-meshes.js +153 -0
- package/lib/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
- package/lib/extensions/volumes-and-segmentations/entry-models.js +93 -0
- package/lib/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
- package/lib/extensions/volumes-and-segmentations/entry-root.js +571 -0
- package/lib/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
- package/lib/extensions/volumes-and-segmentations/entry-segmentation.js +197 -0
- package/lib/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
- package/lib/extensions/volumes-and-segmentations/entry-state.js +29 -0
- package/lib/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
- package/lib/extensions/volumes-and-segmentations/entry-volume.js +231 -0
- package/lib/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
- package/lib/extensions/volumes-and-segmentations/external-api.js +80 -0
- package/lib/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
- package/lib/extensions/volumes-and-segmentations/global-state.js +80 -0
- package/lib/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
- package/lib/extensions/volumes-and-segmentations/helpers.js +163 -0
- package/lib/extensions/volumes-and-segmentations/index.d.ts +20 -0
- package/lib/extensions/volumes-and-segmentations/index.js +127 -0
- package/lib/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
- package/lib/extensions/volumes-and-segmentations/transformers.js +82 -0
- package/lib/extensions/volumes-and-segmentations/ui.d.ts +29 -0
- package/lib/extensions/volumes-and-segmentations/ui.js +229 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/api.js +80 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/data.js +6 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/utils.js +75 -0
- package/lib/mol-canvas3d/canvas3d.d.ts +2 -0
- package/lib/mol-canvas3d/passes/draw.js +3 -3
- package/lib/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/mol-canvas3d/passes/postprocessing.d.ts +2 -1
- package/lib/mol-canvas3d/passes/postprocessing.js +27 -13
- package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
- package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -2
- package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/mol-geo/geometry/spheres/spheres.d.ts +1 -0
- package/lib/mol-geo/geometry/spheres/spheres.js +3 -2
- package/lib/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
- package/lib/mol-gl/compute/marching-cubes/isosurface.js +4 -6
- package/lib/mol-gl/renderable/cylinders.d.ts +1 -0
- package/lib/mol-gl/renderable/cylinders.js +1 -1
- package/lib/mol-gl/renderable/spheres.d.ts +1 -0
- package/lib/mol-gl/renderable/spheres.js +1 -1
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
- package/lib/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
- package/lib/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/mol-gl/shader/cylinders.vert.d.ts +2 -2
- package/lib/mol-gl/shader/cylinders.vert.js +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/mol-gl/shader/outlines.frag.d.ts +1 -1
- package/lib/mol-gl/shader/outlines.frag.js +1 -1
- package/lib/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/mol-gl/shader/spheres.vert.d.ts +2 -2
- package/lib/mol-gl/shader/spheres.vert.js +2 -2
- package/lib/mol-gl/webgl/renderbuffer.d.ts +1 -1
- package/lib/mol-gl/webgl/renderbuffer.js +15 -0
- package/lib/mol-gl/webgl/state.d.ts +12 -0
- package/lib/mol-gl/webgl/state.js +136 -0
- package/lib/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
- package/lib/mol-io/reader/cif/schema/segmentation.js +19 -0
- package/lib/mol-io/reader/cif.d.ts +3 -1
- package/lib/mol-io/reader/cif.js +3 -1
- package/lib/mol-model/location.d.ts +2 -1
- package/lib/mol-model/loci.d.ts +11 -11
- package/lib/mol-model/loci.js +13 -1
- package/lib/mol-model/sequence/alignment/sequence.d.ts +4 -1
- package/lib/mol-model/sequence/alignment/sequence.js +3 -2
- package/lib/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
- package/lib/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
- package/lib/mol-model/structure/structure/util/superposition.d.ts +1 -0
- package/lib/mol-model/structure/structure/util/superposition.js +1 -1
- package/lib/mol-model/volume/volume.d.ts +35 -2
- package/lib/mol-model/volume/volume.js +79 -4
- package/lib/mol-model-formats/volume/segmentation.d.ts +23 -0
- package/lib/mol-model-formats/volume/segmentation.js +135 -0
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/mol-plugin/commands.d.ts +1 -0
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/animation/built-in/model-index.js +4 -1
- package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +6 -1
- package/lib/mol-plugin-state/builder/structure/representation.d.ts +1 -0
- package/lib/mol-plugin-state/formats/provider.d.ts +2 -2
- package/lib/mol-plugin-state/formats/provider.js +11 -3
- package/lib/mol-plugin-state/formats/registry.js +6 -5
- package/lib/mol-plugin-state/formats/volume.d.ts +27 -0
- package/lib/mol-plugin-state/formats/volume.js +64 -0
- package/lib/mol-plugin-state/manager/structure/component.d.ts +1 -1
- package/lib/mol-plugin-state/manager/structure/component.js +18 -13
- package/lib/mol-plugin-state/transforms/representation.d.ts +1 -2
- package/lib/mol-plugin-state/transforms/representation.js +5 -6
- package/lib/mol-plugin-state/transforms/volume.d.ts +11 -1
- package/lib/mol-plugin-state/transforms/volume.js +54 -1
- package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
- package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
- package/lib/mol-plugin-ui/controls/parameters.d.ts +1 -0
- package/lib/mol-plugin-ui/controls/parameters.js +22 -5
- package/lib/mol-plugin-ui/sequence/sequence.d.ts +25 -17
- package/lib/mol-plugin-ui/sequence.d.ts +19 -1
- package/lib/mol-plugin-ui/sequence.js +7 -7
- package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
- package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
- package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
- package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
- package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
- package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
- package/lib/mol-plugin-ui/skin/base/components/misc.scss +643 -643
- package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
- package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
- package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
- package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
- package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
- package/lib/mol-plugin-ui/skin/base/components/viewport.scss +137 -128
- package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
- package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
- package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
- package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
- package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
- package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
- package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/variables.scss +85 -85
- package/lib/mol-plugin-ui/skin/blue.scss +1 -1
- package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
- package/lib/mol-plugin-ui/skin/dark.scss +1 -1
- package/lib/mol-plugin-ui/skin/light.scss +1 -1
- package/lib/mol-plugin-ui/state/apply-action.d.ts +2 -10
- package/lib/mol-plugin-ui/state/apply-action.js +2 -2
- package/lib/mol-plugin-ui/structure/quick-styles.js +2 -2
- package/lib/mol-plugin-ui/structure/superposition.d.ts +1 -1
- package/lib/mol-plugin-ui/structure/volume.d.ts +1 -1
- package/lib/mol-plugin-ui/structure/volume.js +3 -2
- package/lib/mol-repr/structure/complex-visual.d.ts +1 -0
- package/lib/mol-repr/structure/params.d.ts +2 -0
- package/lib/mol-repr/structure/registry.d.ts +12 -0
- package/lib/mol-repr/structure/representation/backbone.d.ts +3 -0
- package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
- package/lib/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
- package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
- package/lib/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
- package/lib/mol-repr/structure/representation/line.d.ts +3 -0
- package/lib/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
- package/lib/mol-repr/structure/representation/point.d.ts +3 -0
- package/lib/mol-repr/structure/representation/spacefill.d.ts +6 -0
- package/lib/mol-repr/structure/units-visual.d.ts +2 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
- package/lib/mol-repr/structure/visual/element-cross.d.ts +1 -0
- package/lib/mol-repr/structure/visual/element-cross.js +2 -1
- package/lib/mol-repr/structure/visual/element-point.d.ts +1 -0
- package/lib/mol-repr/structure/visual/element-point.js +2 -1
- package/lib/mol-repr/structure/visual/element-sphere.d.ts +4 -0
- package/lib/mol-repr/structure/visual/element-sphere.js +3 -1
- package/lib/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
- package/lib/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
- package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
- package/lib/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
- package/lib/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
- package/lib/mol-repr/structure/visual/util/bond.d.ts +7 -0
- package/lib/mol-repr/structure/visual/util/bond.js +19 -8
- package/lib/mol-repr/structure/visual/util/common.d.ts +4 -1
- package/lib/mol-repr/structure/visual/util/common.js +10 -6
- package/lib/mol-repr/structure/visual/util/element.d.ts +1 -0
- package/lib/mol-repr/structure/visual/util/element.js +3 -4
- package/lib/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
- package/lib/mol-repr/volume/direct-volume.d.ts +4 -4
- package/lib/mol-repr/volume/direct-volume.js +8 -6
- package/lib/mol-repr/volume/isosurface.d.ts +4 -4
- package/lib/mol-repr/volume/isosurface.js +17 -16
- package/lib/mol-repr/volume/registry.d.ts +54 -1
- package/lib/mol-repr/volume/registry.js +3 -1
- package/lib/mol-repr/volume/representation.d.ts +11 -7
- package/lib/mol-repr/volume/representation.js +144 -49
- package/lib/mol-repr/volume/segment.d.ts +291 -0
- package/lib/mol-repr/volume/segment.js +279 -0
- package/lib/mol-repr/volume/slice.d.ts +2 -2
- package/lib/mol-repr/volume/slice.js +5 -5
- package/lib/mol-repr/volume/util.d.ts +12 -3
- package/lib/mol-repr/volume/util.js +71 -6
- package/lib/mol-script/language/builder.d.ts +1 -0
- package/lib/mol-theme/color/volume-segment.d.ts +41 -0
- package/lib/mol-theme/color/volume-segment.js +53 -0
- package/lib/mol-theme/color/volume-value.js +2 -1
- package/lib/mol-theme/color.d.ts +15 -0
- package/lib/mol-theme/color.js +2 -0
- package/lib/mol-theme/label.d.ts +1 -1
- package/lib/mol-theme/label.js +13 -1
- package/lib/mol-util/param-definition.d.ts +4 -1
- package/lib/mol-util/param-definition.js +5 -2
- package/package.json +169 -168
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
|
+
*/
|
|
6
|
+
import { Column } from '../../../../mol-data/db';
|
|
7
|
+
import { DensityServer_Data_Schema } from './density-server';
|
|
8
|
+
var Schema = Column.Schema;
|
|
9
|
+
var int = Schema.int;
|
|
10
|
+
export var Segmentation_Data_Schema = {
|
|
11
|
+
volume_data_3d_info: DensityServer_Data_Schema.volume_data_3d_info,
|
|
12
|
+
segmentation_data_table: {
|
|
13
|
+
set_id: int,
|
|
14
|
+
segment_id: int,
|
|
15
|
+
},
|
|
16
|
+
segmentation_data_3d: {
|
|
17
|
+
values: int
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -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 David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -14,6 +14,7 @@ import { BIRD_Database } from './cif/schema/bird';
|
|
|
14
14
|
import { dic_Database } from './cif/schema/dic';
|
|
15
15
|
import { DensityServer_Data_Database } from './cif/schema/density-server';
|
|
16
16
|
import { CifCore_Database } from './cif/schema/cif-core';
|
|
17
|
+
import { Segmentation_Data_Database } from './cif/schema/segmentation';
|
|
17
18
|
export declare const CIF: {
|
|
18
19
|
parse: (data: string | Uint8Array) => import("../../mol-task/task").Task<import("./result").ReaderResult<import("./cif/data-model").CifFile>>;
|
|
19
20
|
parseText: typeof parseCifText;
|
|
@@ -27,6 +28,7 @@ export declare const CIF: {
|
|
|
27
28
|
dic: (frame: CifFrame) => dic_Database;
|
|
28
29
|
cifCore: (frame: CifFrame) => CifCore_Database;
|
|
29
30
|
densityServer: (frame: CifFrame) => DensityServer_Data_Database;
|
|
31
|
+
segmentation: (frame: CifFrame) => Segmentation_Data_Database;
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
34
|
export * from './cif/data-model';
|
package/lib/mol-io/reader/cif.js
CHANGED
|
@@ -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 David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -13,6 +13,7 @@ import { BIRD_Schema } from './cif/schema/bird';
|
|
|
13
13
|
import { dic_Schema } from './cif/schema/dic';
|
|
14
14
|
import { DensityServer_Data_Schema } from './cif/schema/density-server';
|
|
15
15
|
import { CifCore_Schema, CifCore_Aliases } from './cif/schema/cif-core';
|
|
16
|
+
import { Segmentation_Data_Schema } from './cif/schema/segmentation';
|
|
16
17
|
export var CIF = {
|
|
17
18
|
parse: function (data) { return typeof data === 'string' ? parseCifText(data) : parseCifBinary(data); },
|
|
18
19
|
parseText: parseCifText,
|
|
@@ -26,6 +27,7 @@ export var CIF = {
|
|
|
26
27
|
dic: function (frame) { return toDatabase(dic_Schema, frame); },
|
|
27
28
|
cifCore: function (frame) { return toDatabase(CifCore_Schema, frame, CifCore_Aliases); },
|
|
28
29
|
densityServer: function (frame) { return toDatabase(DensityServer_Data_Schema, frame); },
|
|
30
|
+
segmentation: function (frame) { return toDatabase(Segmentation_Data_Schema, frame); },
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
export * from './cif/data-model';
|
|
@@ -7,6 +7,7 @@ import { StructureElement } from './structure';
|
|
|
7
7
|
import { Bond } from './structure/structure/unit/bonds';
|
|
8
8
|
import { ShapeGroup } from './shape/shape';
|
|
9
9
|
import { PositionLocation } from '../mol-geo/util/location-iterator';
|
|
10
|
+
import { Volume } from './volume';
|
|
10
11
|
/** A null value Location */
|
|
11
12
|
export declare const NullLocation: {
|
|
12
13
|
kind: "null-location";
|
|
@@ -22,4 +23,4 @@ export interface DataLocation<T = unknown, E = unknown> {
|
|
|
22
23
|
}
|
|
23
24
|
export declare function DataLocation<T = unknown, E = unknown>(tag: string, data: T, element: E): DataLocation<T, E>;
|
|
24
25
|
export declare function isDataLocation(x: any): x is DataLocation;
|
|
25
|
-
export type Location = StructureElement.Location | Bond.Location | ShapeGroup.Location | PositionLocation | DataLocation | NullLocation;
|
|
26
|
+
export type Location = StructureElement.Location | Bond.Location | ShapeGroup.Location | PositionLocation | DataLocation | NullLocation | Volume.Segment.Location;
|
package/lib/mol-model/loci.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
|
*/
|
|
@@ -39,7 +39,7 @@ export declare function areDataLociEqual(a: DataLoci, b: DataLoci): boolean;
|
|
|
39
39
|
export declare function isDataLociEmpty(loci: DataLoci): boolean;
|
|
40
40
|
export declare function DataLoci<T = unknown, E = unknown>(tag: string, data: T, elements: ReadonlyArray<E>, getBoundingSphere: DataLoci<T, E>['getBoundingSphere'], getLabel: DataLoci<T, E>['getLabel']): DataLoci<T, E>;
|
|
41
41
|
export { Loci };
|
|
42
|
-
type Loci = StructureElement.Loci | Structure.Loci | Bond.Loci | EveryLoci | EmptyLoci | DataLoci | Shape.Loci | ShapeGroup.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci;
|
|
42
|
+
type Loci = StructureElement.Loci | Structure.Loci | Bond.Loci | EveryLoci | EmptyLoci | DataLoci | Shape.Loci | ShapeGroup.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci;
|
|
43
43
|
declare namespace Loci {
|
|
44
44
|
export interface Bundle<L extends number> {
|
|
45
45
|
loci: FiniteArray<Loci, L>;
|
|
@@ -54,47 +54,47 @@ declare namespace Loci {
|
|
|
54
54
|
export function getPrincipalAxes(loci: Loci): PrincipalAxes | undefined;
|
|
55
55
|
const Granularity: {
|
|
56
56
|
element: (loci: Loci) => Loci;
|
|
57
|
-
residue: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
57
|
+
residue: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
58
58
|
kind: "every-loci";
|
|
59
59
|
} | {
|
|
60
60
|
kind: "empty-loci";
|
|
61
61
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
62
|
-
chain: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
62
|
+
chain: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
63
63
|
kind: "every-loci";
|
|
64
64
|
} | {
|
|
65
65
|
kind: "empty-loci";
|
|
66
66
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
67
|
-
entity: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
67
|
+
entity: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
68
68
|
kind: "every-loci";
|
|
69
69
|
} | {
|
|
70
70
|
kind: "empty-loci";
|
|
71
71
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
72
|
-
model: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
72
|
+
model: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
73
73
|
kind: "every-loci";
|
|
74
74
|
} | {
|
|
75
75
|
kind: "empty-loci";
|
|
76
76
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
77
|
-
operator: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
77
|
+
operator: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
78
78
|
kind: "every-loci";
|
|
79
79
|
} | {
|
|
80
80
|
kind: "empty-loci";
|
|
81
81
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
82
|
-
structure: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | {
|
|
82
|
+
structure: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Segment.Loci | {
|
|
83
83
|
kind: "every-loci";
|
|
84
84
|
} | {
|
|
85
85
|
kind: "empty-loci";
|
|
86
86
|
} | DataLoci<unknown, unknown> | Shape.Loci;
|
|
87
|
-
elementInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
87
|
+
elementInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
88
88
|
kind: "every-loci";
|
|
89
89
|
} | {
|
|
90
90
|
kind: "empty-loci";
|
|
91
91
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
92
|
-
residueInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
92
|
+
residueInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
93
93
|
kind: "every-loci";
|
|
94
94
|
} | {
|
|
95
95
|
kind: "empty-loci";
|
|
96
96
|
} | DataLoci<unknown, unknown> | Shape.Loci | ShapeGroup.Loci;
|
|
97
|
-
chainInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | {
|
|
97
|
+
chainInstances: (loci: Loci) => StructureElement.Loci | Structure.Loci | Bond.Loci | Volume.Loci | Volume.Isosurface.Loci | Volume.Cell.Loci | Volume.Segment.Loci | {
|
|
98
98
|
kind: "every-loci";
|
|
99
99
|
} | {
|
|
100
100
|
kind: "empty-loci";
|
package/lib/mol-model/loci.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
|
*/
|
|
@@ -96,6 +96,9 @@ var Loci;
|
|
|
96
96
|
if (Volume.Cell.isLoci(lociA) && Volume.Cell.isLoci(lociB)) {
|
|
97
97
|
return Volume.Cell.areLociEqual(lociA, lociB);
|
|
98
98
|
}
|
|
99
|
+
if (Volume.Segment.isLoci(lociA) && Volume.Segment.isLoci(lociB)) {
|
|
100
|
+
return Volume.Segment.areLociEqual(lociA, lociB);
|
|
101
|
+
}
|
|
99
102
|
return false;
|
|
100
103
|
}
|
|
101
104
|
Loci.areEqual = areEqual;
|
|
@@ -126,6 +129,8 @@ var Loci;
|
|
|
126
129
|
return Volume.Isosurface.isLociEmpty(loci);
|
|
127
130
|
if (Volume.Cell.isLoci(loci))
|
|
128
131
|
return Volume.Cell.isLociEmpty(loci);
|
|
132
|
+
if (Volume.Segment.isLoci(loci))
|
|
133
|
+
return Volume.Segment.isLociEmpty(loci);
|
|
129
134
|
return false;
|
|
130
135
|
}
|
|
131
136
|
Loci.isEmpty = isEmpty;
|
|
@@ -177,6 +182,9 @@ var Loci;
|
|
|
177
182
|
else if (loci.kind === 'cell-loci') {
|
|
178
183
|
return Volume.Cell.getBoundingSphere(loci.volume, loci.indices, boundingSphere);
|
|
179
184
|
}
|
|
185
|
+
else if (loci.kind === 'segment-loci') {
|
|
186
|
+
return Volume.Segment.getBoundingSphere(loci.volume, loci.segments, boundingSphere);
|
|
187
|
+
}
|
|
180
188
|
}
|
|
181
189
|
Loci.getBoundingSphere = getBoundingSphere;
|
|
182
190
|
var tmpSphere3D = Sphere3D.zero();
|
|
@@ -222,6 +230,10 @@ var Loci;
|
|
|
222
230
|
// TODO
|
|
223
231
|
return void 0;
|
|
224
232
|
}
|
|
233
|
+
else if (loci.kind === 'segment-loci') {
|
|
234
|
+
// TODO
|
|
235
|
+
return void 0;
|
|
236
|
+
}
|
|
225
237
|
}
|
|
226
238
|
Loci.getPrincipalAxes = getPrincipalAxes;
|
|
227
239
|
//
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
6
|
-
import { StructureElement } from '../../structure/structure';
|
|
6
|
+
import { StructureElement, Unit } from '../../structure/structure';
|
|
7
7
|
import { AlignmentOptions } from './alignment';
|
|
8
8
|
export { AlignSequences };
|
|
9
9
|
declare namespace AlignSequences {
|
|
@@ -17,5 +17,8 @@ declare namespace AlignSequences {
|
|
|
17
17
|
b: StructureElement.Loci.Element;
|
|
18
18
|
score: number;
|
|
19
19
|
};
|
|
20
|
+
function createSeqIdIndicesMap(element: StructureElement.Loci.Element): Map<number, StructureElement.UnitIndex[]>;
|
|
20
21
|
function compute(input: Input, options?: Partial<AlignmentOptions>): Result;
|
|
21
22
|
}
|
|
23
|
+
export declare function entityKey(unit: Unit): import("../../structure").EntityIndex;
|
|
24
|
+
export declare function getSequence(unit: Unit): import("../sequence").Sequence;
|
|
@@ -37,6 +37,7 @@ var AlignSequences;
|
|
|
37
37
|
}
|
|
38
38
|
return seqIds;
|
|
39
39
|
}
|
|
40
|
+
AlignSequences.createSeqIdIndicesMap = createSeqIdIndicesMap;
|
|
40
41
|
function compute(input, options) {
|
|
41
42
|
if (options === void 0) { options = {}; }
|
|
42
43
|
var seqA = getSequence(input.a.unit);
|
|
@@ -78,7 +79,7 @@ var AlignSequences;
|
|
|
78
79
|
}
|
|
79
80
|
AlignSequences.compute = compute;
|
|
80
81
|
})(AlignSequences || (AlignSequences = {}));
|
|
81
|
-
function entityKey(unit) {
|
|
82
|
+
export function entityKey(unit) {
|
|
82
83
|
switch (unit.kind) {
|
|
83
84
|
case 0 /* Unit.Kind.Atomic */:
|
|
84
85
|
return unit.model.atomicHierarchy.index.getEntityFromChain(unit.chainIndex[unit.elements[0]]);
|
|
@@ -88,6 +89,6 @@ function entityKey(unit) {
|
|
|
88
89
|
return unit.model.coarseHierarchy.gaussians.entityKey[unit.elements[0]];
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
|
-
function getSequence(unit) {
|
|
92
|
+
export function getSequence(unit) {
|
|
92
93
|
return unit.model.sequence.byEntityKey[entityKey(unit)].sequence;
|
|
93
94
|
}
|
|
@@ -147,6 +147,12 @@ export interface AtomicIndex {
|
|
|
147
147
|
*/
|
|
148
148
|
findResidue(key: AtomicIndex.ResidueKey): ResidueIndex;
|
|
149
149
|
findResidue(label_entity_id: string, label_asym_id: string, auth_seq_id: number, pdbx_PDB_ins_code?: string): ResidueIndex;
|
|
150
|
+
/**
|
|
151
|
+
* Index of the 1st occurence of this residue using "all-label" address.
|
|
152
|
+
* Doesn't work for "ligands" as they don't have a label seq id assigned.
|
|
153
|
+
* @returns index or -1 if not present.
|
|
154
|
+
*/
|
|
155
|
+
findResidueLabel(key: AtomicIndex.ResidueLabelKey): ResidueIndex;
|
|
150
156
|
/**
|
|
151
157
|
* Index of the 1st occurence of this residue.
|
|
152
158
|
* @param key.pdbx_PDB_ins_code Empty string for undefined
|
|
@@ -97,6 +97,14 @@ var Index = /** @class */ (function () {
|
|
|
97
97
|
var id = getResidueId(key.auth_seq_id, key.pdbx_PDB_ins_code || '');
|
|
98
98
|
return rm.has(id) ? rm.get(id) : -1;
|
|
99
99
|
};
|
|
100
|
+
Index.prototype.findResidueLabel = function (key) {
|
|
101
|
+
var cI = this.findChainLabel(key);
|
|
102
|
+
if (cI < 0)
|
|
103
|
+
return -1;
|
|
104
|
+
var rm = this.map.chain_index_label_seq_id.get(cI);
|
|
105
|
+
var id = getResidueId(key.label_seq_id, key.pdbx_PDB_ins_code || '');
|
|
106
|
+
return rm.has(id) ? rm.get(id) : -1;
|
|
107
|
+
};
|
|
100
108
|
Index.prototype.findResidueAuth = function (key) {
|
|
101
109
|
var cI = this.findChainAuth(key);
|
|
102
110
|
if (cI < 0)
|
|
@@ -107,8 +107,8 @@ function findPairBonds(unitA, unitB, props, builder) {
|
|
|
107
107
|
var structConnEntries = props.forceCompute ? void 0 : structConn && structConn.byAtomIndex.get(aI);
|
|
108
108
|
if (structConnEntries && structConnEntries.length) {
|
|
109
109
|
var added = false;
|
|
110
|
-
for (var
|
|
111
|
-
var se = structConnEntries_1[
|
|
110
|
+
for (var _g = 0, structConnEntries_1 = structConnEntries; _g < structConnEntries_1.length; _g++) {
|
|
111
|
+
var se = structConnEntries_1[_g];
|
|
112
112
|
var partnerA = se.partnerA, partnerB = se.partnerB;
|
|
113
113
|
var p = partnerA.atomIndex === aI ? partnerB : partnerA;
|
|
114
114
|
var _bI = SortedArray.indexOf(unitB.elements, p.atomIndex);
|
|
@@ -129,7 +129,7 @@ function findPairBonds(unitA, unitB, props, builder) {
|
|
|
129
129
|
continue;
|
|
130
130
|
var occA = occupancyA.value(aI);
|
|
131
131
|
var lookup3d = unitB.lookup3d;
|
|
132
|
-
var
|
|
132
|
+
var _h = lookup3d.find(_imageA[0], _imageA[1], _imageA[2], maxRadius), indices = _h.indices, count = _h.count, squaredDistances = _h.squaredDistances;
|
|
133
133
|
if (count === 0)
|
|
134
134
|
continue;
|
|
135
135
|
var aeI = getElementIdx(type_symbolA.value(aI));
|
|
@@ -200,9 +200,25 @@ function computeInterUnitBonds(structure, props) {
|
|
|
200
200
|
var mtB = b.model.atomicHierarchy.derived.residue.moleculeType;
|
|
201
201
|
var notWater = ((!Unit.isAtomic(a) || mtA[a.residueIndex[a.elements[0]]] !== 2 /* MoleculeType.Water */) &&
|
|
202
202
|
(!Unit.isAtomic(b) || mtB[b.residueIndex[b.elements[0]]] !== 2 /* MoleculeType.Water */));
|
|
203
|
-
var
|
|
204
|
-
|
|
203
|
+
var sameModel = a.model === b.model;
|
|
204
|
+
var notIonA = (!Unit.isAtomic(a) || mtA[a.residueIndex[a.elements[0]]] !== 3 /* MoleculeType.Ion */) || (sameModel && hasStructConnRecord(a));
|
|
205
|
+
var notIonB = (!Unit.isAtomic(b) || mtB[b.residueIndex[b.elements[0]]] !== 3 /* MoleculeType.Ion */) || (sameModel && hasStructConnRecord(b));
|
|
206
|
+
var notIon = notIonA && notIonB;
|
|
205
207
|
return Structure.validUnitPair(s, a, b) && (notWater || !p.ignoreWater) && (notIon || !p.ignoreIon);
|
|
206
208
|
}) }));
|
|
207
209
|
}
|
|
210
|
+
function hasStructConnRecord(unit) {
|
|
211
|
+
if (!Unit.isAtomic(unit))
|
|
212
|
+
return false;
|
|
213
|
+
var elements = unit.elements;
|
|
214
|
+
var structConn = StructConn.Provider.get(unit.model);
|
|
215
|
+
if (structConn) {
|
|
216
|
+
for (var i = 0, _i = elements.length; i < _i; i++) {
|
|
217
|
+
if (structConn.byAtomIndex.get(elements[i])) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
208
224
|
export { computeInterUnitBonds };
|
|
@@ -11,4 +11,5 @@ type AlignAndSuperposeResult = MinimizeRmsd.Result & {
|
|
|
11
11
|
alignmentScore: number;
|
|
12
12
|
};
|
|
13
13
|
export declare function alignAndSuperpose(xs: StructureElement.Loci[]): AlignAndSuperposeResult[];
|
|
14
|
+
export declare function getPositionTable(xs: StructureElement.Loci, n: number): MinimizeRmsd.Positions;
|
|
14
15
|
export {};
|
|
@@ -50,7 +50,7 @@ export function alignAndSuperpose(xs) {
|
|
|
50
50
|
}
|
|
51
51
|
return ret;
|
|
52
52
|
}
|
|
53
|
-
function getPositionTable(xs, n) {
|
|
53
|
+
export function getPositionTable(xs, n) {
|
|
54
54
|
var ret = MinimizeRmsd.Positions.empty(n);
|
|
55
55
|
var o = 0;
|
|
56
56
|
for (var _a = 0, _b = xs.elements; _a < _b.length; _a++) {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
6
6
|
import { Grid } from './grid';
|
|
7
|
-
import { OrderedSet } from '../../mol-data/int';
|
|
8
|
-
import { Sphere3D } from '../../mol-math/geometry';
|
|
7
|
+
import { OrderedSet, SortedArray } from '../../mol-data/int';
|
|
8
|
+
import { Box3D, Sphere3D } from '../../mol-math/geometry';
|
|
9
9
|
import { ModelFormat } from '../../mol-model-formats/format';
|
|
10
10
|
import { CustomProperties } from '../custom-property';
|
|
11
11
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
@@ -137,9 +137,42 @@ export declare namespace Volume {
|
|
|
137
137
|
function isLociEmpty(loci: Loci): boolean;
|
|
138
138
|
function getBoundingSphere(volume: Volume, indices: OrderedSet<CellIndex>, boundingSphere?: Sphere3D): Sphere3D;
|
|
139
139
|
}
|
|
140
|
+
namespace Segment {
|
|
141
|
+
interface Loci {
|
|
142
|
+
readonly kind: 'segment-loci';
|
|
143
|
+
readonly volume: Volume;
|
|
144
|
+
readonly segments: SortedArray;
|
|
145
|
+
}
|
|
146
|
+
function Loci(volume: Volume, segments: ArrayLike<number>): Loci;
|
|
147
|
+
function isLoci(x: any): x is Loci;
|
|
148
|
+
function areLociEqual(a: Loci, b: Loci): boolean;
|
|
149
|
+
function isLociEmpty(loci: Loci): boolean;
|
|
150
|
+
function getBoundingSphere(volume: Volume, segments: ArrayLike<number>, boundingSphere?: Sphere3D): Sphere3D;
|
|
151
|
+
interface Location {
|
|
152
|
+
readonly kind: 'segment-location';
|
|
153
|
+
volume: Volume;
|
|
154
|
+
segment: number;
|
|
155
|
+
}
|
|
156
|
+
function Location(volume?: Volume, segment?: number): Location;
|
|
157
|
+
function isLocation(x: any): x is Location;
|
|
158
|
+
}
|
|
140
159
|
type PickingGranularity = 'volume' | 'object' | 'voxel';
|
|
141
160
|
const PickingGranularity: {
|
|
142
161
|
set(volume: Volume, granularity: PickingGranularity): void;
|
|
143
162
|
get(volume: Volume): PickingGranularity;
|
|
144
163
|
};
|
|
164
|
+
type Segmentation = {
|
|
165
|
+
segments: Map<number, Set<number>>;
|
|
166
|
+
sets: Map<number, Set<number>>;
|
|
167
|
+
bounds: {
|
|
168
|
+
[k: number]: Box3D;
|
|
169
|
+
};
|
|
170
|
+
labels: {
|
|
171
|
+
[k: number]: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
const Segmentation: {
|
|
175
|
+
set(volume: Volume, segmentation: Segmentation): void;
|
|
176
|
+
get(volume: Volume): Segmentation | undefined;
|
|
177
|
+
};
|
|
145
178
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
6
6
|
import { Grid } from './grid';
|
|
7
|
-
import { OrderedSet } from '../../mol-data/int';
|
|
8
|
-
import { Sphere3D } from '../../mol-math/geometry';
|
|
7
|
+
import { OrderedSet, SortedArray } from '../../mol-data/int';
|
|
8
|
+
import { Box3D, Sphere3D } from '../../mol-math/geometry';
|
|
9
9
|
import { Vec3, Mat4 } from '../../mol-math/linear-algebra';
|
|
10
10
|
import { BoundaryHelper } from '../../mol-math/geometry/boundary-helper';
|
|
11
11
|
import { CubeFormat } from '../../mol-model-formats/volume/cube';
|
|
@@ -145,9 +145,38 @@ export var Volume;
|
|
|
145
145
|
Isosurface.areLociEqual = areLociEqual;
|
|
146
146
|
function isLociEmpty(loci) { return loci.volume.grid.cells.data.length === 0; }
|
|
147
147
|
Isosurface.isLociEmpty = isLociEmpty;
|
|
148
|
+
var bbox = Box3D();
|
|
148
149
|
function getBoundingSphere(volume, isoValue, boundingSphere) {
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
var value = Volume.IsoValue.toAbsolute(isoValue, volume.grid.stats).absoluteValue;
|
|
151
|
+
var neg = value < 0;
|
|
152
|
+
var c = [0, 0, 0];
|
|
153
|
+
var getCoords = volume.grid.cells.space.getCoords;
|
|
154
|
+
var d = volume.grid.cells.data;
|
|
155
|
+
var _a = volume.grid.cells.space.dimensions, xn = _a[0], yn = _a[1], zn = _a[2];
|
|
156
|
+
var minx = xn - 1, miny = yn - 1, minz = zn - 1;
|
|
157
|
+
var maxx = 0, maxy = 0, maxz = 0;
|
|
158
|
+
for (var i = 0, il = d.length; i < il; ++i) {
|
|
159
|
+
if ((neg && d[i] <= value) || (!neg && d[i] >= value)) {
|
|
160
|
+
getCoords(i, c);
|
|
161
|
+
if (c[0] < minx)
|
|
162
|
+
minx = c[0];
|
|
163
|
+
if (c[1] < miny)
|
|
164
|
+
miny = c[1];
|
|
165
|
+
if (c[2] < minz)
|
|
166
|
+
minz = c[2];
|
|
167
|
+
if (c[0] > maxx)
|
|
168
|
+
maxx = c[0];
|
|
169
|
+
if (c[1] > maxy)
|
|
170
|
+
maxy = c[1];
|
|
171
|
+
if (c[2] > maxz)
|
|
172
|
+
maxz = c[2];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
Vec3.set(bbox.min, minx - 1, miny - 1, minz - 1);
|
|
176
|
+
Vec3.set(bbox.max, maxx + 1, maxy + 1, maxz + 1);
|
|
177
|
+
var transform = Grid.getGridToCartesianTransform(volume.grid);
|
|
178
|
+
Box3D.transform(bbox, bbox, transform);
|
|
179
|
+
return Sphere3D.fromBox3D(boundingSphere || Sphere3D(), bbox);
|
|
151
180
|
}
|
|
152
181
|
Isosurface.getBoundingSphere = getBoundingSphere;
|
|
153
182
|
})(Isosurface = Volume.Isosurface || (Volume.Isosurface = {}));
|
|
@@ -185,6 +214,44 @@ export var Volume;
|
|
|
185
214
|
}
|
|
186
215
|
Cell.getBoundingSphere = getBoundingSphere;
|
|
187
216
|
})(Cell = Volume.Cell || (Volume.Cell = {}));
|
|
217
|
+
var Segment;
|
|
218
|
+
(function (Segment) {
|
|
219
|
+
function Loci(volume, segments) { return { kind: 'segment-loci', volume: volume, segments: SortedArray.ofUnsortedArray(segments) }; }
|
|
220
|
+
Segment.Loci = Loci;
|
|
221
|
+
function isLoci(x) { return !!x && x.kind === 'segment-loci'; }
|
|
222
|
+
Segment.isLoci = isLoci;
|
|
223
|
+
function areLociEqual(a, b) { return a.volume === b.volume && SortedArray.areEqual(a.segments, b.segments); }
|
|
224
|
+
Segment.areLociEqual = areLociEqual;
|
|
225
|
+
function isLociEmpty(loci) { return loci.volume.grid.cells.data.length === 0 || loci.segments.length === 0; }
|
|
226
|
+
Segment.isLociEmpty = isLociEmpty;
|
|
227
|
+
var bbox = Box3D();
|
|
228
|
+
function getBoundingSphere(volume, segments, boundingSphere) {
|
|
229
|
+
var segmentation = Volume.Segmentation.get(volume);
|
|
230
|
+
if (segmentation) {
|
|
231
|
+
Box3D.setEmpty(bbox);
|
|
232
|
+
for (var i = 0, il = segments.length; i < il; ++i) {
|
|
233
|
+
var b = segmentation.bounds[segments[i]];
|
|
234
|
+
Box3D.add(bbox, b.min);
|
|
235
|
+
Box3D.add(bbox, b.max);
|
|
236
|
+
}
|
|
237
|
+
var transform = Grid.getGridToCartesianTransform(volume.grid);
|
|
238
|
+
Box3D.transform(bbox, bbox, transform);
|
|
239
|
+
return Sphere3D.fromBox3D(boundingSphere || Sphere3D(), bbox);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return Volume.getBoundingSphere(volume, boundingSphere);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
Segment.getBoundingSphere = getBoundingSphere;
|
|
246
|
+
function Location(volume, segment) {
|
|
247
|
+
return { kind: 'segment-location', volume: volume, segment: segment };
|
|
248
|
+
}
|
|
249
|
+
Segment.Location = Location;
|
|
250
|
+
function isLocation(x) {
|
|
251
|
+
return !!x && x.kind === 'segment-location';
|
|
252
|
+
}
|
|
253
|
+
Segment.isLocation = isLocation;
|
|
254
|
+
})(Segment = Volume.Segment || (Volume.Segment = {}));
|
|
188
255
|
Volume.PickingGranularity = {
|
|
189
256
|
set: function (volume, granularity) {
|
|
190
257
|
volume._propertyData['__picking_granularity__'] = granularity;
|
|
@@ -194,4 +261,12 @@ export var Volume;
|
|
|
194
261
|
return (_a = volume._propertyData['__picking_granularity__']) !== null && _a !== void 0 ? _a : 'voxel';
|
|
195
262
|
}
|
|
196
263
|
};
|
|
264
|
+
Volume.Segmentation = {
|
|
265
|
+
set: function (volume, segmentation) {
|
|
266
|
+
volume._propertyData['__segmentation__'] = segmentation;
|
|
267
|
+
},
|
|
268
|
+
get: function (volume) {
|
|
269
|
+
return volume._propertyData['__segmentation__'];
|
|
270
|
+
}
|
|
271
|
+
};
|
|
197
272
|
})(Volume || (Volume = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
*/
|
|
7
|
+
import { Volume } from '../../mol-model/volume';
|
|
8
|
+
import { Task } from '../../mol-task';
|
|
9
|
+
import { ModelFormat } from '../format';
|
|
10
|
+
import { Segmentation_Data_Database } from '../../mol-io/reader/cif/schema/segmentation';
|
|
11
|
+
export declare function volumeFromSegmentationData(source: Segmentation_Data_Database, params?: Partial<{
|
|
12
|
+
label: string;
|
|
13
|
+
segmentLabels: {
|
|
14
|
+
[id: number]: string;
|
|
15
|
+
};
|
|
16
|
+
ownerId: string;
|
|
17
|
+
}>): Task<Volume>;
|
|
18
|
+
export { SegcifFormat };
|
|
19
|
+
type SegcifFormat = ModelFormat<Segmentation_Data_Database>;
|
|
20
|
+
declare namespace SegcifFormat {
|
|
21
|
+
function is(x?: ModelFormat): x is SegcifFormat;
|
|
22
|
+
function create(segcif: Segmentation_Data_Database): SegcifFormat;
|
|
23
|
+
}
|