molstar 3.0.0 → 3.2.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 +194 -194
- package/build/viewer/embedded.html +43 -43
- package/build/viewer/index.html +106 -106
- 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/viewer/app.d.ts +1 -0
- package/lib/apps/viewer/app.js +6 -3
- package/lib/apps/viewer/embedded.html +43 -43
- package/lib/apps/viewer/index.html +106 -106
- package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/commonjs/apps/viewer/app.d.ts +1 -0
- package/lib/commonjs/apps/viewer/app.js +8 -5
- package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +11 -11
- package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +2 -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-gl/renderer.d.ts +2 -2
- package/lib/commonjs/mol-gl/renderer.js +3 -3
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/mesh.frag.js +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +2 -2
- package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +24 -2
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +23 -1
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/commonjs/mol-model/structure/export/categories/atom_site.js +68 -1
- package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +8 -8
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/commonjs/mol-model/structure/structure/util/superposition-sifts-mapping.d.ts +21 -0
- package/lib/commonjs/mol-model/structure/structure/util/{superposition-db-mapping.js → superposition-sifts-mapping.js} +40 -20
- package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
- package/lib/commonjs/mol-model/volume/volume.js +18 -0
- package/lib/commonjs/mol-model-formats/structure/basic/schema.d.ts +5 -0
- package/lib/commonjs/mol-model-formats/structure/common/property.d.ts +5 -2
- package/lib/commonjs/mol-model-formats/structure/common/property.js +20 -8
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +1 -0
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +2 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +14 -4
- package/lib/commonjs/mol-model-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +7 -5
- package/lib/commonjs/mol-model-props/sequence/{best-database-mapping.js → sifts-mapping.js} +29 -26
- package/lib/{mol-model-props/sequence/themes/best-database-mapping.d.ts → commonjs/mol-model-props/sequence/themes/sifts-mapping.d.ts} +5 -5
- package/lib/commonjs/mol-model-props/sequence/themes/{best-database-mapping.js → sifts-mapping.js} +22 -22
- package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.js → sifts-mapping.js} +11 -11
- package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props.d.ts +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/custom-props.js +2 -2
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
- package/lib/commonjs/mol-plugin-state/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 +155 -125
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +5 -31
- package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +2 -1
- package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
- package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +2 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js +11 -8
- package/lib/commonjs/mol-plugin-ui/controls/icons.d.ts +2 -1
- package/lib/commonjs/mol-plugin-ui/controls/icons.js +8 -5
- package/lib/commonjs/mol-plugin-ui/controls.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/controls.js +2 -1
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.d.ts +25 -0
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +131 -0
- package/lib/commonjs/mol-plugin-ui/structure/superposition.d.ts +4 -1
- package/lib/commonjs/mol-plugin-ui/structure/superposition.js +66 -30
- package/lib/commonjs/mol-plugin-ui/structure/volume.js +4 -4
- package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
- package/lib/commonjs/mol-repr/structure/registry.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +4 -4
- package/lib/commonjs/mol-repr/structure/representation/cartoon.js +3 -3
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
- package/lib/commonjs/mol-state/transform.js +12 -2
- package/lib/commonjs/mol-theme/color/element-symbol.d.ts +46 -2
- package/lib/commonjs/mol-theme/color/element-symbol.js +15 -10
- package/lib/commonjs/mol-theme/color/entity-id.js +14 -11
- package/lib/commonjs/mol-theme/color/illustrative.d.ts +32 -32
- package/lib/commonjs/mol-theme/color.d.ts +39 -17
- package/lib/commonjs/servers/volume/config.js +3 -3
- package/lib/commonjs/servers/volume/query.js +1 -1
- package/lib/examples/alpha-orbitals/index.html +61 -61
- package/lib/examples/basic-wrapper/index.html +137 -137
- package/lib/examples/lighting/index.html +88 -88
- package/lib/examples/proteopedia-wrapper/index.html +236 -236
- package/lib/extensions/anvil/behavior.d.ts +1 -0
- package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/extensions/rcsb/graphql/types.d.ts +11 -11
- package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
- package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
- package/lib/mol-canvas3d/passes/draw.js +3 -3
- package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +2 -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-gl/renderer.d.ts +2 -2
- package/lib/mol-gl/renderer.js +3 -3
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -2
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +2 -2
- package/lib/mol-gl/shader/cylinders.frag.d.ts +2 -2
- package/lib/mol-gl/shader/cylinders.frag.js +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.js +2 -2
- package/lib/mol-gl/shader/mesh.frag.d.ts +2 -2
- package/lib/mol-gl/shader/mesh.frag.js +2 -2
- package/lib/mol-gl/shader/spheres.frag.d.ts +2 -2
- package/lib/mol-gl/shader/spheres.frag.js +2 -2
- package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/mol-io/reader/cif/schema/mmcif.d.ts +24 -2
- package/lib/mol-io/reader/cif/schema/mmcif.js +23 -1
- package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
- package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
- package/lib/mol-model/structure/export/categories/atom_site.js +68 -1
- package/lib/mol-model/structure/export/categories/secondary-structure.js +8 -8
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
- package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
- package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
- package/lib/mol-model/structure/structure/element/loci.js +4 -2
- package/lib/mol-model/structure/structure/util/superposition-sifts-mapping.d.ts +21 -0
- package/lib/mol-model/structure/structure/util/{superposition-db-mapping.js → superposition-sifts-mapping.js} +38 -18
- package/lib/mol-model/volume/volume.d.ts +7 -0
- package/lib/mol-model/volume/volume.js +18 -0
- package/lib/mol-model-formats/structure/basic/schema.d.ts +5 -0
- package/lib/mol-model-formats/structure/common/property.d.ts +5 -2
- package/lib/mol-model-formats/structure/common/property.js +20 -8
- package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +1 -0
- package/lib/mol-model-formats/structure/property/bonds/index-pair.js +2 -1
- package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
- package/lib/mol-model-props/computed/interactions/common.js +16 -24
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +14 -4
- package/lib/mol-model-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +7 -5
- package/lib/mol-model-props/sequence/{best-database-mapping.js → sifts-mapping.js} +28 -25
- package/lib/{commonjs/mol-model-props/sequence/themes/best-database-mapping.d.ts → mol-model-props/sequence/themes/sifts-mapping.d.ts} +5 -5
- package/lib/mol-model-props/sequence/themes/{best-database-mapping.js → sifts-mapping.js} +19 -19
- package/lib/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts} +1 -1
- package/lib/mol-plugin/behavior/dynamic/custom-props/sequence/{best-database-mapping.js → sifts-mapping.js} +8 -8
- package/lib/mol-plugin/behavior/dynamic/custom-props.d.ts +1 -1
- package/lib/mol-plugin/behavior/dynamic/custom-props.js +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
- package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +2 -1
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +16 -7
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/mol-plugin/behavior/static/representation.js +1 -1
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
- package/lib/mol-plugin-state/actions/volume.js +3 -3
- package/lib/mol-plugin-state/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 +155 -125
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +5 -31
- package/lib/mol-plugin-state/builder/structure/representation.d.ts +2 -1
- package/lib/mol-plugin-state/formats/volume.js +1 -11
- package/lib/mol-plugin-state/manager/structure/component.d.ts +2 -1
- package/lib/mol-plugin-state/manager/structure/component.js +11 -8
- package/lib/mol-plugin-ui/controls/icons.d.ts +2 -1
- package/lib/mol-plugin-ui/controls/icons.js +5 -3
- package/lib/mol-plugin-ui/controls.d.ts +1 -1
- package/lib/mol-plugin-ui/controls.js +2 -1
- 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 +127 -127
- 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/structure/quick-styles.d.ts +25 -0
- package/lib/mol-plugin-ui/structure/quick-styles.js +128 -0
- package/lib/mol-plugin-ui/structure/superposition.d.ts +4 -1
- package/lib/mol-plugin-ui/structure/superposition.js +66 -30
- package/lib/mol-plugin-ui/structure/volume.js +4 -4
- package/lib/mol-repr/shape/loci/common.d.ts +1 -1
- package/lib/mol-repr/shape/loci/common.js +3 -3
- package/lib/mol-repr/structure/registry.d.ts +1 -1
- package/lib/mol-repr/structure/representation/cartoon.d.ts +4 -4
- package/lib/mol-repr/structure/representation/cartoon.js +3 -3
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
- package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
- package/lib/mol-repr/structure/visual/util/bond.js +5 -4
- package/lib/mol-script/language/builder.d.ts +1 -0
- package/lib/mol-state/transform.js +12 -2
- package/lib/mol-theme/color/element-symbol.d.ts +46 -2
- package/lib/mol-theme/color/element-symbol.js +15 -10
- package/lib/mol-theme/color/entity-id.js +14 -11
- package/lib/mol-theme/color/illustrative.d.ts +32 -32
- package/lib/mol-theme/color.d.ts +39 -17
- package/lib/servers/volume/config.js +3 -3
- package/lib/servers/volume/query.js +1 -1
- package/package.json +160 -163
- package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.d.ts +0 -13
- package/lib/mol-model/structure/structure/util/superposition-db-mapping.d.ts +0 -13
package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
@@ -66,11 +66,12 @@ function createInterUnitInteractionCylinderMesh(ctx, structure, theme, props, me
|
|
|
66
66
|
if (!childUnitA)
|
|
67
67
|
return true;
|
|
68
68
|
var unitA = structure.unitMap.get(b.unitA);
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
var _a = unitsFeatures.get(b.unitA), offsets = _a.offsets, members = _a.members;
|
|
70
|
+
for (var i = offsets[b.indexA], il = offsets[b.indexA + 1]; i < il; ++i) {
|
|
71
|
+
var eA = unitA.elements[members[i]];
|
|
72
|
+
if (!int_1.SortedArray.has(childUnitA.elements, eA))
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
74
75
|
}
|
|
75
76
|
return false;
|
|
76
77
|
}
|
|
@@ -119,8 +120,9 @@ function getInteractionLoci(pickingId, structure, id) {
|
|
|
119
120
|
}
|
|
120
121
|
return loci_1.EmptyLoci;
|
|
121
122
|
}
|
|
123
|
+
var __unitMap = new Map();
|
|
124
|
+
var __contactIndicesSet = new Set();
|
|
122
125
|
function eachInteraction(loci, structure, apply, isMarking) {
|
|
123
|
-
var _a;
|
|
124
126
|
var changed = false;
|
|
125
127
|
if (interactions_1.Interactions.isLoci(loci)) {
|
|
126
128
|
if (!structure_1.Structure.areEquivalent(loci.data.structure, structure))
|
|
@@ -129,8 +131,8 @@ function eachInteraction(loci, structure, apply, isMarking) {
|
|
|
129
131
|
if (loci.data.interactions !== interactions)
|
|
130
132
|
return false;
|
|
131
133
|
var contacts = interactions.contacts;
|
|
132
|
-
for (var _i = 0,
|
|
133
|
-
var c =
|
|
134
|
+
for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
|
|
135
|
+
var c = _a[_i];
|
|
134
136
|
var idx = contacts.getEdgeIndex(c.indexA, c.unitA.id, c.indexB, c.unitB.id);
|
|
135
137
|
if (idx !== -1) {
|
|
136
138
|
if (apply(int_1.Interval.ofSingleton(idx)))
|
|
@@ -143,28 +145,52 @@ function eachInteraction(loci, structure, apply, isMarking) {
|
|
|
143
145
|
return false;
|
|
144
146
|
if (isMarking && loci.elements.length === 1)
|
|
145
147
|
return false; // only a single unit
|
|
146
|
-
var
|
|
147
|
-
if (!
|
|
148
|
+
var interactions = interactions_2.InteractionsProvider.get(structure).value;
|
|
149
|
+
if (!interactions)
|
|
148
150
|
return false;
|
|
151
|
+
var contacts_1 = interactions.contacts, unitsFeatures_1 = interactions.unitsFeatures;
|
|
152
|
+
for (var _b = 0, _c = loci.elements; _b < _c.length; _b++) {
|
|
153
|
+
var e = _c[_b];
|
|
154
|
+
__unitMap.set(e.unit.id, e.indices);
|
|
155
|
+
}
|
|
149
156
|
var _loop_1 = function (e) {
|
|
150
157
|
var unit = e.unit;
|
|
151
158
|
if (!structure_2.Unit.isAtomic(unit))
|
|
152
159
|
return "continue";
|
|
153
|
-
if (isMarking && int_1.OrderedSet.size(e.indices) === 1)
|
|
154
|
-
return "continue";
|
|
155
160
|
int_1.OrderedSet.forEach(e.indices, function (v) {
|
|
156
161
|
for (var _i = 0, _a = contacts_1.getContactIndicesForElement(v, unit); _i < _a.length; _i++) {
|
|
157
162
|
var idx = _a[_i];
|
|
158
|
-
|
|
159
|
-
changed = true;
|
|
163
|
+
__contactIndicesSet.add(idx);
|
|
160
164
|
}
|
|
161
165
|
});
|
|
162
166
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var e = _d[_c];
|
|
167
|
+
for (var _d = 0, _e = loci.elements; _d < _e.length; _d++) {
|
|
168
|
+
var e = _e[_d];
|
|
166
169
|
_loop_1(e);
|
|
167
170
|
}
|
|
171
|
+
__contactIndicesSet.forEach(function (i) {
|
|
172
|
+
if (isMarking) {
|
|
173
|
+
var _a = contacts_1.edges[i], indexA = _a.indexA, unitA = _a.unitA, indexB = _a.indexB, unitB = _a.unitB;
|
|
174
|
+
var indicesA = __unitMap.get(unitA);
|
|
175
|
+
var indicesB = __unitMap.get(unitB);
|
|
176
|
+
if (!indicesA || !indicesB)
|
|
177
|
+
return;
|
|
178
|
+
var _b = unitsFeatures_1.get(unitA), offsetsA = _b.offsets, membersA = _b.members;
|
|
179
|
+
for (var j = offsetsA[indexA], jl = offsetsA[indexA + 1]; j < jl; ++j) {
|
|
180
|
+
if (!int_1.OrderedSet.has(indicesA, membersA[j]))
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
var _c = unitsFeatures_1.get(unitB), offsetsB = _c.offsets, membersB = _c.members;
|
|
184
|
+
for (var j = offsetsB[indexB], jl = offsetsB[indexB + 1]; j < jl; ++j) {
|
|
185
|
+
if (!int_1.OrderedSet.has(indicesB, membersB[j]))
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (apply(int_1.Interval.ofSingleton(i)))
|
|
190
|
+
changed = true;
|
|
191
|
+
});
|
|
192
|
+
__unitMap.clear();
|
|
193
|
+
__contactIndicesSet.clear();
|
|
168
194
|
}
|
|
169
195
|
return changed;
|
|
170
196
|
}
|
package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js
CHANGED
|
@@ -52,9 +52,19 @@ function createIntraUnitInteractionsCylinderMesh(ctx, unit, structure, theme, pr
|
|
|
52
52
|
var sizeB = theme.size.size(location);
|
|
53
53
|
return Math.min(sizeA, sizeB) * sizeFactor;
|
|
54
54
|
},
|
|
55
|
-
ignore: function (edgeIndex) {
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
ignore: function (edgeIndex) {
|
|
56
|
+
if (flag[edgeIndex] === 1 /* Filtered */)
|
|
57
|
+
return true;
|
|
58
|
+
if (childUnit) {
|
|
59
|
+
var f = a[edgeIndex];
|
|
60
|
+
for (var i = offsets[f], jl = offsets[f + 1]; i < jl; ++i) {
|
|
61
|
+
var e = unit.elements[members[offsets[i]]];
|
|
62
|
+
if (!int_1.SortedArray.has(childUnit.elements, e))
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
58
68
|
};
|
|
59
69
|
m = (0, link_1.createLinkCylinderMesh)(ctx, builderProps, props, mesh);
|
|
60
70
|
sphere = geometry_1.Sphere3D.expand((0, geometry_1.Sphere3D)(), (childUnit !== null && childUnit !== void 0 ? childUnit : unit).boundary.sphere, 1 * sizeFactor);
|
|
@@ -147,7 +157,6 @@ function eachInteraction(loci, structureGroup, apply, isMarking) {
|
|
|
147
157
|
var unitIdx = group.unitIndexMap.get(e.unit.id);
|
|
148
158
|
if (unitIdx === undefined)
|
|
149
159
|
return "continue";
|
|
150
|
-
__contactIndicesSet.clear();
|
|
151
160
|
int_1.OrderedSet.forEach(e.indices, function (v) {
|
|
152
161
|
for (var i = fOffsets_1[v], il = fOffsets_1[v + 1]; i < il; ++i) {
|
|
153
162
|
var fI = fIndices_1[i];
|
|
@@ -172,6 +181,7 @@ function eachInteraction(loci, structureGroup, apply, isMarking) {
|
|
|
172
181
|
if (apply(int_1.Interval.ofSingleton(unitIdx * groupCount_1 + i)))
|
|
173
182
|
changed = true;
|
|
174
183
|
});
|
|
184
|
+
__contactIndicesSet.clear();
|
|
175
185
|
};
|
|
176
186
|
for (var _c = 0, _d = loci.elements; _c < _d.length; _c++) {
|
|
177
187
|
var e = _d[_c];
|
package/lib/commonjs/mol-model-props/sequence/{best-database-mapping.d.ts → sifts-mapping.d.ts}
RENAMED
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
*/
|
|
6
|
+
import { Model } from '../../mol-model/structure';
|
|
6
7
|
import { StructureElement } from '../../mol-model/structure/structure';
|
|
7
8
|
import { CustomModelProperty } from '../common/custom-model-property';
|
|
8
|
-
export {
|
|
9
|
-
interface
|
|
9
|
+
export { SIFTSMapping as SIFTSMapping };
|
|
10
|
+
interface SIFTSMappingMapping {
|
|
10
11
|
readonly dbName: string[];
|
|
11
12
|
readonly accession: string[];
|
|
12
|
-
readonly num:
|
|
13
|
+
readonly num: string[];
|
|
13
14
|
readonly residue: string[];
|
|
14
15
|
}
|
|
15
|
-
declare namespace
|
|
16
|
-
const Provider: CustomModelProperty.Provider<{},
|
|
16
|
+
declare namespace SIFTSMapping {
|
|
17
|
+
const Provider: CustomModelProperty.Provider<{}, SIFTSMappingMapping>;
|
|
18
|
+
function isAvailable(model: Model): boolean;
|
|
17
19
|
function getKey(loc: StructureElement.Location): string;
|
|
18
20
|
function getLabel(loc: StructureElement.Location): string | undefined;
|
|
19
21
|
}
|
|
@@ -5,42 +5,49 @@
|
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.SIFTSMapping = void 0;
|
|
9
9
|
var tslib_1 = require("tslib");
|
|
10
10
|
var mmcif_1 = require("../../mol-model-formats/structure/mmcif");
|
|
11
11
|
var custom_property_1 = require("../../mol-model/custom-property");
|
|
12
12
|
var custom_model_property_1 = require("../common/custom-model-property");
|
|
13
|
-
var
|
|
14
|
-
(function (
|
|
13
|
+
var SIFTSMapping;
|
|
14
|
+
(function (SIFTSMapping) {
|
|
15
15
|
var _this = this;
|
|
16
|
-
|
|
17
|
-
label: '
|
|
16
|
+
SIFTSMapping.Provider = custom_model_property_1.CustomModelProperty.createProvider({
|
|
17
|
+
label: 'SIFTS Mapping',
|
|
18
18
|
descriptor: (0, custom_property_1.CustomPropertyDescriptor)({
|
|
19
|
-
name: '
|
|
19
|
+
name: 'sifts_sequence_mapping'
|
|
20
20
|
}),
|
|
21
21
|
type: 'static',
|
|
22
22
|
defaultParams: {},
|
|
23
23
|
getParams: function () { return ({}); },
|
|
24
|
-
isApplicable: function (data) {
|
|
24
|
+
isApplicable: function (data) { return isAvailable(data); },
|
|
25
25
|
obtain: function (ctx, data) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
26
26
|
return (0, tslib_1.__generator)(this, function (_a) {
|
|
27
27
|
return [2 /*return*/, { value: fromCif(data) }];
|
|
28
28
|
});
|
|
29
29
|
}); }
|
|
30
30
|
});
|
|
31
|
+
function isAvailable(model) {
|
|
32
|
+
if (!mmcif_1.MmcifFormat.is(model.sourceData))
|
|
33
|
+
return false;
|
|
34
|
+
var _a = model.sourceData.data.db.atom_site, db_name = _a.pdbx_sifts_xref_db_name, db_acc = _a.pdbx_sifts_xref_db_acc, db_num = _a.pdbx_sifts_xref_db_num, db_res = _a.pdbx_sifts_xref_db_res;
|
|
35
|
+
return db_name.isDefined && db_acc.isDefined && db_num.isDefined && db_res.isDefined;
|
|
36
|
+
}
|
|
37
|
+
SIFTSMapping.isAvailable = isAvailable;
|
|
31
38
|
function getKey(loc) {
|
|
32
39
|
var model = loc.unit.model;
|
|
33
|
-
var data =
|
|
40
|
+
var data = SIFTSMapping.Provider.get(model).value;
|
|
34
41
|
if (!data)
|
|
35
42
|
return '';
|
|
36
43
|
var eI = loc.unit.elements[loc.element];
|
|
37
44
|
var rI = model.atomicHierarchy.residueAtomSegments.index[eI];
|
|
38
45
|
return data.accession[rI];
|
|
39
46
|
}
|
|
40
|
-
|
|
47
|
+
SIFTSMapping.getKey = getKey;
|
|
41
48
|
function getLabel(loc) {
|
|
42
49
|
var model = loc.unit.model;
|
|
43
|
-
var data =
|
|
50
|
+
var data = SIFTSMapping.Provider.get(model).value;
|
|
44
51
|
if (!data)
|
|
45
52
|
return;
|
|
46
53
|
var eI = loc.unit.elements[loc.element];
|
|
@@ -50,19 +57,15 @@ var BestDatabaseSequenceMapping;
|
|
|
50
57
|
return;
|
|
51
58
|
return "".concat(dbName, " ").concat(data.accession[rI], " ").concat(data.num[rI], " ").concat(data.residue[rI]);
|
|
52
59
|
}
|
|
53
|
-
|
|
60
|
+
SIFTSMapping.getLabel = getLabel;
|
|
54
61
|
function fromCif(model) {
|
|
55
62
|
if (!mmcif_1.MmcifFormat.is(model.sourceData))
|
|
56
63
|
return;
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
var db_acc = atom_site.getField('pdbx_sifts_xref_db_acc');
|
|
60
|
-
var db_num = atom_site.getField('pdbx_sifts_xref_db_num');
|
|
61
|
-
var db_res = atom_site.getField('pdbx_sifts_xref_db_res');
|
|
62
|
-
if (!db_name || !db_acc || !db_num || !db_res)
|
|
64
|
+
var _a = model.sourceData.data.db.atom_site, db_name = _a.pdbx_sifts_xref_db_name, db_acc = _a.pdbx_sifts_xref_db_acc, db_num = _a.pdbx_sifts_xref_db_num, db_res = _a.pdbx_sifts_xref_db_res;
|
|
65
|
+
if (!db_name.isDefined || !db_acc.isDefined || !db_num.isDefined || !db_res.isDefined)
|
|
63
66
|
return;
|
|
64
67
|
var atomSourceIndex = model.atomicHierarchy.atomSourceIndex;
|
|
65
|
-
var
|
|
68
|
+
var _b = model.atomicHierarchy.residueAtomSegments, count = _b.count, residueOffsets = _b.offsets;
|
|
66
69
|
var dbName = new Array(count);
|
|
67
70
|
var accession = new Array(count);
|
|
68
71
|
var num = new Array(count);
|
|
@@ -72,17 +75,17 @@ var BestDatabaseSequenceMapping;
|
|
|
72
75
|
if (db_name.valueKind(row) !== 0 /* Present */) {
|
|
73
76
|
dbName[i] = '';
|
|
74
77
|
accession[i] = '';
|
|
75
|
-
num[i] =
|
|
78
|
+
num[i] = '';
|
|
76
79
|
residue[i] = '';
|
|
77
80
|
continue;
|
|
78
81
|
}
|
|
79
|
-
dbName[i] = db_name.
|
|
80
|
-
accession[i] = db_acc.
|
|
81
|
-
num[i] = db_num.
|
|
82
|
-
residue[i] = db_res.
|
|
82
|
+
dbName[i] = db_name.value(row);
|
|
83
|
+
accession[i] = db_acc.value(row);
|
|
84
|
+
num[i] = db_num.value(row);
|
|
85
|
+
residue[i] = db_res.value(row);
|
|
83
86
|
}
|
|
84
87
|
return { dbName: dbName, accession: accession, num: num, residue: residue };
|
|
85
88
|
}
|
|
86
|
-
})(
|
|
87
|
-
exports.
|
|
88
|
-
//# sourceMappingURL=
|
|
89
|
+
})(SIFTSMapping || (SIFTSMapping = {}));
|
|
90
|
+
exports.SIFTSMapping = SIFTSMapping;
|
|
91
|
+
//# sourceMappingURL=sifts-mapping.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ColorTheme } from '../../../mol-theme/color';
|
|
7
7
|
import { ThemeDataContext } from '../../../mol-theme/theme';
|
|
8
8
|
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const SIFTSMappingColorThemeParams: {
|
|
10
10
|
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
11
11
|
maxCount: number;
|
|
12
12
|
hue: [number, number];
|
|
@@ -21,8 +21,8 @@ export declare const BestDatabaseSequenceMappingColorThemeParams: {
|
|
|
21
21
|
};
|
|
22
22
|
}>, "colors">>;
|
|
23
23
|
};
|
|
24
|
-
export declare type
|
|
25
|
-
export declare function
|
|
24
|
+
export declare type SIFTSMappingColorThemeParams = typeof SIFTSMappingColorThemeParams;
|
|
25
|
+
export declare function getSIFTSMappingColorThemeParams(ctx: ThemeDataContext): {
|
|
26
26
|
palette: PD.Mapped<PD.NamedParams<PD.Normalize<{
|
|
27
27
|
maxCount: number;
|
|
28
28
|
hue: [number, number];
|
|
@@ -37,5 +37,5 @@ export declare function getBestDatabaseSequenceMappingColorThemeParams(ctx: Them
|
|
|
37
37
|
};
|
|
38
38
|
}>, "colors">>;
|
|
39
39
|
};
|
|
40
|
-
export declare function
|
|
41
|
-
export declare const
|
|
40
|
+
export declare function SIFTSMappingColorTheme(ctx: ThemeDataContext, props: PD.Values<SIFTSMappingColorThemeParams>): ColorTheme<SIFTSMappingColorThemeParams>;
|
|
41
|
+
export declare const SIFTSMappingColorThemeProvider: ColorTheme.Provider<SIFTSMappingColorThemeParams, 'sifts-mapping'>;
|
package/lib/commonjs/mol-model-props/sequence/themes/{best-database-mapping.js → sifts-mapping.js}
RENAMED
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.SIFTSMappingColorThemeProvider = exports.SIFTSMappingColorTheme = exports.getSIFTSMappingColorThemeParams = exports.SIFTSMappingColorThemeParams = void 0;
|
|
9
9
|
var tslib_1 = require("tslib");
|
|
10
10
|
var structure_1 = require("../../../mol-model/structure");
|
|
11
11
|
var color_1 = require("../../../mol-util/color");
|
|
12
12
|
var palette_1 = require("../../../mol-util/color/palette");
|
|
13
13
|
var param_definition_1 = require("../../../mol-util/param-definition");
|
|
14
|
-
var
|
|
14
|
+
var sifts_mapping_1 = require("../sifts-mapping");
|
|
15
15
|
var DefaultColor = (0, color_1.Color)(0xFAFAFA);
|
|
16
|
-
var Description = 'Assigns a color based on
|
|
16
|
+
var Description = 'Assigns a color based on SIFTS mapping.';
|
|
17
17
|
// same colors for same accessions
|
|
18
18
|
var globalAccessionMap = new Map();
|
|
19
|
-
exports.
|
|
20
|
-
function
|
|
21
|
-
return exports.
|
|
19
|
+
exports.SIFTSMappingColorThemeParams = (0, tslib_1.__assign)({}, (0, palette_1.getPaletteParams)({ type: 'colors', colorList: 'set-1' }));
|
|
20
|
+
function getSIFTSMappingColorThemeParams(ctx) {
|
|
21
|
+
return exports.SIFTSMappingColorThemeParams; // TODO return copy
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
24
|
-
function
|
|
23
|
+
exports.getSIFTSMappingColorThemeParams = getSIFTSMappingColorThemeParams;
|
|
24
|
+
function SIFTSMappingColorTheme(ctx, props) {
|
|
25
25
|
var color;
|
|
26
26
|
if (ctx.structure) {
|
|
27
27
|
for (var _i = 0, _a = ctx.structure.models; _i < _a.length; _i++) {
|
|
28
28
|
var m = _a[_i];
|
|
29
|
-
var mapping =
|
|
29
|
+
var mapping = sifts_mapping_1.SIFTSMapping.Provider.get(m).value;
|
|
30
30
|
if (!mapping)
|
|
31
31
|
continue;
|
|
32
32
|
for (var _b = 0, _c = mapping.accession; _b < _c.length; _b++) {
|
|
@@ -40,7 +40,7 @@ function BestDatabaseSequenceMappingColorTheme(ctx, props) {
|
|
|
40
40
|
var palette_2 = (0, palette_1.getPalette)(globalAccessionMap.size + 1, props, { valueLabel: function (i) { return "".concat(i); } });
|
|
41
41
|
var colorMap_1 = new Map();
|
|
42
42
|
var getColor_1 = function (location) {
|
|
43
|
-
var key =
|
|
43
|
+
var key = sifts_mapping_1.SIFTSMapping.getKey(location);
|
|
44
44
|
if (!key)
|
|
45
45
|
return DefaultColor;
|
|
46
46
|
if (colorMap_1.has(key))
|
|
@@ -65,7 +65,7 @@ function BestDatabaseSequenceMappingColorTheme(ctx, props) {
|
|
|
65
65
|
color = function () { return DefaultColor; };
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
|
-
factory:
|
|
68
|
+
factory: SIFTSMappingColorTheme,
|
|
69
69
|
granularity: 'group',
|
|
70
70
|
preferSmoothing: true,
|
|
71
71
|
color: color,
|
|
@@ -73,15 +73,15 @@ function BestDatabaseSequenceMappingColorTheme(ctx, props) {
|
|
|
73
73
|
description: Description,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
name: '
|
|
79
|
-
label: '
|
|
76
|
+
exports.SIFTSMappingColorTheme = SIFTSMappingColorTheme;
|
|
77
|
+
exports.SIFTSMappingColorThemeProvider = {
|
|
78
|
+
name: 'sifts-mapping',
|
|
79
|
+
label: 'SIFTS Mapping',
|
|
80
80
|
category: "Residue Property" /* Residue */,
|
|
81
|
-
factory:
|
|
82
|
-
getParams:
|
|
83
|
-
defaultValues: param_definition_1.ParamDefinition.getDefaultValues(exports.
|
|
84
|
-
isApplicable: function (ctx) { var _a; return !!((_a = ctx.structure) === null || _a === void 0 ? void 0 : _a.models.some(function (m) { return
|
|
81
|
+
factory: SIFTSMappingColorTheme,
|
|
82
|
+
getParams: getSIFTSMappingColorThemeParams,
|
|
83
|
+
defaultValues: param_definition_1.ParamDefinition.getDefaultValues(exports.SIFTSMappingColorThemeParams),
|
|
84
|
+
isApplicable: function (ctx) { var _a; return !!((_a = ctx.structure) === null || _a === void 0 ? void 0 : _a.models.some(function (m) { return sifts_mapping_1.SIFTSMapping.Provider.isApplicable(m); })); },
|
|
85
85
|
ensureCustomProperties: {
|
|
86
86
|
attach: function (ctx, data) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
|
|
87
87
|
var _i, _a, m;
|
|
@@ -95,7 +95,7 @@ exports.BestDatabaseSequenceMappingColorThemeProvider = {
|
|
|
95
95
|
case 1:
|
|
96
96
|
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
97
97
|
m = _a[_i];
|
|
98
|
-
return [4 /*yield*/,
|
|
98
|
+
return [4 /*yield*/, sifts_mapping_1.SIFTSMapping.Provider.attach(ctx, m, void 0, true)];
|
|
99
99
|
case 2:
|
|
100
100
|
_b.sent();
|
|
101
101
|
_b.label = 3;
|
|
@@ -111,9 +111,9 @@ exports.BestDatabaseSequenceMappingColorThemeProvider = {
|
|
|
111
111
|
return;
|
|
112
112
|
for (var _i = 0, _a = data.structure.models; _i < _a.length; _i++) {
|
|
113
113
|
var m = _a[_i];
|
|
114
|
-
|
|
114
|
+
sifts_mapping_1.SIFTSMapping.Provider.ref(m, false);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=
|
|
119
|
+
//# sourceMappingURL=sifts-mapping.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
*/
|
|
6
6
|
import { PluginBehavior } from '../../../behavior';
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const SIFTSMapping: import("../../../../../mol-state/transformer").StateTransformer<PluginBehavior.Category, PluginBehavior.Behavior, {
|
|
8
8
|
autoAttach: boolean;
|
|
9
9
|
showTooltip: boolean;
|
|
10
10
|
}>;
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.SIFTSMapping = void 0;
|
|
9
9
|
var tslib_1 = require("tslib");
|
|
10
10
|
var int_1 = require("../../../../../mol-data/int");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var sifts_mapping_1 = require("../../../../../mol-model-props/sequence/sifts-mapping");
|
|
12
|
+
var sifts_mapping_2 = require("../../../../../mol-model-props/sequence/themes/sifts-mapping");
|
|
13
13
|
var structure_1 = require("../../../../../mol-model/structure");
|
|
14
14
|
var param_definition_1 = require("../../../../../mol-util/param-definition");
|
|
15
15
|
var behavior_1 = require("../../../behavior");
|
|
16
|
-
exports.
|
|
17
|
-
name: '
|
|
16
|
+
exports.SIFTSMapping = behavior_1.PluginBehavior.create({
|
|
17
|
+
name: 'sifts-mapping-prop',
|
|
18
18
|
category: 'custom-props',
|
|
19
|
-
display: { name: '
|
|
19
|
+
display: { name: 'SIFTS Mapping' },
|
|
20
20
|
ctor: /** @class */ (function (_super) {
|
|
21
21
|
(0, tslib_1.__extends)(class_1, _super);
|
|
22
22
|
function class_1() {
|
|
23
23
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
_this.provider =
|
|
24
|
+
_this.provider = sifts_mapping_1.SIFTSMapping.Provider;
|
|
25
25
|
_this.labelProvider = {
|
|
26
26
|
label: function (loci) {
|
|
27
27
|
if (!_this.params.showTooltip)
|
|
@@ -41,12 +41,12 @@ exports.BestDatabaseSequenceMapping = behavior_1.PluginBehavior.create({
|
|
|
41
41
|
};
|
|
42
42
|
class_1.prototype.register = function () {
|
|
43
43
|
this.ctx.customModelProperties.register(this.provider, this.params.autoAttach);
|
|
44
|
-
this.ctx.representation.structure.themes.colorThemeRegistry.add(
|
|
44
|
+
this.ctx.representation.structure.themes.colorThemeRegistry.add(sifts_mapping_2.SIFTSMappingColorThemeProvider);
|
|
45
45
|
this.ctx.managers.lociLabels.addProvider(this.labelProvider);
|
|
46
46
|
};
|
|
47
47
|
class_1.prototype.unregister = function () {
|
|
48
48
|
this.ctx.customModelProperties.unregister(this.provider.descriptor.name);
|
|
49
|
-
this.ctx.representation.structure.themes.colorThemeRegistry.remove(
|
|
49
|
+
this.ctx.representation.structure.themes.colorThemeRegistry.remove(sifts_mapping_2.SIFTSMappingColorThemeProvider);
|
|
50
50
|
this.ctx.managers.lociLabels.removeProvider(this.labelProvider);
|
|
51
51
|
};
|
|
52
52
|
return class_1;
|
|
@@ -64,7 +64,7 @@ function bestDatabaseSequenceMappingLabel(loci) {
|
|
|
64
64
|
var e = loci.elements[0];
|
|
65
65
|
var u = e.unit;
|
|
66
66
|
var se = structure_1.StructureElement.Location.create(loci.structure, u, u.elements[int_1.OrderedSet.getAt(e.indices, 0)]);
|
|
67
|
-
return
|
|
67
|
+
return sifts_mapping_1.SIFTSMapping.getLabel(se);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
//# sourceMappingURL=
|
|
70
|
+
//# sourceMappingURL=sifts-mapping.js.map
|
|
@@ -9,5 +9,5 @@ export { AccessibleSurfaceArea } from './custom-props/computed/accessible-surfac
|
|
|
9
9
|
export { Interactions } from './custom-props/computed/interactions';
|
|
10
10
|
export { SecondaryStructure } from './custom-props/computed/secondary-structure';
|
|
11
11
|
export { ValenceModel } from './custom-props/computed/valence-model';
|
|
12
|
-
export { BestDatabaseSequenceMapping } from './custom-props/sequence/
|
|
12
|
+
export { SIFTSMapping as BestDatabaseSequenceMapping } from './custom-props/sequence/sifts-mapping';
|
|
13
13
|
export { CrossLinkRestraint } from './custom-props/integrative/cross-link-restraint';
|
|
@@ -17,8 +17,8 @@ var secondary_structure_1 = require("./custom-props/computed/secondary-structure
|
|
|
17
17
|
Object.defineProperty(exports, "SecondaryStructure", { enumerable: true, get: function () { return secondary_structure_1.SecondaryStructure; } });
|
|
18
18
|
var valence_model_1 = require("./custom-props/computed/valence-model");
|
|
19
19
|
Object.defineProperty(exports, "ValenceModel", { enumerable: true, get: function () { return valence_model_1.ValenceModel; } });
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "BestDatabaseSequenceMapping", { enumerable: true, get: function () { return
|
|
20
|
+
var sifts_mapping_1 = require("./custom-props/sequence/sifts-mapping");
|
|
21
|
+
Object.defineProperty(exports, "BestDatabaseSequenceMapping", { enumerable: true, get: function () { return sifts_mapping_1.SIFTSMapping; } });
|
|
22
22
|
var cross_link_restraint_1 = require("./custom-props/integrative/cross-link-restraint");
|
|
23
23
|
Object.defineProperty(exports, "CrossLinkRestraint", { enumerable: true, get: function () { return cross_link_restraint_1.CrossLinkRestraint; } });
|
|
24
24
|
//# sourceMappingURL=custom-props.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -1,6 +1,6 @@
|
|
|
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>
|
|
@@ -216,11 +216,16 @@ exports.DefaultLociLabelProvider = behavior_1.PluginBehavior.create({
|
|
|
216
216
|
this.f = {
|
|
217
217
|
label: function (loci) {
|
|
218
218
|
var label = [];
|
|
219
|
-
if (structure_1.StructureElement.Loci.is(loci)
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
if (structure_1.StructureElement.Loci.is(loci)) {
|
|
220
|
+
var entityNames = new Set();
|
|
221
|
+
for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
|
|
222
|
+
var u = _a[_i].unit;
|
|
223
|
+
var l = structure_1.StructureElement.Location.create(loci.structure, u, u.elements[0]);
|
|
224
|
+
var name_1 = structure_1.StructureProperties.entity.pdbx_description(l).join(', ');
|
|
225
|
+
entityNames.add(name_1);
|
|
226
|
+
}
|
|
227
|
+
if (entityNames.size === 1)
|
|
228
|
+
entityNames.forEach(function (name) { return label.push(name); });
|
|
224
229
|
}
|
|
225
230
|
label.push((0, label_1.lociLabel)(loci));
|
|
226
231
|
return label.filter(function (l) { return !!l; }).join('</br>');
|
package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-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>
|
|
@@ -22,6 +22,7 @@ declare const StructureFocusRepresentationParams: (plugin: PluginContext) => {
|
|
|
22
22
|
components: PD.MultiSelect<"target" | "surroundings" | "interactions">;
|
|
23
23
|
excludeTargetFromSurroundings: PD.BooleanParam;
|
|
24
24
|
ignoreHydrogens: PD.BooleanParam;
|
|
25
|
+
ignoreLight: PD.BooleanParam;
|
|
25
26
|
material: PD.Group<PD.Normalize<{
|
|
26
27
|
metalness: number;
|
|
27
28
|
roughness: number;
|
package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-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>
|
|
@@ -27,11 +27,19 @@ var StructureFocusRepresentationParams = function (plugin) {
|
|
|
27
27
|
expandRadius: param_definition_1.ParamDefinition.Numeric(5, { min: 1, max: 10, step: 1 }),
|
|
28
28
|
targetParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
29
29
|
label: 'Target',
|
|
30
|
-
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
30
|
+
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
31
|
+
type: 'ball-and-stick',
|
|
32
|
+
size: 'physical',
|
|
33
|
+
typeParams: { sizeFactor: 0.22, sizeAspectRatio: 0.73, adjustCylinderLength: true, xrayShaded: true, aromaticBonds: false, multipleBonds: 'off', excludeTypes: ['hydrogen-bond', 'metal-coordination'] },
|
|
34
|
+
})
|
|
31
35
|
}),
|
|
32
36
|
surroundingsParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
33
37
|
label: 'Surroundings',
|
|
34
|
-
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
38
|
+
customDefault: (0, structure_representation_params_1.createStructureRepresentationParams)(plugin, void 0, {
|
|
39
|
+
type: 'ball-and-stick',
|
|
40
|
+
size: 'physical',
|
|
41
|
+
typeParams: { sizeFactor: 0.16, excludeTypes: ['hydrogen-bond', 'metal-coordination'] }
|
|
42
|
+
})
|
|
35
43
|
}),
|
|
36
44
|
nciParams: param_definition_1.ParamDefinition.Group(reprParams, {
|
|
37
45
|
label: 'Non-covalent Int.',
|
|
@@ -44,6 +52,7 @@ var StructureFocusRepresentationParams = function (plugin) {
|
|
|
44
52
|
components: param_definition_1.ParamDefinition.MultiSelect(FocusComponents, param_definition_1.ParamDefinition.arrayToOptions(FocusComponents)),
|
|
45
53
|
excludeTargetFromSurroundings: param_definition_1.ParamDefinition.Boolean(false, { label: 'Exclude Target', description: 'Exclude the focus "target" from the surroudings component.' }),
|
|
46
54
|
ignoreHydrogens: param_definition_1.ParamDefinition.Boolean(false),
|
|
55
|
+
ignoreLight: param_definition_1.ParamDefinition.Boolean(false),
|
|
47
56
|
material: material_1.Material.getParam(),
|
|
48
57
|
clip: param_definition_1.ParamDefinition.Group(clip_1.Clip.Params),
|
|
49
58
|
};
|
|
@@ -71,9 +80,9 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
71
80
|
configurable: true
|
|
72
81
|
});
|
|
73
82
|
StructureFocusRepresentationBehavior.prototype.getReprParams = function (reprParams) {
|
|
74
|
-
return (0, tslib_1.__assign)((0, tslib_1.__assign)({},
|
|
83
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams), { type: {
|
|
75
84
|
name: reprParams.type.name,
|
|
76
|
-
params: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams.type.params), { ignoreHydrogens: this.params.ignoreHydrogens, material: this.params.material, clip: this.params.clip })
|
|
85
|
+
params: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, reprParams.type.params), { ignoreHydrogens: this.params.ignoreHydrogens, ignoreLight: this.params.ignoreLight, material: this.params.material, clip: this.params.clip })
|
|
77
86
|
} });
|
|
78
87
|
};
|
|
79
88
|
StructureFocusRepresentationBehavior.prototype.ensureShape = function (cell) {
|
|
@@ -107,7 +116,7 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
107
116
|
if (components.indexOf('interactions') >= 0 && !refs[StructureFocusRepresentationTags.SurrNciRepr] && cell.obj && interactions_1.InteractionsRepresentationProvider.isApplicable((_a = cell.obj) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
108
117
|
refs[StructureFocusRepresentationTags.SurrNciRepr] = builder
|
|
109
118
|
.to(refs[StructureFocusRepresentationTags.SurrSel])
|
|
110
|
-
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.params.nciParams, { tags: StructureFocusRepresentationTags.SurrNciRepr }).ref;
|
|
119
|
+
.apply(transforms_1.StateTransforms.Representation.StructureRepresentation3D, this.getReprParams(this.params.nciParams), { tags: StructureFocusRepresentationTags.SurrNciRepr }).ref;
|
|
111
120
|
}
|
|
112
121
|
return { state: state, builder: builder, refs: refs };
|
|
113
122
|
};
|
|
@@ -217,7 +226,7 @@ var StructureFocusRepresentationBehavior = /** @class */ (function (_super) {
|
|
|
217
226
|
if (!hasComponent)
|
|
218
227
|
builder.delete(repr.transform.ref);
|
|
219
228
|
else
|
|
220
|
-
builder.to(repr).update(this.params.nciParams);
|
|
229
|
+
builder.to(repr).update(this.getReprParams(this.params.nciParams));
|
|
221
230
|
}
|
|
222
231
|
return [4 /*yield*/, commands_1.PluginCommands.State.Update(this.plugin, { state: state, tree: builder, options: { doNotLogTiming: true, doNotUpdateCurrent: true } })];
|
|
223
232
|
case 1:
|