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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { __awaiter, __generator } from "tslib";
|
|
7
|
+
import { splitEntryId } from './helpers';
|
|
8
|
+
/** Try to get author-defined contour value for isosurface from EMDB API. Return relative value 1.0, if not applicable or fails. */
|
|
9
|
+
export function tryGetIsovalue(entryId) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12
|
+
var split, response, json, contours, theContour, _c;
|
|
13
|
+
return __generator(this, function (_d) {
|
|
14
|
+
switch (_d.label) {
|
|
15
|
+
case 0:
|
|
16
|
+
split = splitEntryId(entryId);
|
|
17
|
+
if (!(split.source === 'emdb')) return [3 /*break*/, 5];
|
|
18
|
+
_d.label = 1;
|
|
19
|
+
case 1:
|
|
20
|
+
_d.trys.push([1, 4, , 5]);
|
|
21
|
+
return [4 /*yield*/, fetch("https://www.ebi.ac.uk/emdb/api/entry/map/".concat(split.entryNumber))];
|
|
22
|
+
case 2:
|
|
23
|
+
response = _d.sent();
|
|
24
|
+
return [4 /*yield*/, response.json()];
|
|
25
|
+
case 3:
|
|
26
|
+
json = _d.sent();
|
|
27
|
+
contours = (_b = (_a = json === null || json === void 0 ? void 0 : json.map) === null || _a === void 0 ? void 0 : _a.contour_list) === null || _b === void 0 ? void 0 : _b.contour;
|
|
28
|
+
if (contours && contours.length > 0) {
|
|
29
|
+
theContour = contours.find(function (c) { return c.primary; }) || contours[0];
|
|
30
|
+
if (theContour.level === undefined)
|
|
31
|
+
throw new Error('EMDB API response missing contour level.');
|
|
32
|
+
return [2 /*return*/, { kind: 'absolute', value: theContour.level }];
|
|
33
|
+
}
|
|
34
|
+
return [3 /*break*/, 5];
|
|
35
|
+
case 4:
|
|
36
|
+
_c = _d.sent();
|
|
37
|
+
return [3 /*break*/, 5];
|
|
38
|
+
case 5: return [2 /*return*/, undefined];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function getPdbIdsForEmdbEntry(entryId) {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var split, result, apiUrl, response, json, jsonEntry, _i, jsonEntry_1, record, pdbs, ex_1;
|
|
47
|
+
return __generator(this, function (_d) {
|
|
48
|
+
switch (_d.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
split = splitEntryId(entryId);
|
|
51
|
+
result = [];
|
|
52
|
+
if (!(split.source === 'emdb')) return [3 /*break*/, 6];
|
|
53
|
+
entryId = entryId.toUpperCase();
|
|
54
|
+
apiUrl = "https://www.ebi.ac.uk/pdbe/api/emdb/entry/fitted/".concat(entryId);
|
|
55
|
+
_d.label = 1;
|
|
56
|
+
case 1:
|
|
57
|
+
_d.trys.push([1, 5, , 6]);
|
|
58
|
+
return [4 /*yield*/, fetch(apiUrl)];
|
|
59
|
+
case 2:
|
|
60
|
+
response = _d.sent();
|
|
61
|
+
if (!response.ok) return [3 /*break*/, 4];
|
|
62
|
+
return [4 /*yield*/, response.json()];
|
|
63
|
+
case 3:
|
|
64
|
+
json = _d.sent();
|
|
65
|
+
jsonEntry = (_a = json[entryId]) !== null && _a !== void 0 ? _a : [];
|
|
66
|
+
for (_i = 0, jsonEntry_1 = jsonEntry; _i < jsonEntry_1.length; _i++) {
|
|
67
|
+
record = jsonEntry_1[_i];
|
|
68
|
+
pdbs = (_c = (_b = record === null || record === void 0 ? void 0 : record.fitted_emdb_id_list) === null || _b === void 0 ? void 0 : _b.pdb_id) !== null && _c !== void 0 ? _c : [];
|
|
69
|
+
result.push.apply(result, pdbs);
|
|
70
|
+
}
|
|
71
|
+
_d.label = 4;
|
|
72
|
+
case 4: return [3 /*break*/, 6];
|
|
73
|
+
case 5:
|
|
74
|
+
ex_1 = _d.sent();
|
|
75
|
+
return [3 /*break*/, 6];
|
|
76
|
+
case 6: return [2 /*return*/, result];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { BehaviorSubject } from 'rxjs';
|
|
7
|
+
import { PluginStateObject } from '../../mol-plugin-state/objects';
|
|
8
|
+
import { PluginBehavior } from '../../mol-plugin/behavior';
|
|
9
|
+
import { PluginContext } from '../../mol-plugin/context';
|
|
10
|
+
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
11
|
+
export declare const VolsegGlobalStateParams: {
|
|
12
|
+
tryUseGpu: PD.BooleanParam;
|
|
13
|
+
selectionMode: PD.BooleanParam;
|
|
14
|
+
};
|
|
15
|
+
export type VolsegGlobalStateParamValues = PD.Values<typeof VolsegGlobalStateParams>;
|
|
16
|
+
declare const VolsegGlobalState_base: {
|
|
17
|
+
new (data: VolsegGlobalStateData, props?: {
|
|
18
|
+
label: string;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
} | undefined): {
|
|
21
|
+
id: import("../../mol-util/uuid").UUID;
|
|
22
|
+
type: PluginStateObject.TypeInfo;
|
|
23
|
+
label: string;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
data: VolsegGlobalStateData;
|
|
26
|
+
};
|
|
27
|
+
type: PluginStateObject.TypeInfo;
|
|
28
|
+
is(obj?: import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>> | undefined): obj is {
|
|
29
|
+
id: import("../../mol-util/uuid").UUID;
|
|
30
|
+
type: PluginStateObject.TypeInfo;
|
|
31
|
+
label: string;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
data: VolsegGlobalStateData;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare class VolsegGlobalState extends VolsegGlobalState_base {
|
|
37
|
+
}
|
|
38
|
+
export declare class VolsegGlobalStateData extends PluginBehavior.WithSubscribers<VolsegGlobalStateParamValues> {
|
|
39
|
+
private ref;
|
|
40
|
+
currentState: BehaviorSubject<PD.Values<{
|
|
41
|
+
tryUseGpu: PD.BooleanParam;
|
|
42
|
+
selectionMode: PD.BooleanParam;
|
|
43
|
+
}>>;
|
|
44
|
+
constructor(plugin: PluginContext, params: VolsegGlobalStateParamValues);
|
|
45
|
+
register(ref: string): void;
|
|
46
|
+
unregister(): void;
|
|
47
|
+
isRegistered(): boolean;
|
|
48
|
+
updateState(plugin: PluginContext, state: Partial<VolsegGlobalStateParamValues>): Promise<void>;
|
|
49
|
+
static getGlobalState(plugin: PluginContext): VolsegGlobalStateParamValues | undefined;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { __awaiter, __extends, __generator } from "tslib";
|
|
7
|
+
import { BehaviorSubject } from 'rxjs';
|
|
8
|
+
import { PluginStateObject } from '../../mol-plugin-state/objects';
|
|
9
|
+
import { PluginBehavior } from '../../mol-plugin/behavior';
|
|
10
|
+
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
11
|
+
import { VolsegEntry } from './entry-root';
|
|
12
|
+
import { isDefined } from './helpers';
|
|
13
|
+
export var VolsegGlobalStateParams = {
|
|
14
|
+
tryUseGpu: PD.Boolean(true, { description: 'Attempt using GPU for faster rendering. \nCaution: with some hardware setups, this might render some objects incorrectly or not at all.' }),
|
|
15
|
+
selectionMode: PD.Boolean(true, { description: 'Allow selecting/deselecting a segment by clicking on it.' }),
|
|
16
|
+
};
|
|
17
|
+
var VolsegGlobalState = /** @class */ (function (_super) {
|
|
18
|
+
__extends(VolsegGlobalState, _super);
|
|
19
|
+
function VolsegGlobalState() {
|
|
20
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
}
|
|
22
|
+
return VolsegGlobalState;
|
|
23
|
+
}(PluginStateObject.CreateBehavior({ name: 'Vol & Seg Global State' })));
|
|
24
|
+
export { VolsegGlobalState };
|
|
25
|
+
var VolsegGlobalStateData = /** @class */ (function (_super) {
|
|
26
|
+
__extends(VolsegGlobalStateData, _super);
|
|
27
|
+
function VolsegGlobalStateData(plugin, params) {
|
|
28
|
+
var _this = _super.call(this, plugin, params) || this;
|
|
29
|
+
_this.currentState = new BehaviorSubject(PD.getDefaultValues(VolsegGlobalStateParams));
|
|
30
|
+
_this.currentState.next(params);
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
VolsegGlobalStateData.prototype.register = function (ref) {
|
|
34
|
+
this.ref = ref;
|
|
35
|
+
};
|
|
36
|
+
VolsegGlobalStateData.prototype.unregister = function () {
|
|
37
|
+
this.ref = '';
|
|
38
|
+
};
|
|
39
|
+
VolsegGlobalStateData.prototype.isRegistered = function () {
|
|
40
|
+
return this.ref !== '';
|
|
41
|
+
};
|
|
42
|
+
VolsegGlobalStateData.prototype.updateState = function (plugin, state) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
+
var oldState, promises, allEntries, _i, allEntries_1, entry, _a, allEntries_2, entry;
|
|
45
|
+
return __generator(this, function (_b) {
|
|
46
|
+
switch (_b.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
oldState = this.currentState.value;
|
|
49
|
+
promises = [];
|
|
50
|
+
allEntries = plugin.state.data.selectQ(function (q) { return q.ofType(VolsegEntry); }).map(function (cell) { var _a; return (_a = cell.obj) === null || _a === void 0 ? void 0 : _a.data; }).filter(isDefined);
|
|
51
|
+
if (state.tryUseGpu !== undefined && state.tryUseGpu !== oldState.tryUseGpu) {
|
|
52
|
+
for (_i = 0, allEntries_1 = allEntries; _i < allEntries_1.length; _i++) {
|
|
53
|
+
entry = allEntries_1[_i];
|
|
54
|
+
promises.push(entry.setTryUseGpu(state.tryUseGpu));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (state.selectionMode !== undefined && state.selectionMode !== oldState.selectionMode) {
|
|
58
|
+
for (_a = 0, allEntries_2 = allEntries; _a < allEntries_2.length; _a++) {
|
|
59
|
+
entry = allEntries_2[_a];
|
|
60
|
+
promises.push(entry.setSelectionMode(state.selectionMode));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
64
|
+
case 1:
|
|
65
|
+
_b.sent();
|
|
66
|
+
return [4 /*yield*/, plugin.build().to(this.ref).update(state).commit()];
|
|
67
|
+
case 2:
|
|
68
|
+
_b.sent();
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
VolsegGlobalStateData.getGlobalState = function (plugin) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
return (_b = (_a = plugin.state.data.selectQ(function (q) { return q.ofType(VolsegGlobalState); })[0]) === null || _a === void 0 ? void 0 : _a.obj) === null || _b === void 0 ? void 0 : _b.data.currentState.value;
|
|
77
|
+
};
|
|
78
|
+
return VolsegGlobalStateData;
|
|
79
|
+
}(PluginBehavior.WithSubscribers));
|
|
80
|
+
export { VolsegGlobalStateData };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { Volume } from '../../mol-model/volume';
|
|
7
|
+
import { PluginStateObject } from '../../mol-plugin-state/objects';
|
|
8
|
+
import { StateBuilder, StateObjectSelector, StateTransformer } from '../../mol-state';
|
|
9
|
+
import { ParamDefinition } from '../../mol-util/param-definition';
|
|
10
|
+
import { Source } from './entry-root';
|
|
11
|
+
/** Split entry ID (e.g. 'emd-1832') into source ('emdb') and number ('1832') */
|
|
12
|
+
export declare function splitEntryId(entryId: string): {
|
|
13
|
+
source: "emdb" | "empiar" | "idr";
|
|
14
|
+
entryNumber: string;
|
|
15
|
+
};
|
|
16
|
+
/** Create entry ID (e.g. 'emd-1832') for a combination of source ('emdb') and number ('1832') */
|
|
17
|
+
export declare function createEntryId(source: Source, entryNumber: string | number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Represents a set of values to choose from, with a default value. Example:
|
|
20
|
+
* ```
|
|
21
|
+
* export const MyChoice = new Choice({ yes: 'I agree', no: 'Nope' }, 'yes');
|
|
22
|
+
* export type MyChoiceType = Choice.Values<typeof MyChoice>; // 'yes'|'no'
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class Choice<T extends string, D extends T> {
|
|
26
|
+
readonly defaultValue: D;
|
|
27
|
+
readonly options: [T, string][];
|
|
28
|
+
private readonly nameDict;
|
|
29
|
+
constructor(opts: {
|
|
30
|
+
[value in T]: string;
|
|
31
|
+
}, defaultValue: D);
|
|
32
|
+
PDSelect(defaultValue?: T, info?: ParamDefinition.Info): ParamDefinition.Select<T>;
|
|
33
|
+
prettyName(value: T): string;
|
|
34
|
+
get values(): T[];
|
|
35
|
+
}
|
|
36
|
+
export declare namespace Choice {
|
|
37
|
+
type Values<T extends Choice<any, any>> = T extends Choice<infer R, any> ? R : any;
|
|
38
|
+
}
|
|
39
|
+
export declare function isDefined<T>(x: T | undefined): x is T;
|
|
40
|
+
export declare class NodeManager {
|
|
41
|
+
private nodes;
|
|
42
|
+
constructor();
|
|
43
|
+
private static nodeExists;
|
|
44
|
+
getNode(key: string): StateObjectSelector | undefined;
|
|
45
|
+
getNodes(): StateObjectSelector[];
|
|
46
|
+
deleteAllNodes(update: StateBuilder.Root): void;
|
|
47
|
+
hideAllNodes(): void;
|
|
48
|
+
showNode(key: string, factory: () => StateObjectSelector | Promise<StateObjectSelector>, forceVisible?: boolean): Promise<StateObjectSelector<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, StateTransformer<import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, import("../../mol-state/object").StateObject<any, import("../../mol-state/object").StateObject.Type<any>>, any>>>;
|
|
49
|
+
}
|
|
50
|
+
export declare const CreateVolume: StateTransformer<PluginStateObject.Root, PluginStateObject.Volume.Data, ParamDefinition.Normalize<{
|
|
51
|
+
label: string;
|
|
52
|
+
description: string;
|
|
53
|
+
volume: Volume;
|
|
54
|
+
}>>;
|
|
55
|
+
export declare function applyEllipsis(name: string, max_chars?: number): string;
|
|
56
|
+
export declare function lazyGetter<T>(getter: () => T, errorIfUndefined?: string): () => T;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { __awaiter, __generator } from "tslib";
|
|
7
|
+
import { PluginStateObject } from '../../mol-plugin-state/objects';
|
|
8
|
+
import { setSubtreeVisibility } from '../../mol-plugin/behavior/static/state';
|
|
9
|
+
import { StateTransformer } from '../../mol-state';
|
|
10
|
+
import { ParamDefinition } from '../../mol-util/param-definition';
|
|
11
|
+
/** Split entry ID (e.g. 'emd-1832') into source ('emdb') and number ('1832') */
|
|
12
|
+
export function splitEntryId(entryId) {
|
|
13
|
+
var _a;
|
|
14
|
+
var PREFIX_TO_SOURCE = { 'emd': 'emdb' };
|
|
15
|
+
var _b = entryId.split('-'), prefix = _b[0], entry = _b[1];
|
|
16
|
+
return {
|
|
17
|
+
source: (_a = PREFIX_TO_SOURCE[prefix]) !== null && _a !== void 0 ? _a : prefix,
|
|
18
|
+
entryNumber: entry
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Create entry ID (e.g. 'emd-1832') for a combination of source ('emdb') and number ('1832') */
|
|
22
|
+
export function createEntryId(source, entryNumber) {
|
|
23
|
+
var _a;
|
|
24
|
+
var SOURCE_TO_PREFIX = { 'emdb': 'emd' };
|
|
25
|
+
var prefix = (_a = SOURCE_TO_PREFIX[source]) !== null && _a !== void 0 ? _a : source;
|
|
26
|
+
return "".concat(prefix, "-").concat(entryNumber);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Represents a set of values to choose from, with a default value. Example:
|
|
30
|
+
* ```
|
|
31
|
+
* export const MyChoice = new Choice({ yes: 'I agree', no: 'Nope' }, 'yes');
|
|
32
|
+
* export type MyChoiceType = Choice.Values<typeof MyChoice>; // 'yes'|'no'
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
var Choice = /** @class */ (function () {
|
|
36
|
+
function Choice(opts, defaultValue) {
|
|
37
|
+
this.defaultValue = defaultValue;
|
|
38
|
+
this.options = Object.keys(opts).map(function (k) { return [k, opts[k]]; });
|
|
39
|
+
this.nameDict = opts;
|
|
40
|
+
}
|
|
41
|
+
Choice.prototype.PDSelect = function (defaultValue, info) {
|
|
42
|
+
return ParamDefinition.Select(defaultValue !== null && defaultValue !== void 0 ? defaultValue : this.defaultValue, this.options, info);
|
|
43
|
+
};
|
|
44
|
+
Choice.prototype.prettyName = function (value) {
|
|
45
|
+
return this.nameDict[value];
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(Choice.prototype, "values", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return this.options.map(function (_a) {
|
|
50
|
+
var value = _a[0], pretty = _a[1];
|
|
51
|
+
return value;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
return Choice;
|
|
58
|
+
}());
|
|
59
|
+
export { Choice };
|
|
60
|
+
export function isDefined(x) {
|
|
61
|
+
return x !== undefined;
|
|
62
|
+
}
|
|
63
|
+
var NodeManager = /** @class */ (function () {
|
|
64
|
+
function NodeManager() {
|
|
65
|
+
this.nodes = {};
|
|
66
|
+
}
|
|
67
|
+
NodeManager.nodeExists = function (node) {
|
|
68
|
+
try {
|
|
69
|
+
return node.checkValid();
|
|
70
|
+
}
|
|
71
|
+
catch (_a) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
NodeManager.prototype.getNode = function (key) {
|
|
76
|
+
var node = this.nodes[key];
|
|
77
|
+
if (node && !NodeManager.nodeExists(node)) {
|
|
78
|
+
delete this.nodes[key];
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
return node;
|
|
82
|
+
};
|
|
83
|
+
NodeManager.prototype.getNodes = function () {
|
|
84
|
+
var _this = this;
|
|
85
|
+
return Object.keys(this.nodes).map(function (key) { return _this.getNode(key); }).filter(function (node) { return node; });
|
|
86
|
+
};
|
|
87
|
+
NodeManager.prototype.deleteAllNodes = function (update) {
|
|
88
|
+
for (var _i = 0, _a = this.getNodes(); _i < _a.length; _i++) {
|
|
89
|
+
var node = _a[_i];
|
|
90
|
+
update.delete(node);
|
|
91
|
+
}
|
|
92
|
+
this.nodes = {};
|
|
93
|
+
};
|
|
94
|
+
NodeManager.prototype.hideAllNodes = function () {
|
|
95
|
+
for (var _i = 0, _a = this.getNodes(); _i < _a.length; _i++) {
|
|
96
|
+
var node = _a[_i];
|
|
97
|
+
setSubtreeVisibility(node.state, node.ref, true); // hide
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
NodeManager.prototype.showNode = function (key, factory, forceVisible) {
|
|
101
|
+
if (forceVisible === void 0) { forceVisible = true; }
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
+
var node;
|
|
104
|
+
return __generator(this, function (_a) {
|
|
105
|
+
switch (_a.label) {
|
|
106
|
+
case 0:
|
|
107
|
+
node = this.getNode(key);
|
|
108
|
+
if (!node) return [3 /*break*/, 1];
|
|
109
|
+
if (forceVisible) {
|
|
110
|
+
setSubtreeVisibility(node.state, node.ref, false); // show
|
|
111
|
+
}
|
|
112
|
+
return [3 /*break*/, 3];
|
|
113
|
+
case 1: return [4 /*yield*/, factory()];
|
|
114
|
+
case 2:
|
|
115
|
+
node = _a.sent();
|
|
116
|
+
this.nodes[key] = node;
|
|
117
|
+
_a.label = 3;
|
|
118
|
+
case 3: return [2 /*return*/, node];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
return NodeManager;
|
|
124
|
+
}());
|
|
125
|
+
export { NodeManager };
|
|
126
|
+
var CreateTransformer = StateTransformer.builderFactory('volseg');
|
|
127
|
+
export var CreateVolume = CreateTransformer({
|
|
128
|
+
name: 'create-transformer',
|
|
129
|
+
from: PluginStateObject.Root,
|
|
130
|
+
to: PluginStateObject.Volume.Data,
|
|
131
|
+
params: {
|
|
132
|
+
label: ParamDefinition.Text('Volume', { isHidden: true }),
|
|
133
|
+
description: ParamDefinition.Text('', { isHidden: true }),
|
|
134
|
+
volume: ParamDefinition.Value(undefined, { isHidden: true }),
|
|
135
|
+
}
|
|
136
|
+
})({
|
|
137
|
+
apply: function (_a) {
|
|
138
|
+
var params = _a.params;
|
|
139
|
+
return new PluginStateObject.Volume.Data(params.volume, { label: params.label, description: params.description });
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
export function applyEllipsis(name, max_chars) {
|
|
143
|
+
if (max_chars === void 0) { max_chars = 60; }
|
|
144
|
+
if (name.length <= max_chars)
|
|
145
|
+
return name;
|
|
146
|
+
var beginning = name.substring(0, max_chars);
|
|
147
|
+
var lastSpace = beginning.lastIndexOf(' ');
|
|
148
|
+
if (lastSpace === -1)
|
|
149
|
+
return beginning + '...';
|
|
150
|
+
if (lastSpace > 0 && ',;.'.includes(name.charAt(lastSpace - 1)))
|
|
151
|
+
lastSpace--;
|
|
152
|
+
return name.substring(0, lastSpace) + '...';
|
|
153
|
+
}
|
|
154
|
+
export function lazyGetter(getter, errorIfUndefined) {
|
|
155
|
+
var value = undefined;
|
|
156
|
+
return function () {
|
|
157
|
+
if (value === undefined)
|
|
158
|
+
value = getter();
|
|
159
|
+
if (errorIfUndefined && value === undefined)
|
|
160
|
+
throw new Error(errorIfUndefined);
|
|
161
|
+
return value;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { PluginStateObject as SO } from '../../mol-plugin-state/objects';
|
|
7
|
+
import { PluginBehavior } from '../../mol-plugin/behavior';
|
|
8
|
+
import { PluginConfigItem } from '../../mol-plugin/config';
|
|
9
|
+
import { StateAction } from '../../mol-state';
|
|
10
|
+
export declare const VolsegVolumeServerConfig: {
|
|
11
|
+
DefaultServer: PluginConfigItem<string>;
|
|
12
|
+
};
|
|
13
|
+
export declare const Volseg: import("../../mol-state/transformer").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, {
|
|
14
|
+
autoAttach: boolean;
|
|
15
|
+
showTooltip: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const LoadVolseg: StateAction<SO.Root, void, import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
18
|
+
serverUrl: string;
|
|
19
|
+
source: import("../../mol-util/param-definition").ParamDefinition.NamedParams<unknown, string>;
|
|
20
|
+
}>>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { __awaiter, __extends, __generator } from "tslib";
|
|
7
|
+
import { PluginStateObject as SO } from '../../mol-plugin-state/objects';
|
|
8
|
+
import { PluginBehavior } from '../../mol-plugin/behavior';
|
|
9
|
+
import { PluginConfigItem } from '../../mol-plugin/config';
|
|
10
|
+
import { StateAction } from '../../mol-state';
|
|
11
|
+
import { Task } from '../../mol-task';
|
|
12
|
+
import { DEFAULT_VOLSEG_SERVER, VolumeApiV2 } from './volseg-api/api';
|
|
13
|
+
import { VolsegEntryData, VolsegEntryParamValues, createLoadVolsegParams } from './entry-root';
|
|
14
|
+
import { VolsegGlobalState } from './global-state';
|
|
15
|
+
import { createEntryId } from './helpers';
|
|
16
|
+
import { VolsegEntryFromRoot, VolsegGlobalStateFromRoot, VolsegStateFromEntry } from './transformers';
|
|
17
|
+
import { VolsegUI } from './ui';
|
|
18
|
+
var DEBUGGING = window.location.hostname === 'localhost';
|
|
19
|
+
export var VolsegVolumeServerConfig = {
|
|
20
|
+
// DefaultServer: new PluginConfigItem('volseg-volume-server', DEFAULT_VOLUME_SERVER_V2),
|
|
21
|
+
DefaultServer: new PluginConfigItem('volseg-volume-server', DEBUGGING ? 'http://localhost:9000/v2' : DEFAULT_VOLSEG_SERVER),
|
|
22
|
+
};
|
|
23
|
+
export var Volseg = PluginBehavior.create({
|
|
24
|
+
name: 'volseg',
|
|
25
|
+
category: 'misc',
|
|
26
|
+
display: {
|
|
27
|
+
name: 'Volseg',
|
|
28
|
+
description: 'Volseg'
|
|
29
|
+
},
|
|
30
|
+
ctor: /** @class */ (function (_super) {
|
|
31
|
+
__extends(class_1, _super);
|
|
32
|
+
function class_1() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
class_1.prototype.register = function () {
|
|
36
|
+
this.ctx.state.data.actions.add(LoadVolseg);
|
|
37
|
+
this.ctx.customStructureControls.set('volseg', VolsegUI);
|
|
38
|
+
this.initializeEntryLists(); // do not await
|
|
39
|
+
var entries = new Map();
|
|
40
|
+
this.subscribeObservable(this.ctx.state.data.events.cell.created, function (o) {
|
|
41
|
+
if (o.cell.obj instanceof VolsegEntryData)
|
|
42
|
+
entries.set(o.ref, o.cell.obj);
|
|
43
|
+
});
|
|
44
|
+
this.subscribeObservable(this.ctx.state.data.events.cell.removed, function (o) {
|
|
45
|
+
if (entries.has(o.ref)) {
|
|
46
|
+
entries.get(o.ref).dispose();
|
|
47
|
+
entries.delete(o.ref);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
class_1.prototype.unregister = function () {
|
|
52
|
+
this.ctx.state.data.actions.remove(LoadVolseg);
|
|
53
|
+
this.ctx.customStructureControls.delete('volseg');
|
|
54
|
+
};
|
|
55
|
+
class_1.prototype.initializeEntryLists = function () {
|
|
56
|
+
var _a;
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
var apiUrl, api, entryLists;
|
|
59
|
+
return __generator(this, function (_b) {
|
|
60
|
+
switch (_b.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
apiUrl = (_a = this.ctx.config.get(VolsegVolumeServerConfig.DefaultServer)) !== null && _a !== void 0 ? _a : DEFAULT_VOLSEG_SERVER;
|
|
63
|
+
api = new VolumeApiV2(apiUrl);
|
|
64
|
+
return [4 /*yield*/, api.getEntryList(Math.pow(10, 6))];
|
|
65
|
+
case 1:
|
|
66
|
+
entryLists = _b.sent();
|
|
67
|
+
Object.values(entryLists).forEach(function (l) { return l.sort(); });
|
|
68
|
+
this.ctx.customState.volsegAvailableEntries = entryLists;
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
return class_1;
|
|
75
|
+
}(PluginBehavior.Handler))
|
|
76
|
+
});
|
|
77
|
+
export var LoadVolseg = StateAction.build({
|
|
78
|
+
display: { name: 'Load Volume & Segmentation' },
|
|
79
|
+
from: SO.Root,
|
|
80
|
+
params: function (a, plugin) {
|
|
81
|
+
var res = createLoadVolsegParams(plugin, plugin.customState.volsegAvailableEntries);
|
|
82
|
+
return res;
|
|
83
|
+
},
|
|
84
|
+
})(function (_a, ctx) {
|
|
85
|
+
var params = _a.params, state = _a.state;
|
|
86
|
+
return Task.create('Loading Volume & Segmentation', function (taskCtx) {
|
|
87
|
+
return state.transaction(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
var entryParams, globalStateNode, entryNode;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
entryParams = VolsegEntryParamValues.fromLoadVolsegParamValues(params);
|
|
93
|
+
if (entryParams.entryId.trim().length === 0) {
|
|
94
|
+
alert('Must specify Entry Id!');
|
|
95
|
+
throw new Error('Specify Entry Id');
|
|
96
|
+
}
|
|
97
|
+
if (!entryParams.entryId.includes('-')) {
|
|
98
|
+
// add source prefix if the user omitted it (e.g. 1832 -> emd-1832)
|
|
99
|
+
entryParams.entryId = createEntryId(entryParams.source, entryParams.entryId);
|
|
100
|
+
}
|
|
101
|
+
ctx.behaviors.layout.leftPanelTabName.next('data');
|
|
102
|
+
globalStateNode = ctx.state.data.selectQ(function (q) { return q.ofType(VolsegGlobalState); })[0];
|
|
103
|
+
if (!!globalStateNode) return [3 /*break*/, 2];
|
|
104
|
+
return [4 /*yield*/, state.build().toRoot().apply(VolsegGlobalStateFromRoot, {}, { state: { isGhost: !DEBUGGING } }).commit()];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
_a.label = 2;
|
|
108
|
+
case 2: return [4 /*yield*/, state.build().toRoot().apply(VolsegEntryFromRoot, entryParams).commit()];
|
|
109
|
+
case 3:
|
|
110
|
+
entryNode = _a.sent();
|
|
111
|
+
return [4 /*yield*/, state.build().to(entryNode).apply(VolsegStateFromEntry, {}, { state: { isGhost: !DEBUGGING } }).commit()];
|
|
112
|
+
case 4:
|
|
113
|
+
_a.sent();
|
|
114
|
+
if (!entryNode.data) return [3 /*break*/, 7];
|
|
115
|
+
return [4 /*yield*/, entryNode.data.loadVolume()];
|
|
116
|
+
case 5:
|
|
117
|
+
_a.sent();
|
|
118
|
+
return [4 /*yield*/, entryNode.data.loadSegmentations()];
|
|
119
|
+
case 6:
|
|
120
|
+
_a.sent();
|
|
121
|
+
_a.label = 7;
|
|
122
|
+
case 7: return [2 /*return*/];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}); }).runInContext(taskCtx);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { PluginStateObject } from '../../mol-plugin-state/objects';
|
|
7
|
+
import { StateTransformer } from '../../mol-state';
|
|
8
|
+
import { VolsegEntry } from './entry-root';
|
|
9
|
+
import { VolsegState } from './entry-state';
|
|
10
|
+
import { VolsegGlobalState } from './global-state';
|
|
11
|
+
export declare const VolsegEntryFromRoot: StateTransformer<PluginStateObject.Root, VolsegEntry, import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
12
|
+
serverUrl: string;
|
|
13
|
+
source: "emdb" | "empiar" | "idr";
|
|
14
|
+
entryId: string;
|
|
15
|
+
}>>;
|
|
16
|
+
export declare const VolsegStateFromEntry: StateTransformer<VolsegEntry, VolsegState, import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
17
|
+
volumeType: "off" | "direct-volume" | "isosurface";
|
|
18
|
+
volumeIsovalueKind: string;
|
|
19
|
+
volumeIsovalueValue: number;
|
|
20
|
+
volumeOpacity: number;
|
|
21
|
+
segmentOpacity: number;
|
|
22
|
+
selectedSegment: number;
|
|
23
|
+
visibleSegments: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
24
|
+
segmentId: any;
|
|
25
|
+
}>[];
|
|
26
|
+
visibleModels: import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
27
|
+
pdbId: any;
|
|
28
|
+
}>[];
|
|
29
|
+
}>>;
|
|
30
|
+
export declare const VolsegGlobalStateFromRoot: StateTransformer<PluginStateObject.Root, VolsegGlobalState, import("../../mol-util/param-definition").ParamDefinition.Normalize<{
|
|
31
|
+
tryUseGpu: boolean;
|
|
32
|
+
selectionMode: boolean;
|
|
33
|
+
}>>;
|