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
|
@@ -110,6 +110,20 @@ export declare const DscifProvider: {
|
|
|
110
110
|
volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
|
|
111
111
|
}) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").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>>[]>;
|
|
112
112
|
};
|
|
113
|
+
export declare const SegcifProvider: {
|
|
114
|
+
label: string;
|
|
115
|
+
description: string;
|
|
116
|
+
category: string;
|
|
117
|
+
stringExtensions: string[];
|
|
118
|
+
binaryExtensions: string[];
|
|
119
|
+
isApplicable: (info: import("../../mol-util/file-info").FileInfo, data: string | Uint8Array) => boolean;
|
|
120
|
+
parse: (plugin: PluginContext, data: import("../../mol-state").StateObjectRef<PluginStateObject.Data.String | PluginStateObject.Data.Binary>) => Promise<{
|
|
121
|
+
volumes: StateObjectSelector<PluginStateObject.Volume.Data, import("../../mol-state/transformer").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>>[];
|
|
122
|
+
}>;
|
|
123
|
+
visuals: (plugin: PluginContext, data: {
|
|
124
|
+
volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
|
|
125
|
+
}) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").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>>[]>;
|
|
126
|
+
};
|
|
113
127
|
export declare const BuiltInVolumeFormats: readonly [readonly ["ccp4", {
|
|
114
128
|
label: string;
|
|
115
129
|
description: string;
|
|
@@ -196,6 +210,19 @@ export declare const BuiltInVolumeFormats: readonly [readonly ["ccp4", {
|
|
|
196
210
|
visuals: (plugin: PluginContext, data: {
|
|
197
211
|
volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
|
|
198
212
|
}) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").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>>[]>;
|
|
213
|
+
}], readonly ["segcif", {
|
|
214
|
+
label: string;
|
|
215
|
+
description: string;
|
|
216
|
+
category: string;
|
|
217
|
+
stringExtensions: string[];
|
|
218
|
+
binaryExtensions: string[];
|
|
219
|
+
isApplicable: (info: import("../../mol-util/file-info").FileInfo, data: string | Uint8Array) => boolean;
|
|
220
|
+
parse: (plugin: PluginContext, data: import("../../mol-state").StateObjectRef<PluginStateObject.Data.String | PluginStateObject.Data.Binary>) => Promise<{
|
|
221
|
+
volumes: StateObjectSelector<PluginStateObject.Volume.Data, import("../../mol-state/transformer").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>>[];
|
|
222
|
+
}>;
|
|
223
|
+
visuals: (plugin: PluginContext, data: {
|
|
224
|
+
volumes: StateObjectSelector<PluginStateObject.Volume.Data>[];
|
|
225
|
+
}) => Promise<StateObjectSelector<PluginStateObject.Volume.Representation3D, import("../../mol-state/transformer").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>>[]>;
|
|
199
226
|
}]];
|
|
200
227
|
export type BuildInVolumeFormat = (typeof BuiltInVolumeFormats)[number][0];
|
|
201
228
|
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @author Aliaksei Chareshneu <chareshneu.tech@gmail.com>
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.BuiltInVolumeFormats = exports.DscifProvider = exports.CubeProvider = exports.DxProvider = exports.Dsn6Provider = exports.Ccp4Provider = exports.VolumeFormatCategory = void 0;
|
|
10
|
+
exports.BuiltInVolumeFormats = exports.SegcifProvider = exports.DscifProvider = exports.CubeProvider = exports.DxProvider = exports.Dsn6Provider = exports.Ccp4Provider = exports.VolumeFormatCategory = void 0;
|
|
11
11
|
var tslib_1 = require("tslib");
|
|
12
12
|
var transforms_1 = require("../transforms");
|
|
13
13
|
var provider_1 = require("./provider");
|
|
@@ -318,10 +318,74 @@ exports.DscifProvider = (0, provider_1.DataFormatProvider)({
|
|
|
318
318
|
});
|
|
319
319
|
}); }
|
|
320
320
|
});
|
|
321
|
+
exports.SegcifProvider = (0, provider_1.DataFormatProvider)({
|
|
322
|
+
label: 'Segmentation CIF',
|
|
323
|
+
description: 'Segmentation CIF',
|
|
324
|
+
category: exports.VolumeFormatCategory,
|
|
325
|
+
stringExtensions: ['cif'],
|
|
326
|
+
binaryExtensions: ['bcif'],
|
|
327
|
+
isApplicable: function (info, data) {
|
|
328
|
+
return (0, provider_1.guessCifVariant)(info, data) === 'segcif' ? true : false;
|
|
329
|
+
},
|
|
330
|
+
parse: function (plugin, data) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
331
|
+
var cifCell, b, blocks, volumes, _i, blocks_2, block;
|
|
332
|
+
var _a;
|
|
333
|
+
return tslib_1.__generator(this, function (_b) {
|
|
334
|
+
switch (_b.label) {
|
|
335
|
+
case 0: return [4 /*yield*/, plugin.build().to(data).apply(transforms_1.StateTransforms.Data.ParseCif).commit()];
|
|
336
|
+
case 1:
|
|
337
|
+
cifCell = _b.sent();
|
|
338
|
+
b = plugin.build().to(cifCell);
|
|
339
|
+
blocks = cifCell.obj.data.blocks;
|
|
340
|
+
if (blocks.length === 0)
|
|
341
|
+
throw new Error('no data blocks');
|
|
342
|
+
volumes = [];
|
|
343
|
+
for (_i = 0, blocks_2 = blocks; _i < blocks_2.length; _i++) {
|
|
344
|
+
block = blocks_2[_i];
|
|
345
|
+
// Skip "server" data block.
|
|
346
|
+
if (block.header.toUpperCase() === 'SERVER')
|
|
347
|
+
continue;
|
|
348
|
+
if (((_a = block.categories['volume_data_3d_info']) === null || _a === void 0 ? void 0 : _a.rowCount) > 0) {
|
|
349
|
+
volumes.push(b.apply(transforms_1.StateTransforms.Volume.VolumeFromSegmentationCif, { blockHeader: block.header }).selector);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return [4 /*yield*/, b.commit()];
|
|
353
|
+
case 2:
|
|
354
|
+
_b.sent();
|
|
355
|
+
return [2 /*return*/, { volumes: volumes }];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}); },
|
|
359
|
+
visuals: function (plugin, data) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
360
|
+
var volumes, tree, visuals, segmentation;
|
|
361
|
+
return tslib_1.__generator(this, function (_a) {
|
|
362
|
+
switch (_a.label) {
|
|
363
|
+
case 0:
|
|
364
|
+
volumes = data.volumes;
|
|
365
|
+
tree = plugin.build();
|
|
366
|
+
visuals = [];
|
|
367
|
+
if (volumes.length > 0) {
|
|
368
|
+
segmentation = volume_1.Volume.Segmentation.get(volumes[0].data);
|
|
369
|
+
if (segmentation) {
|
|
370
|
+
visuals[visuals.length] = tree
|
|
371
|
+
.to(volumes[0])
|
|
372
|
+
.apply(transforms_1.StateTransforms.Representation.VolumeRepresentation3D, representation_1.VolumeRepresentation3DHelpers.getDefaultParams(plugin, 'segment', volumes[0].data, { alpha: 1, instanceGranularity: true }, 'volume-segment', {}))
|
|
373
|
+
.selector;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return [4 /*yield*/, tree.commit()];
|
|
377
|
+
case 1:
|
|
378
|
+
_a.sent();
|
|
379
|
+
return [2 /*return*/, visuals];
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}); }
|
|
383
|
+
});
|
|
321
384
|
exports.BuiltInVolumeFormats = [
|
|
322
385
|
['ccp4', exports.Ccp4Provider],
|
|
323
386
|
['dsn6', exports.Dsn6Provider],
|
|
324
387
|
['cube', exports.CubeProvider],
|
|
325
388
|
['dx', exports.DxProvider],
|
|
326
389
|
['dscif', exports.DscifProvider],
|
|
390
|
+
['segcif', exports.SegcifProvider],
|
|
327
391
|
];
|
|
@@ -58,7 +58,7 @@ declare class StructureComponentManager extends StatefulPluginComponent<Structur
|
|
|
58
58
|
}
|
|
59
59
|
declare namespace StructureComponentManager {
|
|
60
60
|
const OptionsParams: {
|
|
61
|
-
|
|
61
|
+
hydrogens: PD.Select<"all" | "hide-all" | "only-polar">;
|
|
62
62
|
visualQuality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
63
63
|
ignoreLight: PD.BooleanParam;
|
|
64
64
|
materialStyle: PD.Group<PD.Normalize<{
|
|
@@ -77,7 +77,8 @@ var StructureComponentManager = /** @class */ (function (_super) {
|
|
|
77
77
|
case 1:
|
|
78
78
|
_a.sent();
|
|
79
79
|
return [4 /*yield*/, this.plugin.state.updateBehavior(structure_focus_representation_1.StructureFocusRepresentation, function (p) {
|
|
80
|
-
p.ignoreHydrogens =
|
|
80
|
+
p.ignoreHydrogens = options.hydrogens !== 'all';
|
|
81
|
+
p.ignoreHydrogensVariant = options.hydrogens === 'only-polar' ? 'non-polar' : 'all';
|
|
81
82
|
p.ignoreLight = options.ignoreLight;
|
|
82
83
|
p.material = options.materialStyle;
|
|
83
84
|
p.clip = options.clipObjects;
|
|
@@ -97,16 +98,18 @@ var StructureComponentManager = /** @class */ (function (_super) {
|
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
100
|
StructureComponentManager.prototype.updateReprParams = function (update, component) {
|
|
100
|
-
var _a = this.state.options,
|
|
101
|
-
var ignoreHydrogens =
|
|
101
|
+
var _a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
|
|
102
|
+
var ignoreHydrogens = hydrogens !== 'all';
|
|
103
|
+
var ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
|
|
102
104
|
for (var _i = 0, _b = component.representations; _i < _b.length; _i++) {
|
|
103
105
|
var r = _b[_i];
|
|
104
106
|
if (r.cell.transform.transformer !== representation_1.StructureRepresentation3D)
|
|
105
107
|
continue;
|
|
106
108
|
var params = r.cell.transform.params;
|
|
107
|
-
if (!!params.type.params.ignoreHydrogens !== ignoreHydrogens || params.type.params.quality !== quality || params.type.params.ignoreLight !== ignoreLight || !(0, mol_util_1.shallowEqual)(params.type.params.material, material) || !param_definition_1.ParamDefinition.areEqual(clip_1.Clip.Params, params.type.params.clip, clip)) {
|
|
109
|
+
if (!!params.type.params.ignoreHydrogens !== ignoreHydrogens || params.type.params.ignoreHydrogensVariant !== ignoreHydrogensVariant || params.type.params.quality !== quality || params.type.params.ignoreLight !== ignoreLight || !(0, mol_util_1.shallowEqual)(params.type.params.material, material) || !param_definition_1.ParamDefinition.areEqual(clip_1.Clip.Params, params.type.params.clip, clip)) {
|
|
108
110
|
update.to(r.cell).update(function (old) {
|
|
109
111
|
old.type.params.ignoreHydrogens = ignoreHydrogens;
|
|
112
|
+
old.type.params.ignoreHydrogensVariant = ignoreHydrogensVariant;
|
|
110
113
|
old.type.params.quality = quality;
|
|
111
114
|
old.type.params.ignoreLight = ignoreLight;
|
|
112
115
|
old.type.params.material = material;
|
|
@@ -382,9 +385,10 @@ var StructureComponentManager = /** @class */ (function (_super) {
|
|
|
382
385
|
var _this = this;
|
|
383
386
|
if (components.length === 0)
|
|
384
387
|
return;
|
|
385
|
-
var _a = this.state.options,
|
|
386
|
-
var ignoreHydrogens =
|
|
387
|
-
var
|
|
388
|
+
var _a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
|
|
389
|
+
var ignoreHydrogens = hydrogens !== 'all';
|
|
390
|
+
var ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
|
|
391
|
+
var typeParams = { ignoreHydrogens: ignoreHydrogens, ignoreHydrogensVariant: ignoreHydrogensVariant, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
|
|
388
392
|
return this.plugin.dataTransaction(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
389
393
|
var _i, components_9, component;
|
|
390
394
|
return tslib_1.__generator(this, function (_a) {
|
|
@@ -445,16 +449,17 @@ var StructureComponentManager = /** @class */ (function (_super) {
|
|
|
445
449
|
var _this = this;
|
|
446
450
|
return tslib_1.__generator(this, function (_a) {
|
|
447
451
|
return [2 /*return*/, this.plugin.dataTransaction(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
448
|
-
var xs, _a,
|
|
452
|
+
var xs, _a, hydrogens, quality, ignoreLight, material, clip, ignoreHydrogens, ignoreHydrogensVariant, typeParams, componentKey, _i, xs_1, s, component;
|
|
449
453
|
return tslib_1.__generator(this, function (_b) {
|
|
450
454
|
switch (_b.label) {
|
|
451
455
|
case 0:
|
|
452
456
|
xs = structures || this.currentStructures;
|
|
453
457
|
if (xs.length === 0)
|
|
454
458
|
return [2 /*return*/];
|
|
455
|
-
_a = this.state.options,
|
|
456
|
-
ignoreHydrogens =
|
|
457
|
-
|
|
459
|
+
_a = this.state.options, hydrogens = _a.hydrogens, quality = _a.visualQuality, ignoreLight = _a.ignoreLight, material = _a.materialStyle, clip = _a.clipObjects;
|
|
460
|
+
ignoreHydrogens = hydrogens !== 'all';
|
|
461
|
+
ignoreHydrogensVariant = hydrogens === 'only-polar' ? 'non-polar' : 'all';
|
|
462
|
+
typeParams = { ignoreHydrogens: ignoreHydrogens, ignoreHydrogensVariant: ignoreHydrogensVariant, quality: quality, ignoreLight: ignoreLight, material: material, clip: clip };
|
|
458
463
|
componentKey = mol_util_1.UUID.create22();
|
|
459
464
|
_i = 0, xs_1 = xs;
|
|
460
465
|
_b.label = 1;
|
|
@@ -628,9 +633,9 @@ var StructureComponentManager = /** @class */ (function (_super) {
|
|
|
628
633
|
exports.StructureComponentManager = StructureComponentManager;
|
|
629
634
|
(function (StructureComponentManager) {
|
|
630
635
|
StructureComponentManager.OptionsParams = {
|
|
631
|
-
|
|
636
|
+
hydrogens: param_definition_1.ParamDefinition.Select('all', [['all', 'Show All'], ['hide-all', 'Hide All'], ['only-polar', 'Only Polar']], { description: 'Determine display of hydrogen atoms in representations' }),
|
|
632
637
|
visualQuality: param_definition_1.ParamDefinition.Select('auto', base_1.VisualQualityOptions, { description: 'Control the visual/rendering quality of representations' }),
|
|
633
|
-
ignoreLight: param_definition_1.ParamDefinition.Boolean(false, { description: 'Ignore light for stylized rendering of
|
|
638
|
+
ignoreLight: param_definition_1.ParamDefinition.Boolean(false, { description: 'Ignore light for stylized rendering of representations' }),
|
|
634
639
|
materialStyle: material_1.Material.getParam(),
|
|
635
640
|
clipObjects: param_definition_1.ParamDefinition.Group(clip_1.Clip.Params),
|
|
636
641
|
interactions: param_definition_1.ParamDefinition.Group(interactions_1.InteractionsProvider.defaultParams, { label: 'Non-covalent Interactions' }),
|
|
@@ -8,7 +8,6 @@ import { StructureElement } from '../../mol-model/structure';
|
|
|
8
8
|
import { Volume } from '../../mol-model/volume';
|
|
9
9
|
import { PluginContext } from '../../mol-plugin/context';
|
|
10
10
|
import { VolumeRepresentationRegistry } from '../../mol-repr/volume/registry';
|
|
11
|
-
import { VolumeParams } from '../../mol-repr/volume/representation';
|
|
12
11
|
import { StateTransformer } from '../../mol-state';
|
|
13
12
|
import { ColorTheme } from '../../mol-theme/color';
|
|
14
13
|
import { SizeTheme } from '../../mol-theme/size';
|
|
@@ -132,7 +131,7 @@ declare const ThemeStrengthRepresentation3D: StateTransformer<SO.Molecule.Struct
|
|
|
132
131
|
substanceStrength: number;
|
|
133
132
|
}>>;
|
|
134
133
|
export declare namespace VolumeRepresentation3DHelpers {
|
|
135
|
-
function getDefaultParams(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volume: Volume, volumeParams?: Partial<PD.Values<
|
|
134
|
+
function getDefaultParams(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volume: Volume, volumeParams?: Partial<PD.Values<PD.Params>>, colorName?: ColorTheme.BuiltIn, colorParams?: Partial<ColorTheme.Props>, sizeName?: SizeTheme.BuiltIn, sizeParams?: Partial<SizeTheme.Props>): StateTransformer.Params<VolumeRepresentation3D>;
|
|
136
135
|
function getDefaultParamsStatic(ctx: PluginContext, name: VolumeRepresentationRegistry.BuiltIn, volumeParams?: Partial<PD.Values<PD.Params>>, colorName?: ColorTheme.BuiltIn, colorParams?: Partial<ColorTheme.Props>, sizeName?: SizeTheme.BuiltIn, sizeParams?: Partial<SizeTheme.Props>): StateTransformer.Params<VolumeRepresentation3D>;
|
|
137
136
|
function getDescription(props: any): string | undefined;
|
|
138
137
|
}
|
|
@@ -805,16 +805,15 @@ exports.ThemeStrengthRepresentation3D = ThemeStrengthRepresentation3D;
|
|
|
805
805
|
//
|
|
806
806
|
var VolumeRepresentation3DHelpers;
|
|
807
807
|
(function (VolumeRepresentation3DHelpers) {
|
|
808
|
-
function getDefaultParams(ctx, name, volume, volumeParams) {
|
|
808
|
+
function getDefaultParams(ctx, name, volume, volumeParams, colorName, colorParams, sizeName, sizeParams) {
|
|
809
809
|
var type = ctx.representation.volume.registry.get(name);
|
|
810
|
-
var
|
|
811
|
-
var
|
|
812
|
-
var sizeParams = ctx.representation.volume.themes.sizeThemeRegistry.get(type.defaultSizeTheme.name).getParams(themeDataCtx);
|
|
810
|
+
var colorType = ctx.representation.volume.themes.colorThemeRegistry.get(colorName || type.defaultColorTheme.name);
|
|
811
|
+
var sizeType = ctx.representation.volume.themes.sizeThemeRegistry.get(sizeName || type.defaultSizeTheme.name);
|
|
813
812
|
var volumeDefaultParams = param_definition_1.ParamDefinition.getDefaultValues(type.getParams(ctx.representation.volume.themes, volume));
|
|
814
813
|
return ({
|
|
815
814
|
type: { name: name, params: volumeParams ? tslib_1.__assign(tslib_1.__assign({}, volumeDefaultParams), volumeParams) : volumeDefaultParams },
|
|
816
|
-
colorTheme: { name:
|
|
817
|
-
sizeTheme: { name:
|
|
815
|
+
colorTheme: { name: colorType.name, params: colorParams ? tslib_1.__assign(tslib_1.__assign({}, colorType.defaultValues), colorParams) : colorType.defaultValues },
|
|
816
|
+
sizeTheme: { name: sizeType.name, params: sizeParams ? tslib_1.__assign(tslib_1.__assign({}, sizeType.defaultValues), sizeParams) : sizeType.defaultValues }
|
|
818
817
|
});
|
|
819
818
|
}
|
|
820
819
|
VolumeRepresentation3DHelpers.getDefaultParams = getDefaultParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -13,6 +13,7 @@ export { VolumeFromCube };
|
|
|
13
13
|
export { VolumeFromDx };
|
|
14
14
|
export { AssignColorVolume };
|
|
15
15
|
export { VolumeFromDensityServerCif };
|
|
16
|
+
export { VolumeFromSegmentationCif };
|
|
16
17
|
type VolumeFromCcp4 = typeof VolumeFromCcp4;
|
|
17
18
|
declare const VolumeFromCcp4: import("../../mol-state/transformer").StateTransformer<SO.Format.Ccp4, SO.Volume.Data, PD.Normalize<{
|
|
18
19
|
voxelSize: Vec3;
|
|
@@ -36,6 +37,15 @@ declare const VolumeFromDensityServerCif: import("../../mol-state/transformer").
|
|
|
36
37
|
blockHeader: string | undefined;
|
|
37
38
|
entryId: string;
|
|
38
39
|
}>>;
|
|
40
|
+
type VolumeFromSegmentationCif = typeof VolumeFromSegmentationCif;
|
|
41
|
+
declare const VolumeFromSegmentationCif: import("../../mol-state/transformer").StateTransformer<SO.Format.Cif, SO.Volume.Data, PD.Normalize<{
|
|
42
|
+
blockHeader: string | undefined;
|
|
43
|
+
segmentLabels: PD.Normalize<{
|
|
44
|
+
id: any;
|
|
45
|
+
label: any;
|
|
46
|
+
}>[];
|
|
47
|
+
ownerId: string;
|
|
48
|
+
}>>;
|
|
39
49
|
type AssignColorVolume = typeof AssignColorVolume;
|
|
40
50
|
declare const AssignColorVolume: import("../../mol-state/transformer").StateTransformer<SO.Volume.Data, SO.Volume.Data, PD.Normalize<{
|
|
41
51
|
ref: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2018-
|
|
3
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.VolumeFromDensityServerCif = exports.AssignColorVolume = exports.VolumeFromDx = exports.VolumeFromCube = exports.VolumeFromDsn6 = exports.VolumeFromCcp4 = void 0;
|
|
9
|
+
exports.VolumeFromSegmentationCif = exports.VolumeFromDensityServerCif = exports.AssignColorVolume = exports.VolumeFromDx = exports.VolumeFromCube = exports.VolumeFromDsn6 = exports.VolumeFromCcp4 = void 0;
|
|
10
10
|
var tslib_1 = require("tslib");
|
|
11
11
|
var cif_1 = require("../../mol-io/reader/cif");
|
|
12
12
|
var linear_algebra_1 = require("../../mol-math/linear-algebra");
|
|
@@ -19,6 +19,7 @@ var objects_1 = require("../objects");
|
|
|
19
19
|
var cube_1 = require("../../mol-model-formats/volume/cube");
|
|
20
20
|
var dx_1 = require("../../mol-model-formats/volume/dx");
|
|
21
21
|
var mol_state_1 = require("../../mol-state");
|
|
22
|
+
var segmentation_1 = require("../../mol-model-formats/volume/segmentation");
|
|
22
23
|
var VolumeFromCcp4 = objects_1.PluginStateTransform.BuiltIn({
|
|
23
24
|
name: 'volume-from-ccp4',
|
|
24
25
|
display: { name: 'Volume from CCP4/MRC/MAP', description: 'Create Volume from CCP4/MRC/MAP data' },
|
|
@@ -201,6 +202,58 @@ var VolumeFromDensityServerCif = objects_1.PluginStateTransform.BuiltIn({
|
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
exports.VolumeFromDensityServerCif = VolumeFromDensityServerCif;
|
|
205
|
+
var VolumeFromSegmentationCif = objects_1.PluginStateTransform.BuiltIn({
|
|
206
|
+
name: 'volume-from-segmentation-cif',
|
|
207
|
+
display: { name: 'Volume from Segmentation CIF' },
|
|
208
|
+
from: objects_1.PluginStateObject.Format.Cif,
|
|
209
|
+
to: objects_1.PluginStateObject.Volume.Data,
|
|
210
|
+
params: function (a) {
|
|
211
|
+
var blocks = a === null || a === void 0 ? void 0 : a.data.blocks.slice(1);
|
|
212
|
+
var blockHeaderParam = blocks ?
|
|
213
|
+
param_definition_1.ParamDefinition.Optional(param_definition_1.ParamDefinition.Select(blocks[0] && blocks[0].header, blocks.map(function (b) { return [b.header, b.header]; }), { description: 'Header of the block to parse' }))
|
|
214
|
+
: param_definition_1.ParamDefinition.Optional(param_definition_1.ParamDefinition.Text(void 0, { description: 'Header of the block to parse. If none is specifed, the 1st data block in the file is used.' }));
|
|
215
|
+
return {
|
|
216
|
+
blockHeader: blockHeaderParam,
|
|
217
|
+
segmentLabels: param_definition_1.ParamDefinition.ObjectList({ id: param_definition_1.ParamDefinition.Numeric(-1), label: param_definition_1.ParamDefinition.Text('') }, function (s) { return "".concat(s.id, " = ").concat(s.label); }, { description: 'Mapping of segment IDs to segment labels' }),
|
|
218
|
+
ownerId: param_definition_1.ParamDefinition.Text('', { isHidden: true, description: 'Reference to the object which manages this volume' }),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
})({
|
|
222
|
+
isApplicable: function (a) { return a.data.blocks.length > 0; },
|
|
223
|
+
apply: function (_a) {
|
|
224
|
+
var _this = this;
|
|
225
|
+
var a = _a.a, params = _a.params;
|
|
226
|
+
return mol_task_1.Task.create('Parse segmentation CIF', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
227
|
+
var header, block, segmentationCif, segmentLabels, _i, _a, segment, volume, _b, x, y, z, props;
|
|
228
|
+
return tslib_1.__generator(this, function (_c) {
|
|
229
|
+
switch (_c.label) {
|
|
230
|
+
case 0:
|
|
231
|
+
header = params.blockHeader || a.data.blocks[1].header;
|
|
232
|
+
block = a.data.blocks.find(function (b) { return b.header === header; });
|
|
233
|
+
if (!block)
|
|
234
|
+
throw new Error("Data block '".concat([header], "' not found."));
|
|
235
|
+
segmentationCif = cif_1.CIF.schema.segmentation(block);
|
|
236
|
+
segmentLabels = {};
|
|
237
|
+
for (_i = 0, _a = params.segmentLabels; _i < _a.length; _i++) {
|
|
238
|
+
segment = _a[_i];
|
|
239
|
+
segmentLabels[segment.id] = segment.label;
|
|
240
|
+
}
|
|
241
|
+
return [4 /*yield*/, (0, segmentation_1.volumeFromSegmentationData)(segmentationCif, { segmentLabels: segmentLabels, ownerId: params.ownerId }).runInContext(ctx)];
|
|
242
|
+
case 1:
|
|
243
|
+
volume = _c.sent();
|
|
244
|
+
_b = volume.grid.cells.space.dimensions, x = _b[0], y = _b[1], z = _b[2];
|
|
245
|
+
props = { label: segmentationCif.volume_data_3d_info.name.value(0), description: "Segmentation ".concat(x, "\u00D7").concat(y, "\u00D7").concat(z) };
|
|
246
|
+
return [2 /*return*/, new objects_1.PluginStateObject.Volume.Data(volume, props)];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}); });
|
|
250
|
+
},
|
|
251
|
+
dispose: function (_a) {
|
|
252
|
+
var b = _a.b;
|
|
253
|
+
b === null || b === void 0 ? void 0 : b.data.customProperties.dispose();
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
exports.VolumeFromSegmentationCif = VolumeFromSegmentationCif;
|
|
204
257
|
var AssignColorVolume = objects_1.PluginStateTransform.BuiltIn({
|
|
205
258
|
name: 'assign-color-volume',
|
|
206
259
|
display: { name: 'Assign Color Volume', description: 'Assigns another volume to be available for coloring.' },
|
|
@@ -4,13 +4,16 @@ exports.LineGraphComponent = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
/**
|
|
7
|
-
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
7
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
8
8
|
*
|
|
9
9
|
* @author Paul Luna <paulluna0215@gmail.com>
|
|
10
|
+
* @author David Sehnal <david.sehnal@gmail.com>
|
|
10
11
|
*/
|
|
11
12
|
var point_component_1 = require("./point-component");
|
|
12
13
|
var React = tslib_1.__importStar(require("react"));
|
|
13
14
|
var linear_algebra_1 = require("../../../mol-math/linear-algebra");
|
|
15
|
+
var volume_1 = require("../../../mol-model/volume");
|
|
16
|
+
var array_1 = require("../../../mol-util/array");
|
|
14
17
|
var LineGraphComponent = /** @class */ (function (_super) {
|
|
15
18
|
tslib_1.__extends(LineGraphComponent, _super);
|
|
16
19
|
function LineGraphComponent(props) {
|
|
@@ -109,8 +112,9 @@ var LineGraphComponent = /** @class */ (function (_super) {
|
|
|
109
112
|
LineGraphComponent.prototype.render = function () {
|
|
110
113
|
var points = this.renderPoints();
|
|
111
114
|
var lines = this.renderLines();
|
|
115
|
+
var histogram = this.renderHistogram();
|
|
112
116
|
return ([
|
|
113
|
-
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("svg", tslib_1.__assign({ className: "msp-canvas", ref: this.refCallBack, viewBox: "0 0 ".concat(this.width + this.padding, " ").concat(this.height + this.padding), onMouseMove: this.handleDrag, onMouseUp: this.handlePointUpdate, onMouseLeave: this.handleLeave, onMouseEnter: this.handleEnter, tabIndex: 0, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onDoubleClick: this.handleDoubleClick }, { children: [(0, jsx_runtime_1.jsxs)("g", tslib_1.__assign({ stroke: "black", fill: "black" }, { children: [lines, points] })), (0, jsx_runtime_1.jsx)("g", { className: "ghost-points", stroke: "black", fill: "black" })] })) }, "LineGraph"),
|
|
117
|
+
(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("svg", tslib_1.__assign({ className: "msp-canvas", ref: this.refCallBack, viewBox: "0 0 ".concat(this.width + this.padding, " ").concat(this.height + this.padding), onMouseMove: this.handleDrag, onMouseUp: this.handlePointUpdate, onMouseLeave: this.handleLeave, onMouseEnter: this.handleEnter, tabIndex: 0, onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onDoubleClick: this.handleDoubleClick }, { children: [(0, jsx_runtime_1.jsxs)("g", tslib_1.__assign({ stroke: "black", fill: "black" }, { children: [histogram, lines, points] })), (0, jsx_runtime_1.jsx)("g", { className: "ghost-points", stroke: "black", fill: "black" })] })) }, "LineGraph"),
|
|
114
118
|
(0, jsx_runtime_1.jsx)("div", { id: "modal-root" }, "modal")
|
|
115
119
|
]);
|
|
116
120
|
};
|
|
@@ -241,11 +245,11 @@ var LineGraphComponent = /** @class */ (function (_super) {
|
|
|
241
245
|
document.removeEventListener('mouseup', this.handlePointUpdate, true);
|
|
242
246
|
};
|
|
243
247
|
LineGraphComponent.prototype.normalizePoint = function (point) {
|
|
244
|
-
var
|
|
245
|
-
var maxX = this.width +
|
|
246
|
-
var maxY = this.height +
|
|
247
|
-
var normalizedX = (point[0] * (maxX -
|
|
248
|
-
var normalizedY = (point[1] * (maxY -
|
|
248
|
+
var offset = this.padding / 2;
|
|
249
|
+
var maxX = this.width + offset;
|
|
250
|
+
var maxY = this.height + offset;
|
|
251
|
+
var normalizedX = (point[0] * (maxX - offset)) + offset;
|
|
252
|
+
var normalizedY = (point[1] * (maxY - offset)) + offset;
|
|
249
253
|
var reverseY = (this.height + this.padding) - normalizedY;
|
|
250
254
|
var newPoint = linear_algebra_1.Vec2.create(normalizedX, reverseY);
|
|
251
255
|
return newPoint;
|
|
@@ -264,6 +268,23 @@ var LineGraphComponent = /** @class */ (function (_super) {
|
|
|
264
268
|
this.myRef = element;
|
|
265
269
|
}
|
|
266
270
|
};
|
|
271
|
+
LineGraphComponent.prototype.renderHistogram = function () {
|
|
272
|
+
if (!this.props.volume)
|
|
273
|
+
return null;
|
|
274
|
+
var histogram = volume_1.Grid.getHistogram(this.props.volume.grid, 40);
|
|
275
|
+
var bars = [];
|
|
276
|
+
var N = histogram.counts.length;
|
|
277
|
+
var w = this.width / N;
|
|
278
|
+
var offset = this.padding / 2;
|
|
279
|
+
var max = (0, array_1.arrayMax)(histogram.counts) || 1;
|
|
280
|
+
for (var i = 0; i < N; i++) {
|
|
281
|
+
var x = this.width * i / (N - 1) + offset;
|
|
282
|
+
var y1 = this.height + offset;
|
|
283
|
+
var y2 = this.height * (1 - histogram.counts[i] / max) + offset;
|
|
284
|
+
bars.push((0, jsx_runtime_1.jsx)("line", { x1: x, x2: x, y1: y1, y2: y2, stroke: "#ded9ca", strokeWidth: w }, "histogram".concat(i)));
|
|
285
|
+
}
|
|
286
|
+
return bars;
|
|
287
|
+
};
|
|
267
288
|
LineGraphComponent.prototype.renderPoints = function () {
|
|
268
289
|
var points = [];
|
|
269
290
|
var point;
|
|
@@ -278,19 +299,18 @@ var LineGraphComponent = /** @class */ (function (_super) {
|
|
|
278
299
|
LineGraphComponent.prototype.renderLines = function () {
|
|
279
300
|
var points = [];
|
|
280
301
|
var lines = [];
|
|
281
|
-
var min;
|
|
282
302
|
var maxX;
|
|
283
303
|
var maxY;
|
|
284
304
|
var normalizedX;
|
|
285
305
|
var normalizedY;
|
|
286
306
|
var reverseY;
|
|
307
|
+
var o = this.padding / 2;
|
|
287
308
|
for (var _i = 0, _a = this.state.points; _i < _a.length; _i++) {
|
|
288
309
|
var point = _a[_i];
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
normalizedY = (point[1] * (maxY - min)) + min;
|
|
310
|
+
maxX = this.width + o;
|
|
311
|
+
maxY = this.height + this.padding;
|
|
312
|
+
normalizedX = (point[0] * (maxX - o)) + o;
|
|
313
|
+
normalizedY = (point[1] * (maxY - o)) + o;
|
|
294
314
|
reverseY = this.height + this.padding - normalizedY;
|
|
295
315
|
points.push(linear_algebra_1.Vec2.create(normalizedX, reverseY));
|
|
296
316
|
}
|
|
@@ -94,6 +94,7 @@ export declare class LineGraphControl extends React.PureComponent<ParamProps<PD.
|
|
|
94
94
|
isOverPoint: boolean;
|
|
95
95
|
message: string;
|
|
96
96
|
};
|
|
97
|
+
private pointToLabel;
|
|
97
98
|
onHover: (point?: Vec2) => void;
|
|
98
99
|
onDrag: (point: Vec2) => void;
|
|
99
100
|
onChange: (value: PD.LineGraph['defaultValue']) => void;
|
|
@@ -280,13 +280,14 @@ var LineGraphControl = /** @class */ (function (_super) {
|
|
|
280
280
|
_this.onHover = function (point) {
|
|
281
281
|
_this.setState({ isOverPoint: !_this.state.isOverPoint });
|
|
282
282
|
if (point) {
|
|
283
|
-
_this.setState({ message:
|
|
284
|
-
|
|
283
|
+
_this.setState({ message: _this.pointToLabel(point) });
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
_this.setState({ message: "".concat(_this.props.value.length, " points") });
|
|
285
287
|
}
|
|
286
|
-
_this.setState({ message: "".concat(_this.props.value.length, " points") });
|
|
287
288
|
};
|
|
288
289
|
_this.onDrag = function (point) {
|
|
289
|
-
_this.setState({ message:
|
|
290
|
+
_this.setState({ message: _this.pointToLabel(point) });
|
|
290
291
|
};
|
|
291
292
|
_this.onChange = function (value) {
|
|
292
293
|
_this.props.onChange({ name: _this.props.name, param: _this.props.param, value: value });
|
|
@@ -297,9 +298,25 @@ var LineGraphControl = /** @class */ (function (_super) {
|
|
|
297
298
|
};
|
|
298
299
|
return _this;
|
|
299
300
|
}
|
|
301
|
+
LineGraphControl.prototype.pointToLabel = function (point) {
|
|
302
|
+
var _a, _b;
|
|
303
|
+
if (!point)
|
|
304
|
+
return '';
|
|
305
|
+
var volume = (_b = (_a = this.props.param).getVolume) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
306
|
+
if (volume) {
|
|
307
|
+
var _c = volume.grid.stats, min = _c.min, max = _c.max, mean = _c.mean, sigma = _c.sigma;
|
|
308
|
+
var v = min + (max - min) * point[0];
|
|
309
|
+
var s = (v - mean) / sigma;
|
|
310
|
+
return "(".concat(v.toFixed(2), " | ").concat(s.toFixed(2), "\u03C3, ").concat(point[1].toFixed(2), ")");
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
return "(".concat(point[0].toFixed(2), ", ").concat(point[1].toFixed(2), ")");
|
|
314
|
+
}
|
|
315
|
+
};
|
|
300
316
|
LineGraphControl.prototype.render = function () {
|
|
317
|
+
var _a, _b;
|
|
301
318
|
var label = this.props.param.label || (0, string_1.camelCaseToWords)(this.props.name);
|
|
302
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.ControlRow, { label: label, control: (0, jsx_runtime_1.jsx)("button", tslib_1.__assign({ onClick: this.toggleExpanded, disabled: this.props.isDisabled }, { children: "".concat(this.state.message) })) }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { display: this.state.isExpanded ? 'block' : 'none' } }, { children: (0, jsx_runtime_1.jsx)(line_graph_component_1.LineGraphComponent, { data: this.props.param.
|
|
319
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.ControlRow, { label: label, control: (0, jsx_runtime_1.jsx)("button", tslib_1.__assign({ onClick: this.toggleExpanded, disabled: this.props.isDisabled }, { children: "".concat(this.state.message) })) }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { display: this.state.isExpanded ? 'block' : 'none', marginTop: 1 } }, { children: (0, jsx_runtime_1.jsx)(line_graph_component_1.LineGraphComponent, { data: this.props.value, volume: (_b = (_a = this.props.param).getVolume) === null || _b === void 0 ? void 0 : _b.call(_a), onChange: this.onChange, onHover: this.onHover, onDrag: this.onDrag }) }))] });
|
|
303
320
|
};
|
|
304
321
|
return LineGraphControl;
|
|
305
322
|
}(React.PureComponent));
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
*/
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
|
+
import { StructureElement, Unit } from '../../mol-model/structure';
|
|
10
|
+
import { Representation } from '../../mol-repr/representation';
|
|
9
11
|
import { ButtonsType, ModifiersKeys } from '../../mol-util/input/input-observer';
|
|
12
|
+
import { MarkerAction } from '../../mol-util/marker-action';
|
|
10
13
|
import { PluginUIComponent } from '../base';
|
|
11
14
|
import { SequenceWrapper } from './wrapper';
|
|
12
15
|
type SequenceProps = {
|
|
@@ -15,12 +18,17 @@ type SequenceProps = {
|
|
|
15
18
|
hideSequenceNumbers?: boolean;
|
|
16
19
|
};
|
|
17
20
|
export declare class Sequence<P extends SequenceProps> extends PluginUIComponent<P> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
protected parentDiv: React.RefObject<HTMLDivElement>;
|
|
22
|
+
protected lastMouseOverSeqIdx: number;
|
|
23
|
+
protected highlightQueue: Subject<{
|
|
24
|
+
seqIdx: number;
|
|
25
|
+
buttons: number;
|
|
26
|
+
button: number;
|
|
27
|
+
modifiers: ModifiersKeys;
|
|
28
|
+
}>;
|
|
29
|
+
protected lociHighlightProvider: (loci: Representation.Loci, action: MarkerAction) => void;
|
|
30
|
+
protected lociSelectionProvider: (loci: Representation.Loci, action: MarkerAction) => void;
|
|
31
|
+
protected get sequenceNumberPeriod(): number;
|
|
24
32
|
componentDidMount(): void;
|
|
25
33
|
componentWillUnmount(): void;
|
|
26
34
|
getLoci(seqIdx: number | undefined): StructureElement.Loci | undefined;
|
|
@@ -28,18 +36,18 @@ export declare class Sequence<P extends SequenceProps> extends PluginUIComponent
|
|
|
28
36
|
hover(loci: StructureElement.Loci | undefined, buttons: ButtonsType, button: ButtonsType.Flag, modifiers: ModifiersKeys): void;
|
|
29
37
|
click(loci: StructureElement.Loci | undefined, buttons: ButtonsType, button: ButtonsType.Flag, modifiers: ModifiersKeys): void;
|
|
30
38
|
contextMenu: (e: React.MouseEvent) => void;
|
|
31
|
-
|
|
39
|
+
protected mouseDownLoci: StructureElement.Loci | undefined;
|
|
32
40
|
mouseDown: (e: React.MouseEvent) => void;
|
|
33
41
|
mouseUp: (e: React.MouseEvent) => void;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
protected getBackgroundColor(marker: number): "" | "rgb(51, 255, 25)" | "rgb(255, 102, 153)";
|
|
43
|
+
protected getResidueClass(seqIdx: number, label: string): string;
|
|
44
|
+
protected residue(seqIdx: number, label: string, marker: number): JSX.Element;
|
|
45
|
+
protected getSequenceNumberClass(seqIdx: number, seqNum: string, label: string): string;
|
|
46
|
+
protected location: StructureElement.Location<Unit>;
|
|
47
|
+
protected getSequenceNumber(seqIdx: number): string;
|
|
48
|
+
protected padSeqNum(n: string): string;
|
|
49
|
+
protected getSequenceNumberSpan(seqIdx: number, label: string): JSX.Element;
|
|
50
|
+
protected updateMarker(): void;
|
|
43
51
|
mouseMove: (e: React.MouseEvent) => void;
|
|
44
52
|
mouseLeave: (e: React.MouseEvent) => void;
|
|
45
53
|
render(): JSX.Element;
|