Compare commits

...

2261 Commits

Author SHA1 Message Date
Alexander Rose
d98350cfb2 4.2.0 2024-05-04 18:52:14 -07:00
Alexander Rose
ae96b6cdac changelog 2024-05-04 18:49:40 -07:00
Alexander Rose
7ba6f5bf4c package updates 2024-05-04 18:49:03 -07:00
Alexander Rose
cede59c282 Merge pull request #1083 from molstar/emissive-bloom
Emissive & Bloom
2024-05-04 18:46:11 -07:00
Alexander Rose
87db52c339 Merge branch 'master' of https://github.com/molstar/molstar into emissive-bloom 2024-05-04 11:22:22 -07:00
Alexander Rose
b3d4500505 Merge pull request #1101 from midlik/load-mvs-keep-camera
Load mvs keep camera
2024-05-04 11:20:17 -07:00
Alexander Rose
2935f1340d Merge branch 'master' into load-mvs-keep-camera 2024-05-04 11:20:02 -07:00
Alexander Rose
fda3481d15 fix bumpiness artifact with xrayShaded 2024-05-04 10:50:36 -07:00
Alexander Rose
24ad3c875a handle identical sets cases in SetUTils 2024-05-04 10:48:27 -07:00
Alexander Rose
dd31c3041b fix bloom & transparent background
- need to blur alpha channel
2024-05-04 10:45:34 -07:00
Alexander Rose
8f3a3dd2be fix variable redeclaration 2024-05-04 10:43:56 -07:00
Alexander Rose
d9d378b249 Merge pull request #1109 from molstar/bond-assignment-fixes
bond assignment fixes
2024-04-29 22:13:51 -07:00
Alexander Rose
98119787e9 Merge branch 'master' into bond-assignment-fixes 2024-04-29 22:13:42 -07:00
Alexander Rose
b00f650066 Merge pull request #1110 from molstar/fix-bumpiness-1107
fix bumpiness artifact
2024-04-29 22:12:45 -07:00
dsehnal
24e7456d6d lint 2024-04-29 14:51:23 +02:00
Alexander Rose
0bb596e255 expand render-shape in tests/browser
- toggling spheres visibility
2024-04-28 18:29:15 -07:00
Alexander Rose
31a6eef1a4 expand render-shape in tests/browser 2024-04-28 18:22:13 -07:00
Alexander Rose
1deead40a5 schema updates 2024-04-28 14:38:06 -07:00
Alexander Rose
628f72903d package updates 2024-04-28 14:37:42 -07:00
Alexander Rose
5d8a569aef fix bumpiness artifact 2024-04-27 18:52:57 -07:00
Alexander Rose
9604b89ee0 workaround bloom artifacts
- getImageData: no undo of pre-multiplied alpha when bloom pass is disabled
2024-04-27 18:20:34 -07:00
Alexander Rose
4627d436a6 Merge branch 'master' of https://github.com/molstar/molstar into emissive-bloom 2024-04-27 15:37:46 -07:00
Alexander Rose
10cdd6a1f0 Merge pull request #1104 from molstar/ssao-artifacts
Fix SSAO artifacts (@corredD, #1082)
2024-04-27 15:36:00 -07:00
Alexander Rose
db9cb955b0 bond assignment fixes 2024-04-27 12:44:09 -07:00
Adam Midlik
00ad11dd6b MVS: camera positioning uses sceneRadiusFactor to avoid cropping 2024-04-26 16:18:46 +01:00
Ryan DiRisio
932b59d62c return selectors for each StateTransform in each measurement (#1087)
* return selectors for each StateTransform in each measurement

* update changelog, modify file header, add name to contributors

* consistently name return selections and labels

---------

Co-authored-by: Ryan DiRisio <rdirisio@treeline.bio>
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2024-04-25 16:10:21 +02:00
Alexander Rose
86b889d48b Merge branch 'master' of https://github.com/molstar/molstar into emissive-bloom 2024-04-24 21:33:19 -07:00
Alexander Rose
9521d47b4e Fix SSAO artifacts (@corredD, #1082) 2024-04-24 21:13:19 -07:00
Alexander Rose
032cf3ad8b typo 2024-04-24 20:48:54 -07:00
Alexander Rose
b39f9a772d changelog 2024-04-24 20:39:51 -07:00
Alexander Rose
ebe727ba24 fix render-spheres example
- wrong step size in sphere geometry boundingSphere & groupmapping
- handle empty instanceGridin renderer & renderable
2024-04-24 20:38:29 -07:00
Adam Midlik
b8551824bf Add missing await 2024-04-23 17:08:06 +01:00
Adam Midlik
8340fc0a98 MVS: fixed aggressive clipping when setting camera 2024-04-23 17:00:50 +01:00
dsehnal
10a3f92697 update gha 2024-04-22 16:10:44 +02:00
David Sehnal
da9f5927d8 Merge docs from molstar/docs (#1090)
* merge docs

* tweak actions
2024-04-22 16:00:26 +02:00
Alexander Rose
990dac6f8d handle xray-shaded in transparency check 2024-04-21 19:04:15 -07:00
Alexander Rose
1aa9c2fb22 disable emissive for transparency 2024-04-20 13:21:38 -07:00
Alexander Rose
77d5c71e61 fix bloom with transparent background 2024-04-20 13:20:13 -07:00
Adam Midlik
ae1d1a44f6 MVS: keepCamera parameter 2024-04-19 15:21:16 +01:00
Alexander Rose
904a409665 changelog 2024-04-14 16:32:53 -07:00
Alexander Rose
ab70536820 add emissive to mesoscale explorer 2024-04-14 16:16:05 -07:00
Alexander Rose
c9ef0171b4 add emissive to glb exporter 2024-04-14 16:15:57 -07:00
Alexander Rose
682b551b6e add bloom postprocessing effect 2024-04-14 16:15:38 -07:00
Alexander Rose
49cd8f7904 add emissive material support 2024-04-14 16:15:09 -07:00
Alexander Rose
a9e1373203 Merge pull request #1075 from molstar/transparency-render-refactor
refactor transparency rendering
2024-04-06 10:29:59 -07:00
Alexander Rose
368fd3a1d5 changelog 2024-04-06 10:20:48 -07:00
Alexander Rose
51ba661e54 cleanup 2024-04-06 10:20:04 -07:00
Alexander Rose
eb86b83aa5 Merge branch 'master' of https://github.com/molstar/molstar into transparency-render-refactor 2024-04-06 10:15:34 -07:00
Alexander Rose
16d5299fbd 4.1.0 2024-03-31 23:01:57 -07:00
Alexander Rose
c85aa6f979 changelog 2024-03-31 22:59:43 -07:00
Alexander Rose
dfab137696 schema updates 2024-03-31 22:59:05 -07:00
Alexander Rose
629fc65b81 package updates
- fix types
- fix webpack browserify issue
2024-03-31 22:56:54 -07:00
Alexander Rose
f06064a0c6 Merge pull request #1072 from hui2000ji/master
Reproduce pymol's surface_ramp_above_mode=1
2024-03-31 22:25:30 -07:00
Alexander Rose
fa70a0e5eb Merge branch 'master' into master 2024-03-31 22:20:44 -07:00
Alexander Rose
f1a2c5c4ee doc tweaks 2024-03-31 22:19:46 -07:00
hui2000ji
169d6323ca add Vec3.transformDirectionOffset; renam param in external-volume 2024-04-01 10:21:40 +08:00
Alexander Rose
c5b3db9960 refactor transparency rendering
- more uniform behavior for blended, wboit, dpoit
- fix issues with text & image geometry
2024-03-30 15:06:09 -07:00
Alexander Rose
fefed0a5f0 removed unused 2024-03-30 15:01:27 -07:00
Alexander Rose
d04311a989 fix type 2024-03-30 15:01:12 -07:00
Alexander Rose
0273df2c16 add rotation param to skybox 2024-03-30 08:19:16 -07:00
hui2000ji
05494953df add "normal" property to position location; add "Above Mode" to external-volume 2024-03-29 11:57:53 +08:00
midlik
d6b79de86d MVS docs reorganization (#1073) 2024-03-27 19:34:14 +01:00
hui2000ji
20327871a8 update mesh positionIt 2024-03-27 17:18:08 +08:00
Alexander Rose
dd0845038d Merge pull request #1069 from molstar/transparency-fix
Fix transparency rendering fallback
2024-03-26 22:07:18 -07:00
Alexander Rose
d5d3977506 Merge branch 'master' into transparency-fix 2024-03-26 22:07:08 -07:00
Alexander Rose
1675e18f57 Merge pull request #1070 from molstar/ssao-sampler-fix
Fix SSAO broken when `OES_texture_float_linear` is unavailable
2024-03-24 15:36:02 -07:00
Alexander Rose
d8bfe78b30 Fix SSAO broken when OES_texture_float_linear is unavailable 2024-03-24 14:56:24 -07:00
Alexander Rose
589d3465ef Merge pull request #1056 from pechersky/volume-transform
VolumeTransform to rotate a volume, like TransformStructureConformation
2024-03-24 10:14:11 -07:00
Alexander Rose
ebc63099b4 Merge branch 'master' into volume-transform 2024-03-24 10:13:57 -07:00
Alexander Rose
512a099a28 Fix transparency rendering fallback 2024-03-23 10:10:13 -07:00
midlik
d056bf3549 Fixed text rendering in headless mode (#1068)
* Fixed text rendering in headless mode

* lint
2024-03-21 06:46:46 +01:00
Alexander Rose
e2c929fa33 fix wrong width/height in InputObserver 2024-03-18 18:44:11 -07:00
David Sehnal
a619ae6687 BinaryCIF encoder fixes (#1057) 2024-03-04 17:10:02 +01:00
Yakov Pechersky
e40fc34a6f move changes to unreleased section 2024-03-04 09:07:49 -05:00
Yakov Pechersky
2734377d0a remove extra line 2024-03-01 15:51:03 -05:00
Yakov Pechersky
86575a7a15 Changelog 2024-03-01 15:50:09 -05:00
Yakov Pechersky
31227d2050 authors header 2024-03-01 15:50:03 -05:00
Yakov Pechersky
2e73a37de2 VolumeTransform to rotate a volume, like TransformStructureConformation 2024-03-01 15:27:37 -05:00
midlik
32c3ef0801 MVS: OpenApi schema in docs (#1051) 2024-02-19 18:04:06 +01:00
dsehnal
b70f2e073d 4.0.1 2024-02-19 12:56:41 +01:00
dsehnal
03b4aa1b33 changelog 2024-02-19 12:54:01 +01:00
Alexander Rose
0a4643ebe4 Revert "require WEBGL_depth_texture extension" 2024-02-17 11:26:55 -08:00
Alexander Rose
8dc3dae81e revert renderbuffer removal 2024-02-17 11:24:29 -08:00
David Sehnal
a1e2b0e5ae Bcif decoder fix (#1048)
* Fix bcif decoder

* update integerPackingSigned typing

* fix type fix
2024-02-14 18:23:22 +01:00
midlik
46af7d03bf MVSX (#1041)
* MVSX format provider

* MVS: Integration examples

* MVS: drag-and-drop support for MVSX

* MVS: support for URL param mvs-format=mvsx

* MVS: docs for MVSX

* MVS: mvs-render supports MVSX

* Update README
2024-02-14 18:22:27 +01:00
Alexander Rose
60550cfea1 4.0.0 2024-02-04 15:51:28 -08:00
Alexander Rose
5de4569ad9 changelog 2024-02-04 15:49:04 -08:00
Alexander Rose
908fb0eba9 me: fix state loading 2024-02-03 10:53:25 -08:00
Alexander Rose
e7e191a907 Merge pull request #1019 from molstar/v4-dev
V4 dev
2024-02-03 10:26:26 -08:00
Alexander Rose
de46c82c78 add mesoscale-explorer to deploy script 2024-02-03 10:17:20 -08:00
Alexander Rose
d8f3ab767e changelog 2024-02-03 10:08:46 -08:00
Alexander Rose
d34a9be20f package updates 2024-02-03 10:08:34 -08:00
Alexander Rose
78628c217f Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2024-02-03 10:06:11 -08:00
Alexander Rose
d29bf2eec2 3.45.0 2024-02-03 10:02:48 -08:00
Alexander Rose
5db60c2882 changelog 2024-02-03 10:00:17 -08:00
Alexander Rose
737846e093 schema updates 2024-02-03 09:59:52 -08:00
Alexander Rose
2ad551bdc7 package updates 2024-02-03 09:52:14 -08:00
Alexander Rose
46fa581f07 Merge pull request #1036 from russellp17/master
Move most headless context deps to optional peer dependencies and remove `@types/jpeg-js`
2024-02-03 09:43:27 -08:00
Alexander Rose
17dbe4b60e make jpeg-js a dev and optional peer dependency 2024-02-03 09:35:20 -08:00
Russell Parker
aeaf2e799a update changelog 2024-01-30 11:18:08 -05:00
Russell Parker
ef16b718c4 Move most headless context deps to optional peer deps and remove @types/jpeg-js 2024-01-30 11:17:54 -05:00
Alexander Rose
4b4f6d34a3 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2024-01-29 22:52:55 -08:00
Alexander Rose
ab4130d42d Merge pull request #1032 from molstar/interactive-snapshots
Interative labels & related changes
2024-01-29 22:52:05 -08:00
dsehnal
9e73de89fb changelog 2024-01-28 05:32:17 +01:00
dsehnal
02cec6f8e6 support multiline PD.text and use markdown to render multi-line tooltips 2024-01-28 05:26:46 +01:00
dsehnal
e97a02473f label snapshot key & tooltip support 2024-01-28 04:35:01 +01:00
Alexander Rose
827e75ce0e Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2024-01-15 09:42:36 -08:00
Alexander Rose
22e5c9d65b Merge pull request #800 from giagitom/2-colors-cylinders
Implementing 2 colors interpolation on impostor cylinders
2024-01-15 09:06:15 -08:00
Alexander Rose
10d9120d37 hide colorMode for cartoon repr 2024-01-13 11:38:45 -08:00
Alexander Rose
e6c20d35bd Merge branch 'master' into 2-colors-cylinders 2024-01-13 10:19:54 -08:00
Alexander Rose
27bf66038d location-iterator tweaks
- consolidate BondIterator.fromGroup/.fromStructure
- use options argument in PolymerLocationIterator.fromGroup
- remove 'any' type
2024-01-13 10:16:28 -08:00
Alexander Rose
3ce6d89521 color-mode docs 2024-01-13 10:14:06 -08:00
Alexander Rose
24608ac355 stricter param types 2024-01-13 10:13:11 -08:00
Alexander Rose
da034d9502 move cylinder color mixing to vertex shader 2024-01-13 10:11:13 -08:00
Alexander Rose
581673fb9b Merge pull request #1022 from midlik/is-mvs-model-prop
check applicability of mvs repr/color 2
2024-01-10 22:11:37 -08:00
Adam Midlik
29cf97e6cf Revert package-lock.json 2024-01-10 11:04:07 +00:00
Adam Midlik
f65773d654 MVS extension: MolViewSpec components are applicable only when the model has been loaded from MolViewSpec 2024-01-09 11:50:57 +00:00
giagitom
d11c8c166a Fix 2024-01-07 19:55:06 +01:00
giagitom
ae6bd743a8 Fix nucleotide atomic bonds 2024-01-07 19:34:09 +01:00
giagitom
c1654574d0 Merge branch 'master' into 2-colors-cylinders 2024-01-07 19:09:36 +01:00
giagitom
6f506351cd Merge branch 'master' of https://github.com/molstar/molstar 2024-01-07 19:06:01 +01:00
giagitom
db83b97ff9 Use only when necessary 2024-01-07 18:41:06 +01:00
Alexander Rose
5c818b35ad remove rcsb prefix 2024-01-06 17:24:01 -08:00
Alexander Rose
b1ce20f5f5 4.0.0-beta.0 2024-01-06 10:27:59 -08:00
Alexander Rose
d1cbebf8a7 changelog & readme 2024-01-06 10:25:29 -08:00
Alexander Rose
c771cfef99 Merge pull request #1017 from molstar/mesoscale-explorer
Mesoscale explorer
2024-01-06 10:18:41 -08:00
Alexander Rose
6ee72d5e8c changelog 2024-01-06 10:12:23 -08:00
Alexander Rose
b859b3c597 fix merge issues 2024-01-06 10:07:45 -08:00
Alexander Rose
8281909620 Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2024-01-06 09:54:20 -08:00
Alexander Rose
f3c30ae4b3 fix type 2024-01-06 09:44:29 -08:00
Alexander Rose
9ad53eb0d5 set minimal node.js version to 18 2024-01-06 09:33:27 -08:00
Alexander Rose
a15e9158b4 Merge pull request #1013 from molstar/assembly-symmetry
Generalize rcsb/assembly-symmetry/ extension
2024-01-06 09:28:22 -08:00
Alexander Rose
6bfedc038e Merge branch 'v4-dev' of https://github.com/molstar/molstar into assembly-symmetry 2024-01-06 09:28:07 -08:00
Alexander Rose
966293994f Merge branch 'v4-dev' of https://github.com/molstar/molstar into v4-dev 2024-01-06 09:26:22 -08:00
Alexander Rose
09f4c857de Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2024-01-06 09:25:46 -08:00
Alexander Rose
e05bd5f0c5 3.44.0 2024-01-06 09:01:15 -08:00
Alexander Rose
a3cdc2844e changelog 2024-01-06 08:58:31 -08:00
Alexander Rose
a51947637c package updates 2024-01-06 08:58:15 -08:00
David Sehnal
72ee428f51 Update createPluginUI (#1014)
* update createPluginUI

* fix example
2024-01-06 14:34:27 +01:00
Alexander Rose
4fe203d3ea Merge pull request #1015 from molstar/webgl-depth-rt
Require `WEBGL_depth_texture` webgl extension
2024-01-03 22:22:14 -08:00
Alexander Rose
2ec32641ee remove renderbuffer use 2024-01-03 22:02:52 -08:00
Alexander Rose
8d5198f15c require WEBGL_depth_texture extension 2024-01-03 18:26:24 -08:00
Alexander Rose
d5154c7391 Merge branch 'v4-dev' of https://github.com/molstar/molstar into assembly-symmetry 2024-01-02 15:19:31 -08:00
Alexander Rose
6ee750e6bd Merge pull request #825 from molstar/immer-es6
Immer, es6 & beyond
2024-01-02 15:15:55 -08:00
Alexander Rose
ea8aa10704 Merge branch 'v4-dev' of https://github.com/molstar/molstar into immer-es6 2024-01-02 15:07:56 -08:00
Alexander Rose
19ba76a1f1 Generalize rcsb/assembly-symmetry/ extension
- Move to assembly-symmetry/
- Remove RCSB specific dependencies and prefixes
2024-01-02 14:04:56 -08:00
Alexander Rose
fc28046df4 cleanup 2024-01-02 12:55:44 -08:00
Alexander Rose
20f0416a8c Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2024-01-02 12:52:47 -08:00
Alexander Rose
1298baf60d typo 2024-01-02 12:41:55 -08:00
Alexander Rose
999b86ab81 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2024-01-02 12:41:29 -08:00
Alexander Rose
75f2acd8eb Merge pull request #1006 from molstar/lod-cull-hiz
culling & lod support
2024-01-02 12:40:36 -08:00
Alexander Rose
1541ba10f1 tweaks 2024-01-02 12:40:15 -08:00
Christian Domínguez
00ca25ffd7 Fixed drag and drop overlay on WebKit and Safari (#1011)
* Fixed drag and drop overlay on webkit/safari. Closes #1010

* Use dataTransfer.types when dataTransfer.items is not available/empty

* Updated package.json and header for contribution
2024-01-02 21:03:54 +01:00
giagitom
302e1c659f Merge branch 'master' into 2-colors-cylinders 2023-12-26 16:43:09 +01:00
giagitom
8b4d987f94 Merge branch 'master' of https://github.com/molstar/molstar 2023-12-26 16:38:35 +01:00
Alexander Rose
c383012fd0 add stochstic/dithered transparency to fade LODs in and out 2023-12-25 12:24:29 -08:00
Alexander Rose
66b6ddc527 Merge branch 'v4-dev' of https://github.com/molstar/molstar into lod-cull-hiz 2023-12-25 12:16:17 -08:00
Alexander Rose
15d60c51a9 fix ArrayMapping calls 2023-12-25 12:16:00 -08:00
Alexander Rose
fe82cd4f2c Merge branch 'v4-dev' of https://github.com/molstar/molstar into lod-cull-hiz 2023-12-25 12:08:13 -08:00
Alexander Rose
b3e792cbc3 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-12-25 12:07:46 -08:00
Alexander Rose
2f0230dc84 avoid showing (and calculating) inter-unit bonds for huge structures 2023-12-25 12:03:14 -08:00
Alexander Rose
45522ad410 add LightbulbOnOutline and Serach icons 2023-12-25 11:54:00 -08:00
giagitom
3fe80fe61a Merge branch 'master' of https://github.com/molstar/molstar 2023-12-22 00:24:16 +01:00
Gianluca Tomasello
ede1a8da07 Cartoon nucleic with sugar visual (#727)
* add handlers to MeshBuilder

* Add ring fill visual

* Add nucleotide ring bond visual

* Add nucleotide ring element visual

* Update cartoon representation

* Fix imports

* Smooth normals

* Lint fix

* Update headers and Changelog

* Fix sugar ring mid point

* rename ring -> atomic

* refactor shared nucleotide helpers

* thicknessFactor for nucleic ring/block/fill visuals

* changelog

---------

Co-authored-by: Alexander Rose <alexander.rose@weirdbyte.de>
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-12-21 12:02:33 +01:00
Yakov Pechersky
0199afd5f3 Expose explicit bond orders from struct_conn in mmcif (#999)
* Expose explicit bond orders from struct_conn in mmcif

StructConn was referencing the wrong column name, it was using auth_seq_id instead of label_seq_id
The latter is mandatory by https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Categories/struct_conn.html
This was causing no matches found during `getEntriesFromStructConn`
for building the bond lookup.

* update CHANGELOG and file headers

* Prefer auth_seq_id, fallback to label_seq_id

* case on presence instead of

* clarify changes in CHANGELOG

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-12-21 11:59:26 +01:00
midlik
f8bda3617f Mvs extension - yet another pull request (#1002)
* MVS extension: support all X11 colors

* MVS extension: nicer validation messages for literal types

* MVS extension: no need to call HexColor in builder

* MVS extension: Support relative URIs

* MVS extension: docs

* MVS extension: docs - fix markdown

* MVS extension: docs

* MVS extension: docs for selectors

* MVS extension: docs for selectors

* Support for label rendering in HeadlessPluginContext

* MVS extension: CLI utils

* MVS extension: nicer component node labels

* MVS extension: labels applied in one node

* MVS extension: labels applied in one node - fixed label colors

* MVS extensions: removed unused params from "Custom Label"

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-12-21 11:58:10 +01:00
Sebastian Bittrich
bffd7d75e0 ModelServer SDF/MOL2 ligand export: fix atom indices for atoms not present in the CCD (#1007)
* ModelServer: fix atom indices upon additional hydrogen atoms

* cl

* ignore all non-CCD atoms
2023-12-21 11:54:54 +01:00
Alexander Rose
e1315b6642 culling & lod support
- Add culling support
    - Cull per-object and per-instance
    - Cull based on frustum and camera distance
- Add LOD support
    - Visibility based on camera distance
    - Special mode for spheres with automatic LOD levels
- Add occlusion culling (only WebGL2)
    - Hi-Z pass
    - Cull based on previous frame's Hi-Z buffer
2023-12-17 17:37:04 -08:00
Alexander Rose
205413e696 Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2023-12-17 17:03:15 -08:00
Alexander Rose
2c0a486531 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-12-17 16:51:31 -08:00
Alexander Rose
90a4e019ac remove offsetZ default from measurement label 2023-12-17 12:24:08 -08:00
Alexander Rose
640426ae16 me: wip, improve selection handling 2023-12-10 21:57:35 -08:00
Alexander Rose
d1e620eed1 me: support exact filter matches 2023-12-10 21:56:29 -08:00
Alexander Rose
1a2bad7c77 me: add animation export ui 2023-12-10 21:55:36 -08:00
Alexander Rose
b6e4d7721e Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2023-12-09 10:23:48 -08:00
Alexander Rose
e5902d15e2 Merge branch 'v4-dev' of https://github.com/molstar/molstar into v4-dev 2023-12-09 10:22:38 -08:00
Alexander Rose
4e2b7b5ffc Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-12-09 10:21:54 -08:00
Alexander Rose
bcbab9cb9d Merge pull request #21 from arose/manifest
Manifest
2023-12-09 10:21:02 -08:00
Alexander Rose
9a4b0116eb me: add selection-info panel 2023-12-09 10:20:02 -08:00
Alexander Rose
60d0de8d88 add search icon 2023-12-09 10:19:24 -08:00
Alexander Rose
6a520d2877 me: occlusion/culling tweaks 2023-12-09 10:18:55 -08:00
dsehnal
6edbae80db Fix changelog date 2023-12-04 16:30:41 +01:00
dsehnal
aac0abed32 3.43.1 2023-12-04 16:28:02 +01:00
dsehnal
6805dd7947 Fix react-markdown dependency 2023-12-04 16:25:23 +01:00
Alexander Rose
6c9254f2b6 3.43.0 2023-12-02 13:25:52 -08:00
Alexander Rose
897d443873 changelog 2023-12-02 13:23:17 -08:00
Alexander Rose
f276ea2258 schema updates 2023-12-02 13:22:26 -08:00
Alexander Rose
58d735996e type fix 2023-12-02 13:21:47 -08:00
Alexander Rose
72b66367f3 package updates 2023-12-02 13:21:35 -08:00
midlik
c592a3b93d MVS extension - additional work (#991)
* MVS extension: deterministic transform refs, updated metadata structure

* Perf-test for `sortIfNeeded`

* MVS extension: README

* MVS extension: show loading errors in the Mol* console

* MVS extension: auto-fix rotation matrix imprecisions

* MVS extension: data format provider

* MVS extension: Updated README

* MVS extension: rename deletePrevious -> replaceExisting, default to false in "Load MVS Data" to allow loading multiple files

* Perf-test for sortIfNeeded uses Benchmark.js
2023-11-29 17:21:02 +01:00
giagitom
3e6d0c8c62 Merge branch 'master' of https://github.com/molstar/molstar 2023-11-26 21:38:09 +01:00
Alexander Rose
60ed853c02 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into manifest 2023-11-26 09:57:21 -08:00
Alexander Rose
ba58b8e559 Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2023-11-26 09:56:50 -08:00
Alexander Rose
2c3d122820 Merge pull request #992 from molstar/canvas3dcontext-runtime-props
add Canvas3DContext runtime props
2023-11-26 09:51:16 -08:00
Alexander Rose
47f4b3a051 Merge branch 'v4-dev' into canvas3dcontext-runtime-props 2023-11-26 09:45:59 -08:00
Alexander Rose
daed91e1ea simplify TransparencyMode to type 2023-11-26 09:43:19 -08:00
Alexander Rose
3d0b9c98e4 change default compile target to es2018 2023-11-25 22:28:15 -08:00
Alexander Rose
966e8e764f add Canvas3DContext runtime props
- pixelScale, pickScale, transparency (blended, wboit, dpoit)
- replacing instantiation-time attribs
2023-11-25 22:09:40 -08:00
Alexander Rose
14441a4ee3 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-11-25 17:07:10 -08:00
Alexander Rose
e773824fb5 improve disposal to aid GC 2023-11-25 17:06:53 -08:00
Alexander Rose
cc6a990b85 me: improve asset & app disposal 2023-11-25 16:55:05 -08:00
Alexander Rose
ffa7d66c66 improve disposal to aid GC 2023-11-25 16:25:35 -08:00
Alexander Rose
abc29ceefb Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into manifest 2023-11-25 10:11:27 -08:00
Alexander Rose
e2f137a495 Merge branch 'v4-dev' of https://github.com/molstar/molstar into mesoscale-explorer 2023-11-25 10:11:00 -08:00
Alexander Rose
ebbe78fb1d Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-11-25 10:07:41 -08:00
Alexander Rose
5d139b6db8 optimize LociSelectManager.selectOnly
- avoid superfluous loci set operations
2023-11-25 10:07:00 -08:00
Alexander Rose
8d5aad2be1 Merge pull request #986 from molstar/symop-memop
reduce memory usage of SymmetryOperator.ArrayMapping
2023-11-25 10:01:23 -08:00
Alexander Rose
e8601d3f5e Merge branch 'symop-memop' of https://github.com/molstar/molstar into symop-memop 2023-11-25 09:49:29 -08:00
Alexander Rose
c63622677a more ArrayMapping improvements
- add identity specialization
- reuse x/y/z methods
2023-11-25 09:49:26 -08:00
Alexander Rose
163cee6d66 me: move instance transforms out of params 2023-11-25 09:18:30 -08:00
Alexander Rose
cd1d2010da me: dispose zip file asset after loading 2023-11-25 09:16:53 -08:00
Alexander Rose
8f0ab2fdf9 me: add transformer update methods 2023-11-25 09:14:24 -08:00
Alexander Rose
7dbc8ab4f1 optimize LociSelectManager.selectOnly 2023-11-24 23:23:56 -08:00
Alexander Rose
6a730a6ce7 Merge branch 'v4-dev' into symop-memop 2023-11-24 18:27:55 -08:00
Alexander Rose
ca606284b3 Merge branch 'master' of https://github.com/molstar/molstar into v4-dev 2023-11-24 18:18:13 -08:00
Alexander Rose
396c530e13 tweak array mapping & add perf test 2023-11-24 18:00:30 -08:00
Alexander Rose
4cc3072165 Merge branch 'master' of https://github.com/molstar/molstar into symop-memop 2023-11-24 15:50:12 -08:00
Alexander Rose
4598841ddc add transforms & label params to ShapeFromPly 2023-11-24 15:41:38 -08:00
Alexander Rose
728414366d fix tryGetCellData data check 2023-11-24 15:40:46 -08:00
Alexander Rose
1b7b38b47e fix bump scaling with ignoreLight enabled 2023-11-24 15:39:24 -08:00
Alexander Rose
dd15b1ed29 me: expose pattern/bump params for shapes 2023-11-24 15:37:06 -08:00
Alexander Rose
446ea9173b fix bump scaling with ignoreLight enabled 2023-11-24 14:53:30 -08:00
Alexander Rose
70f8515e51 me: add support for entities from ply files 2023-11-24 13:44:12 -08:00
Alexander Rose
90fac967f2 add transforms & label params to ShapeFromPly 2023-11-24 13:42:33 -08:00
Alexander Rose
1796dfd73a me: guard against no assemblies 2023-11-24 13:24:58 -08:00
Alexander Rose
a73cb1648d me: fix state loading 2023-11-24 13:22:24 -08:00
Alexander Rose
b715205a04 fix tryGetCellData 2023-11-24 13:08:09 -08:00
Yakov Pechersky
ef17cb2cca Custom sequence viewer as a plugin spec (#988)
Factored out of #936

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-11-24 14:39:22 +01:00
midlik
b7b52f5c7d MVS extension (#976)
* Moved MVS extension from mol-view-spec repo

* Viewer supports URL params mvs-url, mvs-data, mvs-format

* Tests

* MVS sanity checks

* MVS extension: drag-and-drop support

* mvs-render try1

* Example CLI utility mvs-render

* Example CLI utility mvs-validate

* MVS extension: renaming

* MVS extension: fixed FOV in mvs-render

* Moved stuff to mol-util/array.ts

* Moved stuff to mol-util/object.ts

* MVS extension: renamed `additions` to `components`

* MVS extension: trying plugin.managers.camera.focusSphere

* MVS extension: refactor focus

* MVS extension: fixed label color once again

* MVS extension: camera position adjustment (compensate FOV differences)

* Fixed formula for camera focus in orthographic mode

* Moved Choice to mol-util/param-choice.ts

* Moved stuff to mol-util/json.ts

* Object.hasOwn polyfill

* MVS extension: small refactor

* Fixed bug in hashString
2023-11-24 14:38:08 +01:00
David Sehnal
79ed8e7de4 Snapshot improvements (#977)
* Snapshot improvements

* improve key UX

* markdown descriptions

* tweak button

* drag overlay fix

* package lock
2023-11-20 12:01:19 +01:00
Alexander Rose
60a2eb8a22 me: add app.loadUrl 2023-11-19 23:30:41 -08:00
Alexander Rose
b833d41c1e Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into manifest 2023-11-19 18:02:12 -08:00
Alexander Rose
85d2ed0132 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-11-19 18:01:34 -08:00
Alexander Rose
2552a5218f fix seconday-structure.ts file name 2023-11-19 17:29:19 -08:00
Alexander Rose
c4a4562d82 package updates 2023-11-19 17:24:37 -08:00
Alexander Rose
a3b9d30c7c target ES2018 2023-11-19 17:19:26 -08:00
Alexander Rose
a3572961ac Merge branch 'master' of https://github.com/molstar/molstar into immer-es6 2023-11-19 17:11:39 -08:00
Alexander Rose
3118a46250 reduce memory usage of SymmetryOperator.ArrayMapping 2023-11-19 17:01:50 -08:00
Alexander Rose
d238b8aee9 Merge branch 'master' of https://github.com/molstar/molstar 2023-11-19 16:38:05 -08:00
Alexander Rose
22a57d8f48 add structure-element-sphere visual to spacefill repr 2023-11-19 16:37:26 -08:00
Alexander Rose
119e8f63eb Fix missing await in HeadlessPluginContext.saveStateSnapshot 2023-11-19 15:27:04 -08:00
Alexander Rose
e6a4122d1c add no-constant-binary-expression to eslint 2023-11-18 13:30:42 -08:00
Alexander Rose
9ba5f1f540 tweak distinctColors 2023-11-18 13:26:08 -08:00
Alexander Rose
0a0ac7ee63 guard against empty cif files 2023-11-18 13:25:57 -08:00
Alexander Rose
7670df04ae use isTimingMode for UserTiming 2023-11-18 13:24:58 -08:00
Alexander Rose
98744af872 fix for compiling with es6+ 2023-11-18 13:24:46 -08:00
Alexander Rose
f4eb509887 only change camera.target for flyMode and pointerLock 2023-11-18 13:24:21 -08:00
Alexander Rose
cbb8c0536d me: wip, trajectory support 2023-11-16 23:17:44 -08:00
Alexander Rose
d7d798746c me: wip, trajectory support 2023-11-16 23:17:13 -08:00
Alexander Rose
c39d092fc1 me: no clustering step for distinctColors 2023-11-16 23:15:31 -08:00
Alexander Rose
102b69961c tweak distinctColors 2023-11-16 23:14:53 -08:00
Alexander Rose
681d64dcd9 me: flexible binary transform in generic loader 2023-11-15 22:00:57 -08:00
Alexander Rose
2083407a84 me: fix bcif loading 2023-11-15 21:30:55 -08:00
Alexander Rose
a07f90a405 me: cache some state selections 2023-11-15 21:30:23 -08:00
Alexander Rose
c7ca528778 guard against empty cif files 2023-11-15 21:28:20 -08:00
Alexander Rose
ca36264cf8 use isTimingMode for UserTiming 2023-11-15 21:27:55 -08:00
Alexander Rose
7e5b181d92 fix for compiling with es6+ 2023-11-15 21:25:27 -08:00
Alexander Rose
c538e1d0c8 wip, support binary transforms 2023-11-08 22:30:15 -08:00
Alexander Rose
75e23d73b0 me: fix MesoscaleExplorerState handling 2023-11-07 21:55:55 -08:00
Alexander Rose
39f077b066 me: add drag-and-drop support 2023-11-07 21:04:19 -08:00
Alexander Rose
78874c0024 fix return type of State.tryGetCellData 2023-11-07 20:41:10 -08:00
Alexander Rose
7069760d07 me: improve generic loader (with @corredD)
- support assemblies
- support quaternions and transformation matrices
2023-11-07 20:34:47 -08:00
Alexander Rose
df0af2b1ca fix return type of State.tryGetCellData 2023-11-07 20:32:18 -08:00
Alexander Rose
edd6419b2b me: fix MesoscaleExplorerState handling 2023-11-07 20:30:30 -08:00
giagitom
c6210ae1a0 Merge branch 'master' of https://github.com/molstar/molstar 2023-11-06 07:36:00 +01:00
Alexander Rose
446455494e Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-11-05 20:04:03 -08:00
Alexander Rose
c4bc16fe5d 3.42.0 2023-11-05 20:00:47 -08:00
Alexander Rose
988cee0047 changelog 2023-11-05 19:56:47 -08:00
Alexander Rose
39fa185f3d me: use clipPrimitive 2023-11-05 17:02:11 -08:00
Alexander Rose
cb0484bca1 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-11-05 17:00:35 -08:00
Alexander Rose
bf0707a2aa schema updates 2023-11-05 13:25:57 -08:00
Alexander Rose
9a2191e1cc package updates 2023-11-05 13:25:43 -08:00
Alexander Rose
36ead9dda3 Merge pull request #966 from molstar/clip-primitive
add clipPrimitive option to spheres geometry
2023-11-05 11:51:16 -08:00
Alexander Rose
71e1bb849e Merge branch 'master' into clip-primitive 2023-11-05 11:51:05 -08:00
David Sehnal
975cceed77 Add DragAndDropManager (#968)
* Add PluginContext.customDragAndDropHandlers

* refactor to manager
2023-11-05 14:46:51 +01:00
Alexander Rose
82065dc5b7 typo 2023-11-04 19:24:05 -07:00
Alexander Rose
39ae03ff8c skip empty multiDrawBase data items 2023-11-04 19:22:32 -07:00
Alexander Rose
45ab88f0a1 fix batched camera distance culling 2023-11-04 19:21:14 -07:00
Alexander Rose
f0d649f265 Merge pull request #972 from JonStargaryen/condensed
Add `options` support for default bond labels
2023-11-04 15:06:11 -07:00
Sebastian Bittrich
44ce5df136 cl 2023-11-03 16:01:34 -07:00
Sebastian Bittrich
b00bce69fd make bond labels honor options 2023-11-03 16:00:03 -07:00
Alexander Rose
e2e9e5f6fc add clipPrimitive option to spheres geometry
- clip whole spheres instead of cutting them
2023-10-28 22:59:18 -07:00
giagitom
36cf2853b2 Merge branch 'master' of https://github.com/molstar/molstar 2023-10-22 15:15:38 +02:00
Alexander Rose
efc322a375 lod params tweaks 2023-10-21 23:46:23 -07:00
Alexander Rose
7e792a4f90 add model info, ui tweaks 2023-10-21 16:33:54 -07:00
Alexander Rose
44b3a9b121 more coloring improvements and fixes 2023-10-21 14:09:25 -07:00
Alexander Rose
55f72e65dc Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-10-21 13:49:21 -07:00
Alexander Rose
745746f243 handle altId & insCode for bonds from PDB files 2023-10-21 13:40:37 -07:00
Alexander Rose
b5f229ba6d improve distinctColors function
- Add `sort` and `sampleCountFactor` parameters
- Fix clustering issues
2023-10-21 12:50:03 -07:00
Alexander Rose
d5a47e617a fix de-/saturate of colors with no hue 2023-10-21 12:27:58 -07:00
Alexander Rose
a200ca5b21 Merge pull request #946 from molstar/fix-pdb-insCode-labelSeq
fix handling of pdb files with insertion codes
2023-10-21 12:11:59 -07:00
Alexander Rose
65b52c8ecd Merge branch 'master' into fix-pdb-insCode-labelSeq 2023-10-21 12:11:39 -07:00
Alexander Rose
203fb2f7fe missing prop 2023-10-15 15:47:32 -07:00
Alexander Rose
492494033f type fixes 2023-10-15 15:45:14 -07:00
Alexander Rose
9de6d86a0f typo 2023-10-15 15:40:02 -07:00
Alexander Rose
23fdbdea54 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-10-15 15:30:42 -07:00
Alexander Rose
8fa9c19346 add ui for loading entries from pdb & pdb-dev 2023-10-15 15:29:16 -07:00
Alexander Rose
ab10007d60 fix hiz error with zero size viewport 2023-10-15 15:28:19 -07:00
Alexander Rose
7a6094298b typo 2023-10-15 14:13:58 -07:00
dsehnal
ab34a59677 3.41.0 2023-10-15 13:23:58 +02:00
dsehnal
7a96cdd52d changelog 2023-10-15 13:20:01 +02:00
midlik
65cad5ea4d Assembly Symmetry extension customization (#950)
* Show assembly symmetry from PDBe API (quick and dirty)

* Treat 404 from PDBe API as success

* RCSBAssemblySymmetry extension: make defaults configurable via plugin config items

* RCSBAssemblySymmetry: revert configs to default values

* RCSBAssemblySymmetry: correctly handle non-assembly structure with PDBe API
2023-10-15 13:05:50 +02:00
Alexander Rose
fe433fc7b0 load example, pdb, pdbdev via get parameter 2023-10-14 21:53:12 -07:00
Alexander Rose
ba173978d3 treat water as separate type 2023-10-14 21:49:51 -07:00
Alexander Rose
b3aed2ead7 fix clipping for merged mmcif structures 2023-10-14 21:49:11 -07:00
Alexander Rose
c57774a62e coloring improvements & tweaks 2023-10-14 21:48:16 -07:00
Alexander Rose
199b767bbd ignore shift for highlight with pointer lock 2023-10-14 21:43:14 -07:00
Alexander Rose
0c3131ff56 add ultra graphics mode 2023-10-14 21:42:11 -07:00
Alexander Rose
7433fe07f1 type fixes 2023-10-14 21:39:34 -07:00
Alexander Rose
a765ba8e3b Merge pull request #949 from JonStargaryen/master
Fix layout typo
2023-10-10 21:49:30 -07:00
Sebastian Bittrich
8594ce80a9 cl 2023-10-10 10:04:23 -07:00
Sebastian Bittrich
915797c4a4 fix layout typo 2023-10-10 09:49:24 -07:00
giagitom
70ebdc6b80 Merge branch 'fix-pdb-insCode-labelSeq' of https://github.com/molstar/molstar 2023-10-09 11:37:28 +02:00
Alexander Rose
44c69f538b fix partial polymer trace sec-struc type 2023-10-08 22:06:35 -07:00
Alexander Rose
b53a52b04d fix handling of pdb files with insertion codes 2023-10-07 21:48:17 -07:00
Alexander Rose
e4396039fd SetUtils performance tweaks 2023-10-07 13:44:02 -07:00
Alexander Rose
296b6902b1 Improve SetUtils performance
- use ES6 features
- add setutils perf test
2023-10-07 13:42:23 -07:00
Alexander Rose
0795f06f28 Merge branch 'master' of https://github.com/molstar/molstar into immer-es6 2023-10-07 11:12:46 -07:00
Alexander Rose
a01f159889 add transparency to advanced simple-settings 2023-10-07 11:01:56 -07:00
Alexander Rose
4ea2eadb78 reorder bottom instance grid for performance 2023-10-07 11:01:29 -07:00
David Sehnal
e548a3ed85 add PluginContext.initialized promise (#935) 2023-10-02 19:46:02 +02:00
Alexander Rose
0e326bd4de Merge pull request #20 from arose/upscaling
[WIP] added various props
2023-09-30 13:19:48 -07:00
Alexander Rose
c1de7df9fb tweak graphics mode 2023-09-30 13:18:49 -07:00
Alexander Rose
3addc567a9 changelog 2023-09-30 12:10:15 -07:00
Alexander Rose
4d2d127dcc Merge branch 'master' of https://github.com/molstar/molstar into upscaling 2023-09-30 12:09:51 -07:00
Alexander Rose
fc44e66b26 3.40.1 2023-09-30 10:53:23 -07:00
Alexander Rose
98f3f5a23b changelog 2023-09-30 10:50:23 -07:00
Alexander Rose
f2f10d0cb5 3.40.0 2023-09-30 10:47:30 -07:00
Alexander Rose
aed1056d6c Merge pull request #932 from molstar/sharpening
Sharpening
2023-09-30 10:42:59 -07:00
Alexander Rose
be47ac09c9 schema updates 2023-09-30 10:37:27 -07:00
Alexander Rose
d5e7797a40 package updates 2023-09-30 10:33:44 -07:00
Alexander Rose
0aeac628c7 Merge pull request #929 from molstar/better-bounding-spheres
fix bounding sphere calculations for "element-like" visuals
2023-09-30 10:21:03 -07:00
Alexander Rose
668d617cd7 Merge branch 'master' into better-bounding-spheres 2023-09-30 10:20:46 -07:00
Alexander Rose
62ed993f0d changelog 2023-09-30 10:19:23 -07:00
Alexander Rose
aa0a008a41 gracefully handle missing HTMLImageElement 2023-09-30 10:02:12 -07:00
Alexander Rose
89f01f202d add sharpening postprocessing pass 2023-09-30 09:39:15 -07:00
Alexander Rose
733190f7a0 scale outline by pixelRatio 2023-09-30 09:38:44 -07:00
Alexander Rose
50429aacfa fix setSize not always applied to passes 2023-09-30 09:37:58 -07:00
David Sehnal
fa541bdbd3 hide right panel (#922) 2023-09-29 14:51:48 +02:00
Sebastian Bittrich
77d173afed Update RCSB PDB validation report URL (#930)
* update RCSB PDB valrep URL

* cl

* https & more tweaks
2023-09-29 14:51:07 +02:00
Alexander Rose
1415a21c09 fix spec 2023-09-28 22:17:04 -07:00
Alexander Rose
dd2593475a refactor transparency graphics variant handling 2023-09-28 21:55:28 -07:00
dsehnal
a934001ae8 fix bounding sphere calculations 2023-09-28 18:18:48 +02:00
midlik
e5d4606437 Add blockIndex parameter to TrajectoryFromMmCif (#928) 2023-09-28 16:45:19 +02:00
Alexander Rose
350dddd83a wip, add canvas3dcontext props
- transparency (replacing enableWboit/enableDpoit)
- add canvas3dcontext to snapshot
2023-09-27 22:19:36 -07:00
Alexander Rose
7566dd4e9a wip, add canvas3dcontext props
- pixelScale
- pickScale
- move pickPadding to canvas3d props
2023-09-26 21:48:54 -07:00
Alexander Rose
cb04c74c60 wip, support changing pixel-scale 2023-09-24 22:02:45 -07:00
Alexander Rose
ad937f8fe5 make hi-Z min-level a parameter 2023-09-24 22:02:00 -07:00
Alexander Rose
66017cf166 top/bottom level instance-grid 2023-09-24 22:01:19 -07:00
Alexander Rose
898f0d6462 add sharpening postprocessing 2023-09-16 22:15:37 -07:00
Alexander Rose
cf90418f89 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-09-16 22:06:30 -07:00
Alexander Rose
fb16cd0070 typo 2023-09-16 22:06:08 -07:00
Alexander Rose
5ca126be94 also call hiZ.render with multiSample enabled 2023-09-16 22:02:48 -07:00
Alexander Rose
7a8de81e6f me: improve lod transparency with alphaThickness 2023-09-16 22:01:23 -07:00
Alexander Rose
143760f7db Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-09-16 21:50:17 -07:00
Alexander Rose
c427549b8d add support for webgl extensions
- EXT_conservative_depth
- WEBGL_stencil_texturing
- EXT_clip_control
2023-09-16 21:47:08 -07:00
Alexander Rose
310300bde8 add alphaThickness parameter for spheres 2023-09-16 12:13:34 -07:00
Alexander Rose
11604b9e8f add MultiSampleParams.reduceFlicker 2023-09-16 12:08:38 -07:00
Alexander Rose
973b326157 hi-z: support non-canvas viewports 2023-09-10 14:35:26 -07:00
Alexander Rose
c37c63d990 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-09-09 23:28:46 -07:00
Alexander Rose
cc1bf482f2 add support for WEBGL_clip_cull_distance 2023-09-09 12:27:22 -07:00
Alexander Rose
61a351b3d4 Merge pull request #906 from JonStargaryen/atomcount
ModelServer ligand queries: fix atom count reported by SDF/MOL/MOL2 export
2023-09-09 10:58:06 -07:00
Alexander Rose
9e91a242bf Merge branch 'master' into atomcount 2023-09-09 10:57:53 -07:00
Alexander Rose
c3daa1a162 Merge pull request #907 from JonStargaryen/ccd-aromatic
CCD extension: Make visuals for aromatic bonds configurable
2023-09-09 10:56:35 -07:00
Alexander Rose
fe086fb62e Merge branch 'master' into ccd-aromatic 2023-09-09 10:56:23 -07:00
Alexander Rose
c2217829a3 improve Canvas3DContext types 2023-09-09 10:54:14 -07:00
Alexander Rose
f30686917f hi-z improvements
- support orthographic camera
- check near plane
- math optimizations
- debug support
- disable for non-canvas viewports
- support pixelScale
2023-09-09 10:51:37 -07:00
Alexander Rose
7b18545e1d improve Canvas3DContext types 2023-09-09 10:46:45 -07:00
David Sehnal
6333c8073f Add optional CifFile to MmcifFormat.data (#912)
* Add optional CifFile to MmcifFormat.data

* fix
2023-09-08 19:24:18 +02:00
Sebastian Bittrich
2801bcf111 CCD extension: Make visuals for aromatic bonds configurable 2023-09-06 15:20:45 -07:00
Sebastian Bittrich
8a2461e157 global cl 2023-09-05 14:09:21 -07:00
Sebastian Bittrich
0a081e2a8a ModelServer version 2023-09-05 14:07:19 -07:00
Sebastian Bittrich
700a3fe95c ligand queries: fix atom count reported by SDF/MOL/MOL2 export 2023-09-05 14:06:07 -07:00
dsehnal
febc634d8b fix changelog 2023-09-05 18:49:52 +02:00
David Sehnal
0105f75bb6 InputObserver tap => click (#901) 2023-09-05 18:47:52 +02:00
David Sehnal
4cc2073eaa fix updateFocusRepr (#903) 2023-09-05 06:01:47 +02:00
Alexander Rose
b657fa15f5 add stats.culled 2023-09-04 20:46:12 -07:00
Alexander Rose
72446d06ed disable hi-Z for orthogrpahic camera 2023-09-02 20:56:02 -07:00
Alexander Rose
dd7499b7f6 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-09-02 12:19:31 -07:00
Alexander Rose
9ac204cb6e 3.39.0 2023-09-02 12:16:11 -07:00
Alexander Rose
73378bbe9d schema updates 2023-09-02 12:08:52 -07:00
Alexander Rose
9b5fd2595c package updates 2023-09-02 12:06:21 -07:00
Alexander Rose
bca2073ed0 changelog 2023-09-02 11:34:26 -07:00
Alexander Rose
f264e4d6b8 webgl tweaks
- export getBuffer
- add glEnumToString helper
2023-09-02 11:30:09 -07:00
Alexander Rose
c86c00c958 hi-z improvements
- clear hi-z buffer on scene & size changes
- check red/float reading support
- add max frame lag
- mark  hi-z buffer as ready for use
2023-09-02 11:27:49 -07:00
Alexander Rose
bbce807d5e webgl tweaks
- export getBuffer
- add glEnumToString helper
2023-09-02 11:11:05 -07:00
Sebastian Bittrich
795222b5b4 Allow toggling of hydrogens as part of LabelTextVisual (#900)
* Allow toggling of hydrogens as part of `LabelTextVisual`

* fix typo
2023-08-30 10:51:51 +02:00
Alexander Rose
25eb4450ad support iv2/3/4 uniforms 2023-08-27 12:08:57 -07:00
Alexander Rose
140df13dae improve texture print helper 2023-08-27 12:08:39 -07:00
Alexander Rose
8b132d599e add hi-z occlusion culling 2023-08-27 12:04:48 -07:00
Alexander Rose
cbaf5129f9 tweak graphics mode props 2023-08-27 11:45:37 -07:00
Alexander Rose
117e2b2a1a improve texture print helper 2023-08-27 09:56:04 -07:00
Alexander Rose
301b9287ea improve MultiDrawBaseData setup/update 2023-08-27 09:52:37 -07:00
Alexander Rose
81a738c6a6 support iv2/3/4 uniforms 2023-08-27 09:50:26 -07:00
Alexander Rose
f4d15a5a31 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-08-27 09:43:21 -07:00
Alexander Rose
792cd513a8 faster bounding rectangle for imposter spheres 2023-08-27 09:40:52 -07:00
Shinn
14e6172c33 add some elements name for guessElementSymbolString function (#883) 2023-08-03 16:25:47 +02:00
Alexander Rose
17e278cefb Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-07-30 13:10:19 -07:00
Alexander Rose
911433e056 3.38.3 2023-07-29 23:10:31 -07:00
Alexander Rose
6b585cf0d6 fix imposter spheres not updating 2023-07-29 23:07:18 -07:00
Alexander Rose
86211aaf3a 3.38.2 2023-07-24 22:58:57 -07:00
Alexander Rose
071623f5b6 changelog 2023-07-24 22:56:08 -07:00
Alexander Rose
21e514ec1e fix non-physical keys support 2023-07-24 22:55:32 -07:00
Alexander Rose
9bc0ab12e7 Merge pull request #878 from JonStargaryen/ccd-fix
Fix logic for trajectoryFromCCD
2023-07-24 22:54:17 -07:00
Sebastian Bittrich
1d1bd05400 cl 2023-07-24 13:38:22 -07:00
Sebastian Bittrich
faa750bbf9 allow entries with chem_comp_atom - fixes #877 2023-07-24 13:33:48 -07:00
Alexander Rose
e92e5c5cef 3.38.1 2023-07-22 17:41:29 -07:00
Alexander Rose
b49230ea1f fix pixel-scale not updated in SSAO pass 2023-07-22 17:37:35 -07:00
dsehnal
44ebc1d39a 3.38.0 2023-07-18 17:39:42 +02:00
dsehnal
8d8e45f4ce changelog 2023-07-18 17:35:56 +02:00
Alexander Rose
898d877aa1 support non-physical keys in bindings trigger code (#860)
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-07-18 17:34:53 +02:00
David Sehnal
85dba9b1a4 ability to disable extension in the default viewer (#872) 2023-07-18 17:33:33 +02:00
dsehnal
6b5e90c5fa Merge branch 'master' of https://github.com/molstar/molstar 2023-07-17 09:40:25 +02:00
dsehnal
e231fbf3d7 add LRUCache.remove 2023-07-17 09:40:06 +02:00
David Sehnal
0ee8525b2d update getStateSnapshot behavior (#858)
* update getStateSnapshot behavior

* update syncCurrent
2023-07-13 19:38:35 +02:00
midlik
106ee614e7 Add 'Chain Instance' and 'Uniform' options for 'Carbon Color' param (#868) 2023-07-12 09:31:35 +02:00
David Sehnal
34056751f9 fix distinct palette getSamples (#857) 2023-07-11 08:52:36 +02:00
Alexander Rose
cc737192ca Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-07-09 20:49:34 -07:00
Alexander Rose
1afea8a86a Merge pull request #863 from molstar/approx-spheres
add approximate option for spheres rendering
2023-07-09 20:43:29 -07:00
Alexander Rose
96d5bf2447 Merge branch 'master' of https://github.com/molstar/molstar into approx-spheres 2023-07-09 20:38:10 -07:00
Alexander Rose
f9265a7049 fix clipping of approximate spheres 2023-07-09 20:31:55 -07:00
Alexander Rose
5c57137890 fix bitwiseAnd for glsl 1.00 2023-07-09 19:02:30 -07:00
Alexander Rose
4e71618d0f Merge pull request #864 from molstar/spheres-mem
reduce spheres geo memory usage
2023-07-09 18:55:14 -07:00
Alexander Rose
de660cc233 Merge branch 'master' into spheres-mem 2023-07-09 18:55:07 -07:00
Alexander Rose
616a1dabfa Merge pull request #859 from molstar/protein-caps
add more common protein caps
2023-07-09 18:47:36 -07:00
Alexander Rose
46ea39703f Merge branch 'master' into protein-caps 2023-07-09 18:47:30 -07:00
Alexander Rose
6cf20d0c44 Merge pull request #861 from molstar/snapshot-opened-event
add opened event to PluginStateSnapshotManager
2023-07-09 18:46:39 -07:00
Alexander Rose
0737e23b70 Merge branch 'master' into snapshot-opened-event 2023-07-09 18:46:30 -07:00
Alexander Rose
70d0c15d28 Merge pull request #862 from molstar/euler
add euler math primitive
2023-07-09 18:46:03 -07:00
Alexander Rose
9272c8c5ec Merge branch 'master' into euler 2023-07-09 18:45:55 -07:00
Alexander Rose
a3349f82fc Merge pull request #865 from molstar/element-stride
add stride option to element sphere & point visuals
2023-07-09 18:45:27 -07:00
Alexander Rose
11aeb6daf4 improve handling of cellpack membrane models 2023-07-09 18:44:36 -07:00
Alexander Rose
daec7e31ff add structure-element-sphere visual 2023-07-09 18:44:09 -07:00
Alexander Rose
c98cdc9360 improve cellpack mmcif detection 2023-07-09 18:42:17 -07:00
Alexander Rose
4d399edbdd add stride option to element sphere & point visuals 2023-07-09 11:25:56 -07:00
Alexander Rose
64598eba96 fix vertex count 2023-07-09 11:04:36 -07:00
Alexander Rose
aa25874775 reduce spheres geo memory usage
- derive mapping from VertexID
- pull position and group from texture
2023-07-08 22:27:45 -07:00
Alexander Rose
dccc06d497 tweaks to approximate spheres rendering 2023-07-08 16:19:02 -07:00
Alexander Rose
c000526cf8 add approximate option for spheres rendering 2023-07-08 16:05:24 -07:00
Alexander Rose
2166ab455c add euler math primitive 2023-07-08 15:41:14 -07:00
Alexander Rose
4de9ce01fc package updates 2023-07-08 15:40:20 -07:00
Alexander Rose
f543fd5683 exports 2023-07-08 13:25:56 -07:00
Alexander Rose
8535013ee5 add scissors icon 2023-07-08 13:25:29 -07:00
Alexander Rose
320ab77f8e properly switch-off fog 2023-07-08 13:23:39 -07:00
Alexander Rose
982feef0c6 add opened event to PluginStateSnapshotManager 2023-07-08 12:05:51 -07:00
Alexander Rose
bd6d04cefb add more common protein caps 2023-07-08 12:00:24 -07:00
Alexander Rose
250013570d tweak graphics-mode handling 2023-07-08 11:56:26 -07:00
David Sehnal
5e1c351efc fix display issue with sifts mapping (#854)
* fix display issue with sifts mapping

* update header
2023-07-06 20:30:01 +02:00
Alexander Rose
35739ab71b handle petworld using asymId for multiple entities 2023-07-04 19:48:32 -07:00
Alexander Rose
bb765968f1 fix missing uFog uniform 2023-07-03 23:15:57 -07:00
Alexander Rose
eb25d66359 add graphics mode to me app 2023-07-03 22:56:41 -07:00
Alexander Rose
3db28708c3 add option to approximate sphere impostors 2023-07-03 22:54:50 -07:00
Alexander Rose
4fb18b9afd properly switch-off fog 2023-07-03 22:53:28 -07:00
Alexander Rose
28693177cd more unit merging; split petworld membrane 2023-07-01 10:50:50 -07:00
Alexander Rose
cd2ac77469 merge non-instanced units in mmcif loader 2023-06-25 19:29:34 -07:00
Alexander Rose
8777f907ee reduce Spheres memory usage
- derive mapping from VertexID
- pull position and group from texture
2023-06-24 15:17:59 -07:00
Alexander Rose
5a6ac41b28 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-06-21 21:03:53 -07:00
Alexander Rose
61a294c889 3.37.1 2023-06-20 22:02:56 -07:00
Alexander Rose
71fbd6baab changelog 2023-06-20 21:58:53 -07:00
Alexander Rose
33430a836a fix lines, text, points rendering 2023-06-20 21:58:32 -07:00
Alexander Rose
2ac34f96f5 fix cellpack cif detection 2023-06-19 22:17:23 -07:00
Alexander Rose
de5d60f4d2 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-06-18 16:24:37 -07:00
Alexander Rose
f428e9f39e fix issues with wboit/dpoit in large scenes
- remove unneeded depth check (depth texture support required for wboit/dpoit)
2023-06-18 16:15:24 -07:00
Alexander Rose
72e3a31750 fix issues with wboit/dpoit in large scenes
- remove unneeded depth check (depth texture support required for wboit/dpoit)
2023-06-18 16:07:10 -07:00
Alexander Rose
5bcb0b19e5 support more structure formats 2023-06-18 12:56:52 -07:00
Alexander Rose
0277581684 generic loader improvements 2023-06-17 23:53:03 -07:00
Alexander Rose
d508988ba4 use inverted-xray 2023-06-17 00:17:03 -07:00
Alexander Rose
7352799270 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into generic-loader 2023-06-16 23:57:26 -07:00
Alexander Rose
7b524dda7c Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-06-16 23:56:47 -07:00
Alexander Rose
2d26425cbe 3.37.0 2023-06-16 23:46:03 -07:00
Alexander Rose
f6030aee25 changelog 2023-06-16 23:42:22 -07:00
Alexander Rose
609e03f7d2 add mipmap-based blur for image backgrounds 2023-06-16 23:12:13 -07:00
Alexander Rose
ba12a8bbee add contextHash to SizeTheme 2023-06-16 22:29:38 -07:00
Alexander Rose
947f293844 Merge pull request #839 from molstar/xray-inverted
add inverted xray-shaded option
2023-06-16 22:26:55 -07:00
Alexander Rose
fbff0e769c Merge branch 'master' into xray-inverted 2023-06-16 22:26:47 -07:00
Alexander Rose
3798223d39 Merge pull request #840 from molstar/model-export-name
Model export name
2023-06-16 22:26:22 -07:00
Alexander Rose
ac9c23dc65 3.36.1-model-export-name.0 2023-06-12 22:22:35 -07:00
Alexander Rose
096f492ccb add ability to set a file name for structures 2023-06-12 22:09:13 -07:00
Alexander Rose
ba96da9354 add inverted xray-shaded option 2023-06-11 15:31:24 -07:00
Alexander Rose
6c1d17bac5 3.36.1 2023-06-11 12:44:43 -07:00
Alexander Rose
ad2ccf4e07 fix changelog 2023-06-11 12:41:59 -07:00
Alexander Rose
dc1b7b4693 3.36.0 2023-06-11 12:28:28 -07:00
Alexander Rose
59e4e2b31d schema updates 2023-06-11 12:25:05 -07:00
Alexander Rose
d2483dc449 package updates 2023-06-11 12:23:42 -07:00
Alexander Rose
86dcf22728 ux improvements, mmcif support 2023-06-11 10:51:55 -07:00
Alexander Rose
f47823577d Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into generic-loader 2023-06-07 23:13:13 -07:00
Alexander Rose
671a982463 get entities/groups tweaks 2023-06-07 23:12:36 -07:00
Alexander Rose
4244c6f5e1 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-06-07 22:04:45 -07:00
Alexander Rose
d26946e9ee Merge pull request #838 from molstar/cartoon-color-nucleic
Cartoon improvements
2023-06-05 23:06:06 -07:00
Alexander Rose
cd045a6b48 fix spec 2023-06-05 22:49:43 -07:00
Alexander Rose
2407729d27 simplify sub color theme creation 2023-06-05 22:43:51 -07:00
Alexander Rose
1aa22b9fa0 add saturation/lightness to uniform color theme 2023-06-05 22:42:34 -07:00
Alexander Rose
b00b0827c8 fix circular deps 2023-06-05 21:33:19 -07:00
Alexander Rose
fe4df71d02 wip, generic loader
- zip with json manifest
2023-06-05 00:08:15 -07:00
Alexander Rose
8f03e07632 tweak clip props handling
- don't force instance variant
2023-06-04 18:35:31 -07:00
Alexander Rose
5958b31a6d add Euler math primitive 2023-06-04 18:15:12 -07:00
Alexander Rose
35c9f39a69 add cartoon color theme
- separates colorings for for mainchain and sidechain visuals
- uses isSecondary mechanism of LocationIterator
2023-06-03 11:15:33 -07:00
Alexander Rose
7dd420cc18 add nucleicProfile param to cartoon repr 2023-06-03 11:13:08 -07:00
Alexander Rose
ace991da5d optimize select/highlight
- highlight whole repr when possible
- make cellpack entity structures their own roots
2023-05-29 23:21:33 -07:00
Alexander Rose
5e9bc89c75 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-05-29 15:35:34 -07:00
Alexander Rose
1d434c259a ignore LociLabelManager without providers 2023-05-29 15:01:26 -07:00
Alexander Rose
6d193edd68 add keyReleased event 2023-05-29 15:01:14 -07:00
Alexander Rose
8d0c80f270 various tweaks
- add MesoSelectLoci behavior
- add MesoscaleState transform
- show groupBy only if there is more than one option
- make groupBy and filter state-savable
2023-05-29 15:00:38 -07:00
Alexander Rose
2ae36e181d add keyReleased event 2023-05-29 14:57:26 -07:00
Alexander Rose
52692a405d ignore LociLabelManager without providers 2023-05-29 14:57:08 -07:00
Alexander Rose
9bf859d6ed Merge pull request #835 from JonStargaryen/channels
Adjust VolumeRepresentation#setState
2023-05-29 11:41:33 -07:00
Sebastian Bittrich
207230d565 check against _state 2023-05-29 11:16:17 -07:00
Alexander Rose
b7a673f38e Merge pull request #731 from JonStargaryen/master
Parse CCD Files
2023-05-29 11:11:57 -07:00
Sebastian Bittrich
2204e4e0d0 merge upstream 2023-05-29 09:24:11 -07:00
Sebastian Bittrich
6276365766 update setState of unit repr 2023-05-29 09:18:07 -07:00
Sebastian Bittrich
505b04c92d merge upstream 2023-05-29 08:56:37 -07:00
Alexander Rose
0a91a35cf3 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-05-28 12:37:46 -07:00
Alexander Rose
fc84dcb037 Merge pull request #836 from molstar/structure-selection-snapshot
add snapshot support for structure selections
2023-05-28 12:32:37 -07:00
Alexander Rose
103b0dcebd Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-05-27 13:26:03 -07:00
Alexander Rose
2f29ff7314 Merge pull request #826 from molstar/graph-bonds
Graph & bonds calc tweaks & fixes
2023-05-27 11:07:56 -07:00
Alexander Rose
b37f043876 Merge branch 'master' into graph-bonds 2023-05-27 11:07:45 -07:00
Alexander Rose
f0e725f65c tweak CCD coordinate type handling 2023-05-27 11:01:27 -07:00
Alexander Rose
23a34e2df1 add snapshot support for structure selections 2023-05-27 10:14:46 -07:00
Alexander Rose
d11e242b70 fix background occlusion handling 2023-05-27 10:07:58 -07:00
Sebastian Bittrich
d9af0ca068 cl 2023-05-26 14:04:31 -07:00
Sebastian Bittrich
b7f10acbf0 adjust VolumeRepresentation#setState - closes #210 2023-05-26 13:59:45 -07:00
Sebastian Bittrich
43749ccdbd merge 2023-05-23 09:24:46 -07:00
David Sehnal
3bf4a8f8e6 optimize computeInterUnitBonds (#830) 2023-05-23 09:08:00 +02:00
Alexander Rose
f0ae1b3347 fix EdgeBuilder.addNextEdge for loop edges 2023-05-22 23:27:06 -07:00
Alexander Rose
99809d25b9 remove erroneous bounding-box overlap test 2023-05-22 23:25:08 -07:00
Sebastian Bittrich
e83c0af67c meta 2023-05-22 13:10:47 -07:00
Sebastian Bittrich
2ddf94313e Merge remote-tracking branch 'upstream/master' 2023-05-22 13:08:41 -07:00
Sebastian Bittrich
da5965c956 meta 2023-05-22 13:04:58 -07:00
Sebastian Bittrich
31be0af3c9 shrink diff 2023-05-22 12:55:23 -07:00
Sebastian Bittrich
38c550b245 factor out to extension 2023-05-22 11:59:57 -07:00
Sebastian Bittrich
95a7a2cef9 rm CCDCoordinateTypeProp 2023-05-22 09:16:28 -07:00
giagitom
5934f355c2 Fixes and added changelog entry 2023-05-22 17:02:25 +02:00
giagitom
225d051dd6 Merge branch 'master' into 2-colors-cylinders 2023-05-22 16:50:59 +02:00
Alexander Rose
1a1ec51736 fix bbox overlap test in Structure.eachUnitPair 2023-05-20 22:46:59 -07:00
Alexander Rose
299aae56c1 typing improvements 2023-05-20 19:22:04 -07:00
Alexander Rose
781824c961 operators in IndexPairBonds as directed property 2023-05-20 19:21:40 -07:00
Alexander Rose
fae4aae99f update immer to v10 (#819) 2023-05-20 17:56:11 -07:00
Alexander Rose
6acc87abc6 change build target to ES6 2023-05-20 17:55:05 -07:00
Sebastian Bittrich
930cfa2590 comment 2023-05-15 11:45:39 -07:00
Sebastian Bittrich
35439f01aa rather heavy-handed tracking of ideal/model coords 2023-05-15 11:44:04 -07:00
Alexander Rose
af489e8cc5 fix interactivity granularity 2023-05-14 22:49:57 -07:00
Alexander Rose
a15f2ed456 mesoscale state cleanup 2023-05-14 22:21:50 -07:00
Alexander Rose
9c921fd061 adjust lod-level stride by sizeFactor 2023-05-14 22:21:27 -07:00
Alexander Rose
e719c54e2b Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-05-14 11:59:27 -07:00
Alexander Rose
71121e52af 3.35.0 2023-05-14 11:50:42 -07:00
Alexander Rose
c08155717f changelog 2023-05-14 11:47:29 -07:00
Alexander Rose
de4164e7a4 package updates 2023-05-14 11:47:04 -07:00
Alexander Rose
e34d1242a9 Merge pull request #820 from molstar/cantor-mol-script
add cantor-pairing functions to mol-script
2023-05-14 11:40:18 -07:00
Alexander Rose
5b82641018 add sign to core.math in mol-script 2023-05-13 18:22:21 -07:00
Alexander Rose
de2f0c27b2 add trunc to core.math in mol-script 2023-05-13 18:08:19 -07:00
Alexander Rose
71e2afe781 tweak principal-axes spec 2023-05-13 16:30:23 -07:00
Alexander Rose
3cba621fcf add cantor-pairing functions to mol-script 2023-05-13 16:22:50 -07:00
Alexander Rose
d79a2077c1 package updates 2023-05-13 12:37:21 -07:00
Alexander Rose
6925547b5f Merge pull request #804 from giagitom/single-aromatic-dash-count
Enable odd dash count (1,3,5)
2023-05-13 11:41:12 -07:00
Alexander Rose
84aae8cf0a Merge branch 'master' into single-aromatic-dash-count 2023-05-13 11:17:47 -07:00
Alexander Rose
bdb42e39ec Merge pull request #809 from giagitom/principal-axis-spec
Adding principal axes spec
2023-05-13 10:23:29 -07:00
Alexander Rose
6edd54ee6d use Vec3.isFinite as name 2023-05-13 10:12:47 -07:00
Alexander Rose
198f884d8b Merge pull request #817 from molstar/pdb-assemblies-fix
Fix Archive PDB assembly loading
2023-05-13 10:04:34 -07:00
Alexander Rose
2c7d0a6721 comment 2023-05-13 10:03:39 -07:00
Alexander Rose
7ef15ede0d mesh exporter improvements
- set alphaMode and doubleSided in glTF export
- fix flipped cylinder caps
2023-05-13 09:45:27 -07:00
Sebastian Bittrich
3d96298b55 Merge remote-tracking branch 'upstream/master' 2023-05-12 14:45:40 -07:00
Sebastian Bittrich
964f045e56 refactor 2023-05-12 11:52:18 -07:00
Sebastian Bittrich
d3364ac109 control what coord set to show 2023-05-12 11:28:51 -07:00
Sebastian Bittrich
a5b963c919 hide hydrogens by default 2023-05-12 09:41:56 -07:00
Gianluca Tomasello
d6fcbbf543 Merge branch 'master' into single-aromatic-dash-count 2023-05-12 15:16:02 +02:00
giagitom
f2e7e2eaf2 Fix unequeal aromatic dashes 2023-05-12 15:13:06 +02:00
giagitom
01c4c63114 Merge brunch master 2023-05-12 15:10:50 +02:00
Sebastian Bittrich
22f9bc4ff1 swap ideal/model labels, handle entirely missing coords 2023-05-11 15:42:13 -07:00
Sebastian Bittrich
c6c4350638 align differing atom sets 2023-05-11 11:28:40 -07:00
giagitom
a17a0c4527 Added changelog record 2023-05-11 16:37:25 +02:00
giagitom
8e507012c1 Merge branch 'master' into principal-axis-spec 2023-05-11 16:14:20 +02:00
giagitom
beb4351dc9 Add check to avoid non-finite origin vector 2023-05-11 16:13:16 +02:00
dsehnal
afbb940721 headers 2023-05-11 13:24:17 +02:00
dsehnal
f5c619a4c7 Fix Archive PDB assembly loading 2023-05-11 13:23:28 +02:00
Sebastian Bittrich
1b0401dff5 filter for present valuekind 2023-05-09 14:50:37 -07:00
valasatava
649e779100 Add HYP to the list of amino acids (#815)
* add modified amino acid "hydroxyproline" (HYP) present in collagen molecules to the list of amino acids

* update changelog
2023-05-09 16:27:42 +02:00
Alexander Rose
18c4de4c0f Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-05-07 20:43:13 -07:00
Alexander Rose
f61e0e72a8 move web3dsurvey analytics into iframe
- only deployed on molstar.org
2023-05-07 20:41:29 -07:00
Alexander Rose
803f75fdde Merge pull request #797 from molstar/ignore-hydrogens-interactions
support ignoreHydrogens for interactions
2023-05-07 19:56:33 -07:00
Alexander Rose
718d314eda Merge branch 'master' into ignore-hydrogens-interactions 2023-05-07 19:56:19 -07:00
Alexander Rose
adab6b0a6a Merge pull request #812 from valasatava/pdb-to-cif-header
Parse HEADER record when reading PDB file
2023-05-06 16:49:36 -07:00
Alexander Rose
d295ed2eca add options to mesh-exporter
- lines/points as triangles
- include hidden
- primitives qaulity
2023-05-06 16:35:01 -07:00
Yana Rose
d18cbfa8cf update the date in the added file header 2023-05-05 12:33:39 -07:00
Yana Rose
59f881c4be handle empty HEADER record 2023-05-05 12:32:39 -07:00
JonStargaryen
0295e0ef63 factor out CoordinateType 2023-05-05 09:41:46 -07:00
Yana Rose
dcdb95a055 update changelog 2023-05-04 22:11:36 -07:00
Yana Rose
e379d27722 add my name to package.json's contributors 2023-05-04 22:11:22 -07:00
Yana Rose
41fbe0d2b7 update headers of modified files 2023-05-04 22:11:05 -07:00
Yana Rose
1231666b06 restore package-lock 2023-05-04 21:52:56 -07:00
Yana Rose
b302bb8455 parse header when reading PDB file 2023-05-04 21:30:02 -07:00
Sebastian Bittrich
6e82405600 fix merge 2023-05-04 16:25:52 -07:00
Sebastian Bittrich
a678893bdb wip 2023-05-04 16:20:28 -07:00
Alexander Rose
430348a3cd support points & lines in glTF export (#810) 2023-05-03 19:23:40 +02:00
midlik
315401c166 struct-conn extension (#802)
* struct-conn extension toy example

* Minor changes (David's feedback)

* Showing struct_conn visuals

* Removed Interactions visual

* Caching struct_conns

* Removed testing buttons in index.html, updated CHANGELOG

* Addressed most of PR feedback

* Fixed structure node selection, docs

* Addressed feedback round 2
2023-05-03 18:01:51 +02:00
giagitom
b309c545f5 - Fixed dashes spacing
- Added changelog entry
2023-05-03 17:51:02 +02:00
David Sehnal
60b5d2d39b fix labels & optimize getData (#811) 2023-05-03 15:37:24 +02:00
David Sehnal
eb749a2a16 State.updateNode fix for Null parents (#807) 2023-05-02 16:12:38 +02:00
Dominik Tichy
6db96001a3 Partial atomic charges extension (#808)
* feat: partial charges extension

* chore: pullrequest actions

* feat: example

* fix: review changes

* fix: updated example structure categories

* fix(changelog): shorter description

* fix: code review changes

* fix: cosmetic changes
2023-05-02 16:09:42 +02:00
giagitom
257370ad58 - Removing unused variables
- Supporting meshes and lines
- Remove non-stub cap from last (if odd) dash
2023-05-01 22:02:33 +02:00
Alexander Rose
a12820bab9 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-30 21:11:27 -07:00
Alexander Rose
557bf63b55 prevent dragging of snapshot images 2023-04-30 21:10:24 -07:00
giagitom
0e32e0a785 lint-fix 2023-04-30 16:22:30 +02:00
giagitom
f2c607a4b2 Adding principal axes spec 2023-04-30 16:03:07 +02:00
David Sehnal
0d12a9e118 PluginState.setSnapshot fix (#805) 2023-04-27 12:34:44 +02:00
giagitom
02f418c8c5 Fix 2023-04-26 15:31:24 +02:00
giagitom
c59ae908b8 Implement 2 colors interpolation on impostor cylinders 2023-04-26 15:24:15 +02:00
giagitom
ba618c9e4a Allow for single aromatic dash count 2023-04-26 14:56:42 +02:00
Alexander Rose
de5b7f31f9 add custom sizeFactor for some cellpack entities 2023-04-25 22:21:18 -07:00
Alexander Rose
e264abb57c prevent dragging of snapshot images 2023-04-25 21:03:50 -07:00
Alexander Rose
46a84799b1 no componentManager in state 2023-04-25 20:58:02 -07:00
David Sehnal
ebd3ebe7b2 fix struct conn for waters (#803) 2023-04-25 16:25:39 +02:00
Alexander Rose
af451db432 group-by support for entities 2023-04-22 21:53:34 -07:00
Alexander Rose
804117475b lint fixes 2023-04-22 10:18:59 -07:00
Alexander Rose
09ab8d6219 Merge pull request #796 from MadCatX/ntc-tube-uniform-color
Add a uniform color theme for NtC tube that still paints the residue and segment dividers in a different color
2023-04-22 10:18:05 -07:00
Alexander Rose
f3a5369690 support ignoreHydrogens for interactions 2023-04-22 09:56:21 -07:00
Michal Malý
8bf2fe624d Add a uniform color theme for NtC tube that still paints the residue and
segment dividers in a different color
2023-04-20 17:38:55 +02:00
Alexander Rose
5ac435c6d1 only calculate instance-grid if there are instances 2023-04-16 12:54:09 -07:00
Alexander Rose
aab3759da2 fix file-info use 2023-04-16 12:46:52 -07:00
Alexander Rose
db1174bd32 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-16 12:23:07 -07:00
Alexander Rose
50c1b667c5 3.34.0 2023-04-16 12:19:38 -07:00
Alexander Rose
360031d37c Merge branch 'master' of https://github.com/molstar/molstar 2023-04-16 12:09:47 -07:00
Alexander Rose
9ec873e0db changelog 2023-04-16 11:58:31 -07:00
Alexander Rose
c830a720b0 package updates 2023-04-16 11:56:32 -07:00
Alexander Rose
1aa7d1e0f7 Merge pull request #782 from molstar/eachLocation
add eachLocation to representation/visual interface
2023-04-16 11:53:44 -07:00
Alexander Rose
c5c8de8628 Merge branch 'master' of https://github.com/molstar/molstar into eachLocation 2023-04-16 11:44:45 -07:00
Alexander Rose
74c6d6f5a1 changelog 2023-04-16 11:44:03 -07:00
Russell Parker
2bff0faff7 Address Node incompatibility in mol-util/file-info (#787)
* Alter getFileInfo to avoid `instanceof WebAPIClass` and simple renames

* Remove note

* Fix potentially bad `window` reference
2023-04-13 23:41:21 +02:00
dsehnal
4df028aa77 readAllLinesAsync fix 2023-04-13 20:33:05 +02:00
dsehnal
47c2d153aa tweak readLinesAsync 2023-04-13 20:25:20 +02:00
Alexander Rose
18be09e9d5 fix .getAllLoci for representations with structure.child 2023-04-12 23:28:16 -07:00
Alexander Rose
55e940e88c fix rendering with very small viewport and SSAO 2023-04-12 23:25:57 -07:00
Alexander Rose
7a3fc2047e Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-08 13:31:51 -07:00
Alexander Rose
e246f4e5ca add eachLocation to representation/visual interface 2023-04-08 10:17:00 -07:00
Alexander Rose
5e1bb4b106 Merge pull request #778 from MadCatX/ntc-tube-missing-atoms
Fix rendering of NtC tube when some of the required atoms are missing
2023-04-08 09:55:51 -07:00
Alexander Rose
0b2889bb99 Merge branch 'master' into ntc-tube-missing-atoms 2023-04-08 09:55:44 -07:00
Alexander Rose
2994caf411 Merge pull request #779 from MadCatX/restore-vertex-array-per-program
Fix broken rendering caused by changes in 291d7abb78
2023-04-08 09:53:55 -07:00
Alexander Rose
e157993a0f Merge branch 'master' of https://github.com/molstar/molstar into pr/MadCatX/779 2023-04-08 09:42:53 -07:00
Alexander Rose
6c7c9afc34 fix spec 2023-04-08 09:40:10 -07:00
Alexander Rose
2d0b17d93c improve trackball keyState handling with modifiers 2023-04-08 09:29:57 -07:00
midlik
033c613c89 Added "Zoom All", "Orient Axes", "Reset Axes" buttons (#776)
* Added "Zoom All", "Orient Axes", "Reset Axes" buttons

* Addressed PR776 feedback
2023-04-08 10:06:39 +02:00
Michal Malý
1985eb59dd Do not reuse vertex arrays among programs 2023-04-06 15:00:54 +02:00
Michal Malý
1cf6cbf8a3 changelog 2023-04-06 12:32:21 +02:00
Michal Malý
0b42379c34 Do not draw a NtC tube segment unless we have all required atoms 2023-04-06 12:20:13 +02:00
Alexander Rose
414c349974 changelog 2023-04-03 21:56:59 -07:00
Alexander Rose
cf6d5f7194 Merge pull request #774 from giagitom/markingDepth-avoid-alpha-0-rendering
Marking depth avoid alpha 0 rendering
2023-04-03 21:54:18 -07:00
Alexander Rose
949f5207b4 add ModifiersKeys.areNone 2023-04-03 21:46:28 -07:00
Alexander Rose
a1da374b32 add ModifiersKeys.areNone 2023-04-03 21:44:11 -07:00
giagitom
5460322d4a Update changelog 2023-04-03 12:50:27 +02:00
giagitom
8b2da0b787 avoid rendering of alpha 0 renderables on renderMarkingDepth 2023-04-03 12:46:11 +02:00
Alexander Rose
f2e5c8a30f Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-02 12:54:04 -07:00
Alexander Rose
3eaf4dacaf 3.33.0 2023-04-02 12:48:10 -07:00
Alexander Rose
d66d9b4dd7 changelog 2023-04-02 12:46:11 -07:00
Alexander Rose
cc52279e01 package updates 2023-04-02 12:45:42 -07:00
Alexander Rose
34b9a46f2d add camera controls behavior 2023-04-02 12:39:56 -07:00
Alexander Rose
0def474f6d Merge pull request #773 from molstar/model-conf-fields
include occupancy & B_iso_or_equiv in model conformation
2023-04-02 12:31:34 -07:00
Alexander Rose
e0ea9a2855 Merge branch 'master' into model-conf-fields 2023-04-02 12:31:21 -07:00
midlik
2bc381fe05 Forsake lazy imports (#772)
* Removed LazyImports (gl, pngjs, jpeg-js required as param of HeadlessPluginConstructor)

* Added a few methods to HeadlessPluginContext for rendering image without saving to file

* Updated CHANGELOG

* Lint

* Rolled back removing @types/jpeg-js from deps
2023-04-02 18:47:22 +02:00
Alexander Rose
95d84b9dbe Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-01 23:36:17 -07:00
Alexander Rose
1f78994ac0 changelog 2023-04-01 23:36:07 -07:00
Alexander Rose
fb3cd3bf52 include occupancy & B_iso_or_equiv in model conformation 2023-04-01 19:49:24 -07:00
Alexander Rose
c4414c7cc4 Merge pull request #581 from molstar/mmcif/parse-all-blocks
add TrajectoryFromMmCif loadAllBlocks param
2023-04-01 16:25:56 -07:00
Alexander Rose
e2f2ceb7a9 Merge branch 'master' into mmcif/parse-all-blocks 2023-04-01 16:25:45 -07:00
Alexander Rose
641e7efb11 improve camera when toggeling pointer-lock/fly-mode 2023-04-01 16:13:31 -07:00
Alexander Rose
e5e02e966f Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-04-01 11:47:30 -07:00
Alexander Rose
11f2ef50ef add Frustum3D and Plane3D math primitives 2023-04-01 11:43:52 -07:00
Alexander Rose
869ecfaf71 improve typing of toArray methods 2023-04-01 11:33:01 -07:00
Alexander Rose
cb8731815c changelog & param tweaks 2023-04-01 11:02:06 -07:00
Alexander Rose
a9177ad362 Merge branch 'master' of https://github.com/molstar/molstar into mmcif/parse-all-blocks 2023-04-01 10:44:49 -07:00
Alexander Rose
ad116df73b fix camera project/unproject
- was wrong when using offset viewport
2023-03-31 23:37:52 -07:00
Alexander Rose
f30b3a410c init camera for fly mode
- like for pointer-lock
2023-03-30 22:32:58 -07:00
Alexander Rose
c440ba2d4b gl tweaks
- add more docs
- clean schema types
2023-03-30 22:16:11 -07:00
Alexander Rose
a3267dafdb Merge pull request #762 from molstar/multi-scale-ssao
add multi-scale ssao
2023-03-30 22:13:43 -07:00
dsehnal
7a1e83733c throttle canvas resize events 2023-03-30 15:00:24 +02:00
Russell Parker
7cb96ce983 Handle resizing viewer element when window remains the same size (#763)
* Handle resizing viewer element when window remains the same size

* Fix bad rebase

* Fall back to window resize event listener when ResizeObserver not defined

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-03-30 14:51:20 +02:00
jpattle
a73633d0c3 Selection and focus improvements (#742)
* Updated measurements so that the toggle selection button is not shown if selection mode is turned off

* Updated selection controls so that they cannot be turned off if selection mode is not shown

* Extended camera focus bindings to allow override of behaviour to reset camera focus on click

* Exported default bindings for selection and focus so that they can be more easily selectively overridden

* Added description to changelog and headers to modified files

* Fixed spacing in text for toggling selection mode

* Updated camera bindings to not be a breaking change by setting the new bindings to be optional and using default values when undefined

* resolved linting issues with camera bindings

* updated superposition UI to hide selection toggle button when selection mode is disabled

* updated the default value for click to reset camera bindings
2023-03-30 14:49:35 +02:00
Alexander Rose
b2f8e8dd4e fix spec 2023-03-30 00:07:25 -07:00
Alexander Rose
291d7abb78 gl improvements
- remove unneccesary return values
- reuse vertex array among programs
- typo fixes
- cleanup material-textures
2023-03-29 23:50:30 -07:00
Alexander Rose
32873d787b fix theme smoothing not updated 2023-03-29 23:22:55 -07:00
Alexander Rose
e243d71abf cleanup level, light, clip assignments 2023-03-29 23:19:27 -07:00
Alexander Rose
2689d3f21a more input/controls fixes & tweaks
- no identify when pointer-lock & controls movement
- limit controls key bindings to viewport
- take controls minDistance into account for movement
2023-03-28 23:22:55 -07:00
dsehnal
c1bc008114 Fix JSX reference 2023-03-28 10:04:36 +02:00
Alexander Rose
254578460a input/controls fixes & tweaks
- assign trackball bindings in setProps
- remove cross element in input-observer dispose
- improve key event target handling
- add center dot to pointer-lock crosshair
2023-03-27 23:09:57 -07:00
Alexander Rose
f5467dd3b9 allow intra-residue contacts in single-residue models 2023-03-27 22:39:32 -07:00
Alexander Rose
9eb8714e11 add multi-scale ssao 2023-03-26 00:14:49 -07:00
Alexander Rose
847678ea56 improve canvas3d consoleStats 2023-03-26 00:14:05 -07:00
Alexander Rose
f08729a402 apply bumpiness as lightness with ignoreLight 2023-03-25 23:57:18 -07:00
Alexander Rose
a7c91257a7 Merge pull request #752 from molstar/input-controls
input/controls improvements
2023-03-25 23:52:10 -07:00
Alexander Rose
835369a91e change dragRotateZ binding to drag left+shift+ctrl 2023-03-25 10:50:38 -07:00
Alexander Rose
62554b522f add key bindings for fly mode & reset view 2023-03-25 10:32:02 -07:00
Alexander Rose
fd041cd4c3 change dragRotateZ binding to left+alt 2023-03-25 10:31:05 -07:00
Alexander Rose
cfbb68c8ef improve contrast of pointer-lock cross 2023-03-25 10:30:05 -07:00
dsehnal
d7acec4f7d tweak moveCamera 2023-03-25 11:58:06 +01:00
dsehnal
7da46bca8b scale move speed by frametime 2023-03-24 19:52:11 +01:00
Sebastian Bittrich
66b4fcdc2c simplify 2023-03-23 08:48:58 -07:00
Alexander Rose
c480579ca8 add web3dsurvey analytics code (only molstar.org) 2023-03-22 20:13:01 -07:00
Alexander Rose
e1a5ad16f1 ssao improvements
- make bias a global param
- add a 4th level by default
2023-03-22 20:07:30 -07:00
Alexander Rose
512ec4f8ea Merge pull request #16 from arose/ssao-levels
[DRAFT] ssao levels
2023-03-21 23:31:58 -07:00
Alexander Rose
bc46b07ee1 refactor ssao levels as multi-scale option 2023-03-21 23:06:23 -07:00
Alexander Rose
f750f1581e Merge branch 'master' of https://github.com/molstar/molstar into ssao-levels 2023-03-21 21:11:13 -07:00
Alexander Rose
00ff1a1eae Merge branch 'master' of https://github.com/molstar/molstar into input-controls 2023-03-21 20:19:33 -07:00
dsehnal
ae795f8ad3 3.32.0 2023-03-20 09:29:41 +01:00
dsehnal
9d3c071689 changelog 2023-03-20 09:26:48 +01:00
David Sehnal
01cb23f566 add setFSModule (#755) 2023-03-20 09:24:45 +01:00
Alexander Rose
fe8a9799ab add exposure parameter (#751)
* add exposure parameter

* add missing uniform

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-03-20 09:16:51 +01:00
David Sehnal
4f18154681 Marking improvements (#750)
* better marking identify

* changelog

* tweak

* type tweak

* simplify ui mouse move handling

---------

Co-authored-by: Alexander Rose <alexander.rose@weirdbyte.de>
2023-03-20 09:15:51 +01:00
Alexander Rose
2114c4a3ad type fixes 2023-03-19 15:12:42 -07:00
Alexander Rose
2ca41b2b51 package updates 2023-03-19 15:11:58 -07:00
Alexander Rose
6605a2019e Merge pull request #753 from giagitom/dpoit-avoid-alpha-0-rendering
Dpoit avoid alpha 0 rendering
2023-03-19 14:10:43 -07:00
giagitom
8b1ed5f183 Including wboit 2023-03-19 21:05:25 +01:00
giagitom
f11a1b788f Updated changelog 2023-03-19 19:54:30 +01:00
giagitom
7928e24c54 Avoid rendering of fully transparent renderables 2023-03-19 19:51:01 +01:00
Alexander Rose
5dbca41da6 fix blurry occlusion in screenshots 2023-03-18 19:01:33 -07:00
Alexander Rose
f3fa54addf input/controls improvements 2023-03-18 15:34:46 -07:00
Alexander Rose
e24dc0a680 handle cellpack missing asymid 2023-03-18 10:46:41 -07:00
Alexander Rose
e636397f90 ensure marking edges are at least one pixel wide 2023-03-15 20:56:08 -07:00
Sebastian Bittrich
1f3e20704d better applicable check 2023-03-15 16:05:06 -07:00
Sebastian Bittrich
cc9bdd4f14 add ccd hierarchy preset 2023-03-15 16:01:54 -07:00
Russell Parker
6d76bf120d Change nodejs-shim conditional to avoid checking document (#740) 2023-03-08 17:43:38 +01:00
Alexander Rose
a50e81551f use ssao-scale for gl viewport/scissor 2023-03-06 22:48:31 -08:00
Alexander Rose
94cd5abf30 add lod-levels-preset param 2023-03-05 21:13:09 -08:00
Alexander Rose
cec33fa6a7 add support for examples 2023-03-04 10:37:02 -08:00
Alexander Rose
7b14a45582 skip ssao level when too close wrt to radius 2023-02-26 21:44:47 -08:00
Alexander Rose
86512bcea1 tweak ssao-blur thresholds 2023-02-26 19:16:37 -08:00
Alexander Rose
f0efffceaa half/quarter res depth for distant ssao samples 2023-02-26 19:08:57 -08:00
Alexander Rose
8b37a9509f tweak ssao-blur 2023-02-26 19:07:35 -08:00
Alexander Rose
de61956bf7 wip, ssao teaks 2023-02-25 21:40:58 -08:00
Alexander Rose
c1bc8fc262 adjust lod preset 2023-02-25 15:31:22 -08:00
Alexander Rose
797e6a5318 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into ssao-levels 2023-02-25 15:25:06 -08:00
Alexander Rose
bd41f45370 fix adjustPluginProps 2023-02-25 15:15:49 -08:00
Alexander Rose
7946b7403c Merge pull request #18 from arose/lod-radius-scale
Lod radius scale
2023-02-25 15:12:23 -08:00
Alexander Rose
eccf6e21e0 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into lod-radius-scale 2023-02-25 15:09:01 -08:00
Alexander Rose
41c40da6c7 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-02-25 15:04:49 -08:00
Alexander Rose
975f45eb01 package updates 2023-02-25 15:02:21 -08:00
Alexander Rose
f2399d3179 Merge pull request #737 from molstar/pp-improvements
Post-processing improvements
2023-02-25 14:45:48 -08:00
Alexander Rose
b26d62a067 webgl1 compat 2023-02-25 14:09:13 -08:00
Alexander Rose
926d6cbd46 reduce over-blurring occlusion at larger view distances 2023-02-25 13:52:18 -08:00
Alexander Rose
7ea47d2a99 use pixel-size for max depth difference 2023-02-25 13:31:44 -08:00
Alexander Rose
89ad8cfc15 fix orthographic camera defines not updated 2023-02-25 13:17:03 -08:00
Alexander Rose
302a309aff add occlussion color 2023-02-25 13:03:12 -08:00
Sebastian Bittrich
fbc74c0012 Merge remote-tracking branch 'upstream/master' 2023-02-24 14:27:24 -08:00
Sebastian Bittrich
27a953795c use ComponentBond.Provider 2023-02-24 14:17:48 -08:00
dsehnal
c3e62bc2e5 3.31.4 2023-02-24 13:13:06 +01:00
dsehnal
c2ab322bd2 Stop animation loop on dispose 2023-02-24 13:10:35 +01:00
jump2cn
aeab0f235c allow link cylinder/line dashCount set to '0' (#735) 2023-02-23 10:52:56 +01:00
dsehnal
ae2285599f 3.31.3 2023-02-22 20:44:32 +01:00
dsehnal
104ab757d2 Update fs import in data-source.ts 2023-02-22 20:37:34 +01:00
Sebastian Bittrich
6ada52bc0b names 2023-02-21 14:33:37 -08:00
Sebastian Bittrich
c526cb9f08 consolidate params 2023-02-21 13:51:26 -08:00
Sebastian Bittrich
a1662d76fb parse CCD files 2023-02-21 13:41:40 -08:00
Alexander Rose
25a4c18dce Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into ssao-levels 2023-02-18 14:04:40 -08:00
Alexander Rose
0fe4eda8ae shape, ensure lodLevels update 2023-02-18 12:47:04 -08:00
Alexander Rose
de84a8c8c5 tweak minNear param max 2023-02-18 11:42:45 -08:00
Alexander Rose
4fa135daf0 fix near clipping avoidance in impostor shaders 2023-02-18 11:33:36 -08:00
Alexander Rose
e244a17b57 add cellSize to LodParams for testing 2023-02-18 11:25:31 -08:00
Alexander Rose
7b61d78a9e ensure lodLevels update 2023-02-18 11:24:39 -08:00
Alexander Rose
b5540c7fe9 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into lod-radius-scale 2023-02-18 10:24:48 -08:00
Alexander Rose
1c48509a17 consolidate cellpack & petworld ext into meso app
- remove petworld & cellpack ext for now
- automatically detect cif type
2023-02-18 10:20:00 -08:00
midlik
9870cb4082 Fixed degenerate case (1-point) in PCA (#725)
* Fixed degenerate case (1-point) in PCA - now correctly returns identity matrix

* Changelog
2023-02-17 20:08:21 +01:00
Alexander Rose
b2924761ab update impostor bond visuals on sizeFactor changes 2023-02-12 22:06:18 -08:00
Alexander Rose
bf08b24991 increase minNear to reduce banding 2023-02-12 21:27:13 -08:00
Alexander Rose
0151ee1387 tweak lodLevel presets 2023-02-12 20:56:13 -08:00
Alexander Rose
eb6d5586cd fix near clipping avoidance in impostor shaders 2023-02-12 20:37:07 -08:00
Alexander Rose
f66f1f545e Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into lod-radius-scale 2023-02-12 11:05:54 -08:00
Alexander Rose
5a3f245ac0 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-02-12 11:05:11 -08:00
Alexander Rose
9c5f451878 3.31.2 2023-02-12 09:19:17 -08:00
Alexander Rose
6a5fb85c5a changelog 2023-02-12 09:13:40 -08:00
Alexander Rose
2aef5fb3e5 fix use of WEBGL_provoking_vertex 2023-02-12 09:12:24 -08:00
Jose Manuel Duarte
63a9aef5eb Fixing exit code for volume packer (#714)
* Fixing exit code for pack.ts

* Changelog

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-02-12 14:37:02 +01:00
Alexander Rose
e36fe8c707 fix polymer trace update logic 2023-02-11 21:26:03 -08:00
Alexander Rose
fc7af1f60c add lod to entities ui (for testing) 2023-02-11 13:23:01 -08:00
Alexander Rose
258cc1ef66 add scaleBias to lodLevels, consider element count 2023-02-11 13:14:39 -08:00
Alexander Rose
b3727f3774 fix getUnitsByEntity 2023-02-11 11:47:08 -08:00
Alexander Rose
b627d6a612 add mesoscale-explorer to webpack viewer config 2023-02-11 11:46:37 -08:00
Alexander Rose
918b83133e Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-02-11 11:45:35 -08:00
Alexander Rose
0585f7b9ca timer, mark ssao 2023-02-11 10:53:47 -08:00
Alexander Rose
25ab0d7799 fix outline artefact with opaque behind transparent 2023-02-11 10:49:43 -08:00
Alexander Rose
ea313a442c remove pca transform from components ui focus
- too distracting
2023-02-11 10:45:09 -08:00
Alexander Rose
6aed941fc9 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-02-05 20:07:59 -08:00
Alexander Rose
57a63e0381 3.31.1 2023-02-05 16:35:19 -08:00
Alexander Rose
c525812aee changelog 2023-02-05 16:30:41 -08:00
Alexander Rose
e602705e6d 3.31.0 2023-02-05 16:19:17 -08:00
Alexander Rose
b7d126b39b package updates 2023-02-05 16:13:46 -08:00
Alexander Rose
80b2864da8 remove unused travis file 2023-02-05 16:13:36 -08:00
Alexander Rose
36ba6f035a increase max intensity in light/ambient params 2023-02-05 15:45:39 -08:00
Alexander Rose
b22e5bb7dd tweak stats.calls 2023-02-05 15:41:09 -08:00
Alexander Rose
eca70d7536 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-02-05 15:14:44 -08:00
Alexander Rose
b84bbdace2 refactor PCA focus some more 2023-02-05 15:08:17 -08:00
Alexander Rose
750b2f69fc Merge pull request #710 from molstar/console-stats-timing
add consoleStats, improve timer
2023-02-05 14:00:51 -08:00
Alexander Rose
6ffe051a8e Merge branch 'master' of https://github.com/molstar/molstar 2023-02-05 13:43:36 -08:00
Alexander Rose
bc3640b264 add asymIds to OperatorGroup 2023-02-05 13:43:27 -08:00
Alexander Rose
8746b6e2f4 Observable canvas commit 2023-02-05 13:41:42 -08:00
dsehnal
445977d99b Fix data-source node workaround 2023-02-05 22:34:38 +01:00
Alexander Rose
0f0185e18c add fast boundary helper and unit trait 2023-02-05 13:34:33 -08:00
Alexander Rose
adf8e2932f Merge pull request #17 from arose/optimize-load
Optimize cellpack assembly creation, unit bbox computation & and show commit visual progress
2023-02-05 13:31:25 -08:00
dsehnal
a748b1581e refactor PCA focus 2023-02-05 22:24:40 +01:00
Alexander Rose
e35cde3d6b remove unused code 2023-02-05 13:07:32 -08:00
Alexander Rose
bbbb960b50 cellpack assembly transform 2023-02-05 12:35:56 -08:00
Alexander Rose
47a63e8906 Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into optimize-load 2023-02-05 11:29:34 -08:00
Ke Ma
af1e06203b Dev focus pca (#624)
* viewer camera change based on Pca

* minor code refactor

* update author

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-ui/structure/components.tsx

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* Update src/mol-plugin-state/manager/focus-camera/focus-first-residue.ts

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>

* revise

* deepclone

* chunked-array

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-02-05 20:27:25 +01:00
dsehnal
e9cbd06652 cellpack symmetry build optimization 2023-02-05 19:08:01 +01:00
Alexander Rose
356cf008ce add consoleStats, improve timer 2023-02-04 19:25:08 -08:00
Alexander Rose
07284e7e3d handle null-texture in calcTextureMeshColorSmoothing 2023-02-04 13:58:02 -08:00
Alexander Rose
72055442b7 add Color.contrast/.luminance 2023-02-04 10:30:14 -08:00
Alexander Rose
5fa7d84c23 axes camera-helper tweaks 2023-02-03 07:59:26 -08:00
midlik
de46f08bf4 Minor changes regarding HeadlessPluginContext (#708)
* Minor changes regarding HeadlessPluginContext

* Tweaks
2023-02-03 12:31:39 +01:00
Alexander Rose
fde395e2fa Merge pull request #705 from molstar/camera-helper-params
add axes camera-helper customization options
2023-02-01 08:10:47 -08:00
midlik
da1e55250e Added HeadlessPluginContext, Canvas3DRenderer, image-renderer example (#700)
* Added HeadlessPluginContext, Canvas3DRenderer, image-renderer example

* Fixed dependencies in package.json

* Removed gl from deps

* Removed gl, pngjs, jpeg-js from dependencies, importing via LazyImports

* Updated docs in src/examples/image-renderer/index.ts

* Added gl, pngjs, jpeg-js to optionalDependencies

* Canvas3DRenderer: default cameraResetDurationMs: 0 (necessary when changing camera between renderings)

---------

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2023-02-01 16:56:38 +01:00
Alexander Rose
a4ab117d14 support WEBGL_provoking_vertex 2023-01-31 19:56:03 -08:00
Alexander Rose
4cd7088eb8 add axes camera-helper customization options 2023-01-31 19:41:14 -08:00
Alexander Rose
8e1876fc25 update camera/handle helper on pixelRatio changes 2023-01-31 19:35:09 -08:00
Alexander Rose
29693ebe8c fix text zOffset with orthographic projection 2023-01-31 19:09:36 -08:00
Alexander Rose
a8ee7bfcbe fix uModelView construction 2023-01-31 19:04:46 -08:00
Alexander Rose
97fb6c044c Merge branch 'mesoscale-explorer' of https://github.com/arose/mesoscale-explorer into ssao-levels 2023-01-29 21:49:15 -08:00
Alexander Rose
85c5575b96 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-29 16:41:04 -08:00
Alexander Rose
2037dad03d 3.30.0 2023-01-29 16:28:11 -08:00
Alexander Rose
0a9fb603f6 changelog 2023-01-29 16:22:25 -08:00
Alexander Rose
0b7dadd345 package updates 2023-01-29 16:21:56 -08:00
Alexander Rose
a3645f5acc use single channel for downsampled depth when possible 2023-01-29 16:08:58 -08:00
Alexander Rose
92f409d6fc fix downsampled ssao 2023-01-29 16:08:18 -08:00
Alexander Rose
4ada0a0d29 use single channel for downsampled depth when possible 2023-01-29 15:13:08 -08:00
Alexander Rose
54714c06af fix downsampled ssao 2023-01-29 13:41:42 -08:00
Alexander Rose
c28dd8135c perf tweaks
- reuse vec3 in getMatrices
- fast path in createElementSphereImpostor
2023-01-28 23:08:39 -08:00
Alexander Rose
d3e674b135 use fast boundary for petworld structure 2023-01-28 17:24:34 -08:00
Alexander Rose
253d872599 add fast boundary helper and unit trait 2023-01-28 17:24:00 -08:00
Alexander Rose
b8ca8a9b34 refactor cellpack/petworld hierarchy creation 2023-01-28 17:00:46 -08:00
Alexander Rose
d180c26ca1 cache entity units mapping
- fix quadratic behavior
2023-01-28 14:01:12 -08:00
Alexander Rose
b51e50978e improve calcInstanceGrid perf 2023-01-28 11:28:32 -08:00
Alexander Rose
b897cfd028 perf tweaks
- reuse vec3 in getMatrices
- fast path in createElementSphereImpostor
2023-01-28 11:23:05 -08:00
Alexander Rose
2ce8863709 tweaks 2023-01-28 10:29:08 -08:00
dsehnal
37362968d9 buildAssembly improvements for lipid layer 2023-01-24 10:38:19 +01:00
dsehnal
800393bc2b Observable canvas commit 2023-01-23 23:54:39 +01:00
dsehnal
7a111c49f4 optimize assembly creation & bbbox computation 2023-01-23 13:48:53 +01:00
Alexander Rose
756ea140e2 ssao levels 2023-01-22 20:45:03 -08:00
Alexander Rose
f9400c2547 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-22 14:23:30 -08:00
Alexander Rose
3baa03ccdc adjust outlines based on view distance 2023-01-22 14:21:37 -08:00
Alexander Rose
659e96d93c Merge pull request #699 from MadCatX/ntc_tube_discontinuity
Fix NtC tube and Confal pyramids mesh when there are discontinuous chains
2023-01-22 14:14:51 -08:00
Alexander Rose
1a52c2bab4 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-22 11:50:24 -08:00
Alexander Rose
365d7d46fd fix SSAO artefacts with high bias values 2023-01-22 11:47:17 -08:00
Alexander Rose
f8284508e1 Merge pull request #695 from molstar/state-images
state snapshot images
2023-01-22 11:45:16 -08:00
Alexander Rose
e9c36c2375 fix boundary-helper regression 2023-01-19 21:43:57 -08:00
Michal Malý
5d269fd77c Check for discontinuities when buiilding Confal pyramids mesh 2023-01-17 17:30:30 +01:00
Michal Malý
0064293e01 Unregister ConfalPyramids 2023-01-17 17:30:30 +01:00
Michal Malý
ba4b6f70d3 Draw gaps in NtC tube if there are discontinuities in a chain 2023-01-17 17:30:28 +01:00
Alexander Rose
b4b79a6102 meso app, enable snapshot images 2023-01-16 13:24:07 -08:00
Alexander Rose
9d056a85ec state snapshot images 2023-01-15 22:59:33 -08:00
Alexander Rose
3ed17fce6b update gh workflow gl version 2023-01-15 22:53:34 -08:00
Alexander Rose
d656dd0d18 improve boundary calculation performance 2023-01-15 22:49:07 -08:00
Alexander Rose
b9054723d7 state snapshot images 2023-01-15 22:45:32 -08:00
Alexander Rose
ed37890519 cellpack/petworld preset tweak 2023-01-15 22:42:59 -08:00
Alexander Rose
22dc6bb1ea improve instance-grid creation performance 2023-01-15 22:39:57 -08:00
Alexander Rose
0917713613 improve boundary calculation performance 2023-01-15 22:38:55 -08:00
Alexander Rose
0b6be09678 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-15 14:14:43 -08:00
Alexander Rose
27c92085c7 changelog 2023-01-15 14:06:53 -08:00
Alexander Rose
94e9462af8 Merge pull request #526 from MadCatX/ntc_tube_2
Add NtC Tube representation
2023-01-15 14:05:29 -08:00
Michal Malý
2e52ccf5d8 Add NtC Tube representation 2023-01-15 22:18:13 +01:00
Michal Malý
b15196a284 Reset ConfalPyramidsIterator internal state correctly when switching
chains
2023-01-15 22:08:45 +01:00
Michal Malý
d29cc85439 Factor out common Dnatco code 2023-01-15 22:08:41 +01:00
Alexander Rose
30367cf239 lint spacing 2023-01-15 11:10:16 -08:00
Alexander Rose
500fdd31d7 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-15 10:13:42 -08:00
Alexander Rose
dcf9d1c3bb 3.29.0 2023-01-15 10:06:42 -08:00
Alexander Rose
c0c2e4ce4a changelog 2023-01-15 10:01:35 -08:00
Alexander Rose
3557f4e738 schema updates 2023-01-15 10:00:38 -08:00
Alexander Rose
6595c00cff package updates 2023-01-15 09:58:20 -08:00
Alexander Rose
ca9a566c25 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-15 09:07:31 -08:00
Alexander Rose
c612018ba8 Merge pull request #693 from molstar/dim-unmarked
support dim unmarked groups & marker edge strength
2023-01-15 09:04:35 -08:00
Alexander Rose
ec06ef2dfb fix missing uniforms 2023-01-14 13:14:16 -08:00
Alexander Rose
2febf45700 support dim unmarked groups & marker edge strength 2023-01-14 12:46:26 -08:00
Alexander Rose
3e6066a1a1 add .getCenter and .center to Camera 2023-01-14 12:41:41 -08:00
Alexander Rose
b61e5c76db add default to ParamDefinition.Values type 2023-01-14 12:40:13 -08:00
Alexander Rose
bdee4859f2 generic loci support for overpaint, substance, clipping 2023-01-14 12:39:25 -08:00
Alexander Rose
8386bf2ec6 wip, mesoscale-explorer app 2023-01-14 12:24:45 -08:00
Alexander Rose
a50443589f add .getCenter and .center to Camera 2023-01-14 12:06:13 -08:00
Alexander Rose
fd74bfe9c2 add default to ParamDefinition.Values type 2023-01-14 12:03:33 -08:00
Alexander Rose
f82693103a support dim unmarked groups & marker edge strength 2023-01-14 12:02:32 -08:00
Alexander Rose
cff72bcb67 fix 2023-01-09 20:27:57 -08:00
Alexander Rose
e3326fca29 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-09 20:19:43 -08:00
Alexander Rose
b5e45aae95 Merge pull request #692 from molstar/misc2
Misc2
2023-01-09 20:18:01 -08:00
Alexander Rose
7fd12c5622 tweaks/fixes 2023-01-09 20:16:33 -08:00
Alexander Rose
47442be989 changelog 2023-01-08 21:30:41 -08:00
Alexander Rose
3a484dc41a make SymmetryOperator.createMapping monomorphic 2023-01-08 21:25:23 -08:00
Alexander Rose
9a2dfd7e57 improve calculateInvariantBoundingSphere 2023-01-08 21:25:07 -08:00
Alexander Rose
c9a168a138 improve checks in UnitsRepresentation setVisualState 2023-01-08 21:24:35 -08:00
Alexander Rose
3726f28eeb defer calculation of more scene properties 2023-01-08 21:24:21 -08:00
Alexander Rose
ead25d6a9c tweak BoundaryHelper performance 2023-01-08 21:24:14 -08:00
Alexander Rose
55f4abb6be add repr/theme registry .clear method 2023-01-08 21:24:04 -08:00
Alexander Rose
7ccf376beb wip, explorer ui 2023-01-08 21:20:00 -08:00
Alexander Rose
8678ac301c improve checks in UnitsRepresentation setVisualState 2023-01-08 21:08:00 -08:00
Alexander Rose
dde6f10b22 defer calculation of more scene properties 2023-01-08 21:06:22 -08:00
Alexander Rose
f9f41dac6a make SymmetryOperator.createMapping monomorphic 2023-01-08 21:05:10 -08:00
Alexander Rose
af6ab0ec9e tweak BoundaryHelper performance 2023-01-08 20:56:20 -08:00
Alexander Rose
485e91796b improve calculateInvariantBoundingSphere 2023-01-08 20:53:59 -08:00
Alexander Rose
2451ad3f0a add repr/theme registry .clear method 2023-01-08 20:49:23 -08:00
Alexander Rose
b0125d139a Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2023-01-08 20:48:29 -08:00
dsehnal
2e013fafc8 Add StructureElement.Loci.forEachLocation 2023-01-05 13:07:21 +01:00
Alexander Rose
d0069b9684 wip, explorer state ui 2023-01-02 16:01:42 -08:00
dsehnal
0809379f91 update build badge 2023-01-02 14:23:36 +01:00
dsehnal
0d4a95f5af workflow name 2023-01-02 14:21:30 +01:00
Alexander Rose
ed6a6f71ce Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-31 12:08:48 -08:00
David Sehnal
2e9129a71c Fix some cyclic imports & reduce const enum usage (#680)
* fix mol-theme/color

* fix mol-theme/size

* remove unnecessary const enums

* remove Column.ValueType const enum

* NumberTypes

* ValueKindConst => ValueKinds

* more const enum fixes

* more const enums

* readme

* update filename

* typing

* FeatureTypes
2022-12-31 11:22:18 +01:00
David Sehnal
7384bebf4e Fix some cyclic imports & reduce const enum usage (#680)
* fix mol-theme/color

* fix mol-theme/size

* remove unnecessary const enums

* remove Column.ValueType const enum

* NumberTypes

* ValueKindConst => ValueKinds

* more const enum fixes

* more const enums

* readme

* update filename

* typing

* FeatureTypes
2022-12-31 11:22:05 +01:00
Alexander Rose
a042e72f28 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-30 20:46:24 -08:00
Alexander Rose
0e197b1885 Merge pull request #683 from molstar/misc
Misc tweaks
2022-12-30 20:45:46 -08:00
Alexander Rose
54697ae0d5 changelog 2022-12-30 10:16:30 -08:00
Alexander Rose
7b6eb9337e add input-color picker 2022-12-29 21:51:42 -08:00
Alexander Rose
a94fb84052 add isDisabled to ParameterMappingControl 2022-12-29 21:51:27 -08:00
Alexander Rose
528aeb1873 only update clip defines if changed 2022-12-29 21:51:18 -08:00
Alexander Rose
e7b35daf45 improve structure/unit areEqual methods
- always equal when objects are identical
2022-12-29 21:51:06 -08:00
Alexander Rose
7d10971617 avoid cloning of structure repr params 2022-12-29 21:50:49 -08:00
Alexander Rose
6ac12fd457 wip, mesoscale explorer app 2022-12-29 21:49:14 -08:00
Alexander Rose
0abedba665 avoid cloning of structure repr params 2022-12-29 11:42:59 -08:00
Alexander Rose
8bc688a491 improve structure/unit areEqual methods
- always equal when objects are identical
2022-12-29 10:20:36 -08:00
Alexander Rose
46524b19ab only update clip defines if changed 2022-12-29 10:17:32 -08:00
Alexander Rose
a9bcd4c1c6 add isDisabled to ParameterMappingControl 2022-12-29 10:16:52 -08:00
Alexander Rose
a355be9c0f add input-color picker 2022-12-27 12:02:22 -08:00
dsehnal
3d83211503 fix dropFiles bug 2022-12-24 12:51:09 +01:00
dsehnal
cd8c8fa020 Merge branch 'master' of https://github.com/molstar/molstar 2022-12-23 14:28:16 +01:00
Alexander Rose
4b663baa88 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-22 21:39:20 -08:00
David Sehnal
4c03009357 Volume Quick Color Select Control (#677)
* changelog

* volume quick select control

* tweak
2022-12-22 08:53:27 +01:00
Alexander Rose
047f547863 support tags in StructureBuilder.createStructure 2022-12-21 20:25:03 -08:00
Alexander Rose
83c62c614b Merge branch 'master' of https://github.com/molstar/molstar 2022-12-21 20:24:22 -08:00
Alexander Rose
c39b3569de add escapeRegExp util 2022-12-21 20:24:06 -08:00
Alexander Rose
22402280a7 wip, mesoscale explorer app 2022-12-21 20:13:02 -08:00
Alexander Rose
7e9872871d support tags in StructureBuilder.createStructure 2022-12-21 20:12:09 -08:00
Alexander Rose
6c595377a3 add escapeRegExp util 2022-12-21 20:11:14 -08:00
dsehnal
7fea62aa46 changelog 2022-12-20 14:28:07 +01:00
midlik
d816f510ea Volseg more tweaks 2 (#675)
* Volseg: Fixed not loading volume section from state

* Volseg: Double-sided meshes (still ugly)

* Mesh extension: Detection (and correction) of inverted meshes

* Meshes extension: Fixed transparent backfaces, tidy up

* Removed duplicated classes in Meshes and Volseg extensions

* Changelog
2022-12-20 14:24:31 +01:00
Alexander Rose
56ed5a784d Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-19 16:19:59 -08:00
dsehnal
c2064aa318 3.28.0 2022-12-20 00:37:33 +01:00
dsehnal
109709ce8b Merge branch 'master' of https://github.com/molstar/molstar 2022-12-20 00:34:53 +01:00
midlik
b200725762 Volseg more tweaks (#674)
* Volseg: Fixed not loading volume section from state

* Volseg: Double-sided meshes (still ugly)

* Mesh extension: Detection (and correction) of inverted meshes
2022-12-20 00:34:40 +01:00
dsehnal
9cf34bf987 changelog 2022-12-20 00:27:00 +01:00
Alexander Rose
be3a91bb14 package updates 2022-12-19 15:21:10 -08:00
Alexander Rose
fc948d8b27 fix gpu mc use of float16 2022-12-19 14:41:12 -08:00
midlik
8774658f4e Volseg: Fixed not loading volume section from state (#672)
* Volseg: Fixed not loading volume section from state

* Volseg: Double-sided meshes (still ugly)
2022-12-19 23:19:53 +01:00
David Sehnal
0bf32148af Viewer setting for volumes and segmentations (#673) 2022-12-19 23:10:40 +01:00
David Sehnal
97d158b615 Volseg extenison tweaks (#671)
* improve currentVolume behavior

* use different iso-value if 1sigma isnt present in the data
2022-12-19 22:16:09 +01:00
Alexander Rose
b772dea188 tweak ignoreHydrogens non-polar handling (#669) 2022-12-19 21:59:55 +01:00
Alexander Rose
5c8f0b35ec changelog 2022-12-19 10:33:36 -08:00
dsehnal
1b382653f2 add volume controls to Volseg extension 2022-12-19 16:49:30 +01:00
midlik
c7cee63c97 Volumes & Segmentations extension (#668)
* Created CellStar state action

* CellStar: download metadata

* Right panel - CellStar UI

* CellStar: Lattice segmenatation and fitted PDB models

* CellStar: Support for source-database entry ID from metadata

* CellStar: Mesh segmentation

* CellStar: Switching between multiple entries

* CellStar: Changed default API URL

* UI updates

* CellStar: Clicking on meshes shows annotations...

* support info in Converted param

* support color/size in VolumeRepresentation3DHelpers.getDefaultParams

* support multi-visual volume representations

- repr can provide list of keys
- create visual for each key

* add volume segmentation support

- segmentation property
- segment loci & location

* add volume-segment color theme

* add volume segment representation

* use optional chaining

* add support for volume segmentation cif

* improve isosurface bounding-sphere

* fix segcif schema type

* CellStar: Highlighting segments on hover in the right panel

* CellStar: Using new Mol*-native segment visualization

* lint

* Segmentation volume can have custom segment labels

* CellStar: Segment labels for Mol*-native segments

* CellStar: Removed old implementation of segments

* CellStar: Rename CellStarLatticeSegmentationData2 -> CellStarLatticeSegmentationData

* CellStar: Default volume server is https://cellstar.ncbr.muni.cz

* CellStar: debugging

* CellStar: Fixed bug in LatticeSegmentation (scaling)

* CellStar: Partially savable state

* CellStar: WaitingSlider

* CellStar: Opacity changed via params

* Savable state for opacity

* CellStar: Changing UI in animations

* CellStar: Savable state for whole current UI

* CellStar: Savable state for segment labels

* CellStar: Source can be 'idr', CellStarVolumeServerConfig.DefaultServer

* CellStar: Select segment for lattice segmentation

* CellStar: Select segment, complete

* CellStar: Changes visible labels to "Volume & Segmentation"

* CellStar: Drop list with available entries

* CellStar: Volume type switching (partial)

* CellStar: Trying to set direct-volume control points

* CellStar: Volume visual switching

* Mesh extension: removed molstar-lib-imports

* CellStar: Global options

* CellStar: Updated file headers and `CHANGELOG.md`

* CellStar: UI controls disabled while executing change

* CellStar: Hidden state nodes, fixed bug with removed global state

* CellStar: Volume opacity slider

* CellStar extension renamed to Volseg

* UI tweaks

Co-authored-by: Alexander Rose <alexander.rose@weirdbyte.de>
2022-12-19 16:15:23 +01:00
Alexander Rose
fbb9f09536 tweak interior in presets 2022-12-17 21:25:38 -08:00
Alexander Rose
d8e5b9a5c6 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-17 21:18:44 -08:00
Alexander Rose
ba9474fa62 add stencil related webgl state and format 2022-12-16 21:47:05 -08:00
Alexander Rose
b7ec7ea686 Merge pull request #665 from molstar/solid-impostor
Solid impostors
2022-12-16 21:41:14 -08:00
Alexander Rose
74560adb08 changelog 2022-12-16 21:20:52 -08:00
Alexander Rose
e6a303bdda Merge branch 'master' of https://github.com/molstar/molstar into solid-impostor 2022-12-16 21:19:19 -08:00
David Sehnal
7afcf0bb68 Show histogram in direct volume control point settings (#666) 2022-12-16 20:02:46 +01:00
Alexander Rose
7aae2d0616 fix impostor sphere near clipping 2022-12-15 22:06:06 -08:00
dsehnal
9255505a3b 3.27.0 2022-12-15 13:02:37 +01:00
dsehnal
6c0dfd338d changelog 2022-12-15 12:59:45 +01:00
David Sehnal
c306e988c8 Ability to show only polar hydrogens (#663) 2022-12-15 12:26:34 +01:00
Alexander Rose
86f7a8b273 add impostor solidInterior param 2022-12-14 22:50:15 -08:00
David Sehnal
2428a8efab Merge pull request #660 from molstar/struct-conn-ions-fix
Fix struct_conn bond assignment for ions
2022-12-14 10:20:22 +01:00
Alexander Rose
cba12e487f wip, solid impostor flag 2022-12-13 23:59:08 -08:00
dsehnal
e98d7931ca Fix import 2022-12-13 18:01:59 +01:00
dsehnal
f8e2d2e3d0 tweak hasStructConnRecord 2022-12-13 17:57:31 +01:00
dsehnal
4455bab6ac Fix struct_conn bond assignment for ions 2022-12-13 16:06:19 +01:00
David Sehnal
b21fb27041 Merge pull request #658 from molstar/action-params
ApplyActionControl param handling
2022-12-13 15:20:31 +01:00
dsehnal
5402ee0019 ApplyActionControl param handling 2022-12-13 15:16:19 +01:00
David Sehnal
02654ea57b Merge pull request #657 from molstar/fix-qa-assignment
Fix QualityAssessment assignment
2022-12-13 09:33:13 +01:00
dsehnal
9cd4aeabaa Merge branch 'master' of https://github.com/molstar/molstar into fix-qa-assignment 2022-12-13 09:32:42 +01:00
dsehnal
d788511a83 header 2022-12-13 09:32:20 +01:00
Alexander Rose
378b5b8096 Merge pull request #643 from arussell123/master
Add include transparent parameter for outlines
2022-12-12 21:58:49 -08:00
Alexander Rose
e26eb2f751 Merge branch 'master' into master 2022-12-12 21:58:25 -08:00
Alexander Rose
26264b15f7 tweaks 2022-12-12 21:56:34 -08:00
Alexander Rose
309e3dd981 impostor per-pixel object clipping 2022-12-12 21:51:39 -08:00
Alexander Rose
4ff5ed3b5d fix cylinder imposter cap normals 2022-12-12 21:18:37 -08:00
dsehnal
270a757756 changelog 2022-12-12 18:39:41 +01:00
dsehnal
79e4030ab4 fix qa assignment 2022-12-12 18:35:52 +01:00
David Sehnal
fd86927e04 Merge pull request #655 from MKampfrath/access-modifiers
change access modifiers
2022-12-12 16:36:38 +01:00
MKampfrath
df3a7e5037 change access modifiers 2022-12-12 16:30:40 +01:00
Alice Russell
fefc6f14c9 Change is outline enabled to is transparant outline enabled 2022-12-12 10:43:14 +00:00
Alexander Rose
923fbef0e4 remove superfluous check 2022-12-11 20:45:26 -08:00
Alexander Rose
601bd5ba7a improve impostor shaders
- fix sphere near-clipping with orthographic projection
- fix cylinder near-clipping
- add interior cylinder caps
2022-12-10 21:47:16 -08:00
Alexander Rose
5798f20c41 lint fix 2022-12-10 21:41:25 -08:00
David Sehnal
f2e26f91a8 Merge pull request #647 from dwilliams-nobias/animation-once-stops
Animation "once" fails to stop for many frames under certain conditions
2022-12-08 16:53:27 +01:00
David Sehnal
e2cdc45be6 Merge branch 'master' into animation-once-stops 2022-12-08 16:53:15 +01:00
Alice Russell
96493bc75e Fix linting 2022-12-07 14:26:48 +00:00
Alice Russell
d78ad4a78e Merge remote-tracking branch 'upstream/master' 2022-12-07 12:25:22 +00:00
Alice Russell
0c54b0dd6e Add option to toogle transparent outline 2022-12-07 12:21:31 +00:00
Alexander Rose
65310e52de guard against issue with bumpiness in impostors 2022-12-06 22:48:22 -08:00
David Williams
285d3cd9b8 Requested changes for pull request 2022-12-06 17:36:48 -08:00
David Williams
10486abb64 Add example molecule with 1,000 animation frames 2022-12-06 17:32:44 -08:00
David Williams
8c1a9fc988 Correctly check for duration "once" for fixed or computed duration 2022-12-06 16:57:27 -08:00
Alexander Rose
b067b0eed5 Merge branch 'master' of https://github.com/molstar/molstar into mesoscale-explorer 2022-12-04 12:20:32 -08:00
Alexander Rose
7bdd0b470b 3.26.0 2022-12-04 12:18:09 -08:00
Alexander Rose
b7a51f12bf changelog 2022-12-04 12:12:22 -08:00
Alexander Rose
e002ac5474 Merge pull request #644 from molstar/power-pref
support power-preference webgl attribute
2022-12-04 12:09:46 -08:00
Alexander Rose
211d339ce0 Merge branch 'master' into power-pref 2022-12-04 12:09:39 -08:00
Alexander Rose
509fb14473 Merge pull request #645 from molstar/structure-mol-surf
add structure molecular surface visual
2022-12-04 12:09:14 -08:00
Alexander Rose
ef838a1b83 Merge branch 'master' into structure-mol-surf 2022-12-04 12:09:05 -08:00
Alexander Rose
f84b5b633d improve Representation typing 2022-12-04 09:45:12 -08:00
Alexander Rose
8ec8c1170d comment 2022-12-04 09:32:02 -08:00
David Sehnal
920b98e4d1 Merge pull request #604 from molstar/volume-theme
by-volume-value theme
2022-12-04 09:18:32 +01:00
dsehnal
c80f52d4bc Merge branch 'master' of https://github.com/molstar/molstar into volume-theme 2022-12-04 09:14:41 +01:00
dsehnal
0b6aa42daf tweaks 2022-12-04 09:14:06 +01:00
Alexander Rose
04dc6427ef update SaccharideNames 2022-12-03 22:00:24 -08:00
Alexander Rose
77e366b484 schema updates 2022-12-03 21:58:04 -08:00
Alexander Rose
add7cfa0f2 package updates 2022-12-03 21:53:00 -08:00
Alexander Rose
14d4fa142c changelog 2022-12-03 21:46:55 -08:00
Alexander Rose
7fe1617f25 shadow param tweaks 2022-12-03 21:46:30 -08:00
Alexander Rose
cbe4cb521c add structure molecular surface visual 2022-12-03 21:32:54 -08:00
Alexander Rose
d6dffe89d6 Merge pull request #1 from arose/lod-cull
Lod cull
2022-12-03 21:12:53 -08:00
Alexander Rose
0107159b84 changelog 2022-12-03 18:21:50 -08:00
Alexander Rose
c106b99d5d fix renderer spec 2022-12-03 18:18:10 -08:00
Alexander Rose
2f695ca68f changelog 2022-12-03 17:40:57 -08:00
Alexander Rose
461592f6e3 add shadow to petworld preset 2022-12-03 17:31:53 -08:00
Alexander Rose
ccf3b5c75d Merge branch 'master' of https://github.com/molstar/molstar into lod-cull 2022-12-03 16:24:48 -08:00
Alexander Rose
a40702cda4 compat docs 2022-12-03 12:19:26 -08:00
Alexander Rose
7c394525c1 Merge pull request #637 from molstar/sss
Screen-space shadows
2022-12-03 10:59:05 -08:00
Alexander Rose
12ed051fea Merge pull request #606 from jpattle/remove-caps-from-ligand-query
Remove common protein caps from ligand query
2022-12-03 10:41:00 -08:00
Alexander Rose
014913c635 support power-preference webgl attribute 2022-12-03 10:17:57 -08:00
Alexander Rose
369e45c282 handle bounds in shadow screen fade 2022-12-03 10:02:14 -08:00
Alice Russell
2892caec0c Update changelog 2022-12-02 12:31:56 +00:00
Alice Russell
eb609e918a linting fixes 2022-12-02 12:28:51 +00:00
Alice Russell
9217e58845 Add option to set minimum alpha value for outlines to be shown 2022-12-02 12:12:22 +00:00
Alexander Rose
a5ad456b52 Merge branch 'master' of https://github.com/molstar/molstar into lod-cull 2022-11-28 11:45:06 -08:00
Alexander Rose
26b633618a tweak cellpack shadow params 2022-11-27 22:22:29 -08:00
Alexander Rose
e3054d6ee1 shadows bonds check 2022-11-27 22:07:23 -08:00
Alexander Rose
0b6294f4ec check for shadow in PostprocessingPass.isEnabled 2022-11-26 22:33:11 -08:00
Alexander Rose
7b130dc0f3 cleanup 2022-11-26 22:09:24 -08:00
Alexander Rose
d93c128c25 cleanup 2022-11-26 22:04:41 -08:00
Alexander Rose
e1dd74775e refactor sss
- only sss, remove other ao implementations
- tweak params
- make sss a separate renderable
2022-11-26 21:47:08 -08:00
Alexander Rose
e61e706607 Merge branch 'master' of https://github.com/molstar/molstar into fake_shadow 2022-11-25 21:13:35 -08:00
jpattle
a57d46deaa Merge branch 'master' into remove-caps-from-ligand-query 2022-11-21 08:58:41 +00:00
Alexander Rose
60efdc0071 3.25.1 2022-11-20 10:43:31 -08:00
Alexander Rose
4dc1155a9e changelog 2022-11-20 10:38:07 -08:00
Alexander Rose
5cabe6fb42 fix auto structure-quality for coarse models 2022-11-20 10:37:30 -08:00
Alexander Rose
42239c305f better handle single-element units in Structure.eachUnitPair 2022-11-20 10:25:26 -08:00
ludovic autin
fd3c763349 All parameters exposed to try to find best parameters for different representation. 2022-11-18 09:13:42 -08:00
ludovic autin
daa9bbf2c9 fix trailing space 2022-11-17 09:31:21 -08:00
ludovic autin
c7dad00908 fake screen space shadow, second pass ssao 2022-11-17 09:28:00 -08:00
ludovic autin
24317717e8 Merge remote-tracking branch 'upstream/master' into forkdev 2022-11-16 14:01:04 -08:00
dsehnal
dd3eac6db6 3.25.0 2022-11-16 00:15:41 +01:00
dsehnal
1606f8517f changelog 2022-11-16 00:12:57 +01:00
David Sehnal
3a98401ada Merge pull request #623 from JonStargaryen/master
Fix Handling of Gzipped Assets by Reverting #615
2022-11-16 00:11:02 +01:00
Alexander Rose
4764251241 operator key tweaks 2022-11-14 21:48:44 -08:00
Sebastian Bittrich
3de04b7b9d CHANGELOG 2022-11-14 13:17:15 -08:00
Sebastian Bittrich
04908495e9 Revert "keep asset url to detect compression"
This reverts commit 2bc45c25fe.
2022-11-14 13:13:06 -08:00
Alexander Rose
357243c717 set marking off by default for mesoscale loaders 2022-11-13 22:39:00 -08:00
Alexander Rose
23f1d57064 Merge branch 'master' of https://github.com/molstar/molstar into lod-cull 2022-11-13 21:21:22 -08:00
Alexander Rose
3c835c848e 3.24.0 2022-11-13 20:56:58 -08:00
Alexander Rose
0f1788f122 changelog 2022-11-13 20:51:24 -08:00
Alexander Rose
3d72e700a4 package updates 2022-11-13 20:48:33 -08:00
Alexander Rose
a5cf41e65f fix viewport color for transparent background (#617) 2022-11-13 20:47:30 -08:00
Alexander Rose
7029bc41d7 Merge pull request #621 from molstar/theme-strength
add theme strength to 3d repr state
2022-11-13 20:22:14 -08:00
Alexander Rose
b87d40c844 changelog 2022-11-13 20:21:41 -08:00
Alexander Rose
9e154376d3 Merge branch 'master' of https://github.com/molstar/molstar into theme-strength 2022-11-13 20:18:56 -08:00
Alexander Rose
4a9fdbce57 Merge pull request #619 from molstar/opkey
add key to symmetry operator
2022-11-13 20:18:12 -08:00
Alexander Rose
775e335292 remove cantor-pair use 2022-11-13 20:11:42 -08:00
Alexander Rose
e553bf4deb add theme strength to 3d repr state 2022-11-12 21:58:13 -08:00
Alexander Rose
db0e09ec6e add more webgl extensions
- draw_buffers_indexed
- parallel_shader_compile
- fbo_render_mipmap
2022-11-12 20:34:18 -08:00
Alexander Rose
ba50760f92 add key to symmetry operator
- molql operatorKey
- index-pair operator prop
2022-11-12 20:30:33 -08:00
Alexander Rose
a56a2500d4 improve cellpack cif support 2022-11-12 20:27:34 -08:00
Alexander Rose
4950bb9e0a various lod tweaks & fixes 2022-11-12 16:25:24 -08:00
Alexander Rose
7fc409a8d1 cellpack & petworld cif loader improvements 2022-11-12 10:16:14 -08:00
Alexander Rose
f52872718c emulate gl_DrawID as needed 2022-11-12 09:44:08 -08:00
Alexander Rose
abca6e3bf7 share vertex-array between program variants 2022-11-12 09:32:20 -08:00
David Sehnal
524e6d4f81 Merge pull request #615 from JonStargaryen/master
keep asset url to detect compression
2022-11-11 07:47:44 +01:00
ludovic autin
db93a669ab Merge branch 'molstar:master' into forkdev 2022-11-10 13:59:26 -08:00
Sebastian Bittrich
423f5b0502 CHANGELOG 2022-11-10 13:16:27 -08:00
Sebastian Bittrich
2bc45c25fe keep asset url to detect compression 2022-11-10 13:13:49 -08:00
Alexander Rose
4fedef90c7 adjust radius for lod in sphere shader 2022-11-08 21:44:02 -08:00
Alexander Rose
69ca72ff86 rename MultiDrawInstancedData to MultiDrawBaseData 2022-11-08 21:42:30 -08:00
Jason Pattle
d341463f67 Removed unneccessary wholeResidues query from new ligand selection query as the atomGroups residue-test already covers this functionality 2022-11-07 08:37:16 +00:00
Alexander Rose
19d1ecb36a add (slow) texture-mesh position iterator 2022-11-06 23:27:17 -08:00
Alexander Rose
ffe4047f97 fix vertex color/overpaint in direct-volume shader 2022-11-06 22:24:36 -08:00
Alexander Rose
15a3c29e7a adjust external-volume theme file name 2022-11-06 22:23:15 -08:00
Alexander Rose
6a32f85e60 Merge pull request #603 from giagitom/transparent-bg-fixes 2022-11-06 16:42:27 -08:00
Alexander Rose
542a4725ad add elements-based lod levels for spheres 2022-11-06 15:14:14 -08:00
Alexander Rose
5d8bd6f474 support rendering elements-based lod levels 2022-11-06 15:13:32 -08:00
Alexander Rose
d8b98cc39d add instance-grid culling support 2022-11-06 15:00:05 -08:00
Alexander Rose
1d558c32d5 add per-object lod support 2022-11-06 13:13:32 -08:00
Alexander Rose
72c560e5a2 fix missing material texture disposal 2022-11-06 12:54:25 -08:00
Alexander Rose
268246e1ef cleanup types 2022-11-06 12:51:19 -08:00
Alexander Rose
8957f8a55f ignore built-ins in checkActiveUniforms 2022-11-06 12:50:14 -08:00
Alexander Rose
cdf7a1dfe8 add InstanceGrid to group instances spatially 2022-11-06 12:49:57 -08:00
Alexander Rose
398d82f359 frustum culling of whole render-objects 2022-11-06 12:43:53 -08:00
Alexander Rose
11fb1b655f support changing offset of gl attributes 2022-11-06 12:38:31 -08:00
Alexander Rose
5032a2538a add Plane3D and Frustum3D math objects 2022-11-06 12:31:24 -08:00
Alexander Rose
cabc0e5344 remove multi draw emulation from compat
- can't emulate gl_DrawID there
2022-11-05 11:12:55 -07:00
Alexander Rose
fe1414dd6b improve typing of various toArray functions 2022-11-05 09:00:59 -07:00
Jason Pattle
42ff593004 Added missing semicolon; linting 2022-11-02 10:06:26 +00:00
Jason Pattle
5140af4e6f Added myself as a contributor to package.json 2022-11-02 09:56:07 +00:00
Jason Pattle
0f5b4c00a9 Updated changelog 2022-11-02 09:54:57 +00:00
Jason Pattle
feb69f4987 Excluded whole residues which match any common protein caps from the ligand selection query 2022-11-02 09:49:44 +00:00
Jason Pattle
84eb9a58ca Added names for common protein caps 2022-11-02 09:49:07 +00:00
dsehnal
fbd96f473a External Volume theme features 2022-11-01 11:54:27 +01:00
dsehnal
69228157dc fix typo 2022-10-31 15:42:13 +01:00
dsehnal
6808f32b8d by-volume-value theme 2022-10-31 15:41:10 +01:00
giagitom
f29c62ec33 Transparent bg fix 2022-10-30 12:06:32 +01:00
Alexander Rose
13cee09a1c fix multi draw webgl extension handling
- no gl_DrawID when emulated
- add missing .bind(gl/ext)
- use typed arrays in signatures
2022-10-30 00:18:16 -07:00
Alexander Rose
d77981230b mmcif schema update 2022-10-29 12:15:29 -07:00
Alexander Rose
eb5c6bd30a add support for more webgl extensions
- WEBGL_draw_instanced_base_vertex_base_instance
- WEBGL_multi_draw_instanced_base_vertex_base_instance
2022-10-27 21:29:58 -07:00
dsehnal
e2b92c15f0 PluginContext.initContainer options 2022-10-27 08:41:01 +02:00
Alexander Rose
6f5e6f2fe2 improve Vec3 and Box3D
- add Vec3.clamp
- add Vec3.transformDirection
- add Box3D.addSphere3D
- add Box3D.intersectsSphere3D
- add Box3D.containsSphere3D
2022-10-26 22:32:23 -07:00
Alexander Rose
fc8c932874 add stride param to element sphere/point visual 2022-10-26 22:10:32 -07:00
Alexander Rose
784523e635 misc tweaks 2022-10-26 22:09:01 -07:00
Alexander Rose
56db418949 improve canvas3d consoleStats 2022-10-26 22:02:30 -07:00
Alexander Rose
31d6e81a59 add basic petworld extension 2022-10-26 22:01:34 -07:00
Alexander Rose
6356628c80 add support for webgl multiDraw extension 2022-10-26 21:58:51 -07:00
dsehnal
14614f4803 3.23.0 2022-10-19 13:11:47 +02:00
dsehnal
37d3489b07 changelog 2022-10-19 13:09:02 +02:00
David Sehnal
f81225cc0d Merge pull request #592 from molstar/volume/defaults-for-em
Change EM Volume Streaming default Auto
2022-10-19 13:08:17 +02:00
dsehnal
eb47f43940 Change EM Volume Streaming default Auto 2022-10-19 13:05:16 +02:00
dsehnal
7618a5e2c9 pr template 2022-10-19 12:41:24 +02:00
David Sehnal
ab3ff842b2 Merge pull request #590 from molstar/reusable-canvas
Built-in support for mouting/unmounting PluginContext
2022-10-19 09:55:31 +02:00
dsehnal
82f0f92c15 remove unused code 2022-10-18 15:20:48 +02:00
dsehnal
545d9434d8 Add PluginContext.initContainer/canvas3dInitialized and their usage 2022-10-18 09:16:08 +02:00
dsehnal
bbc43d5113 Add PluginContext.mount/unmount 2022-10-18 08:41:29 +02:00
dsehnal
a6709acf65 3.22.0 2022-10-17 20:44:13 +02:00
dsehnal
509a027742 changelog 2022-10-17 20:41:35 +02:00
David Sehnal
7244023233 Merge pull request #589 from molstar/picking-granuality-v2
Volume.PickingGranuality custom property
2022-10-17 20:39:47 +02:00
dsehnal
c5f987d8b2 getSliceLoci tweak 2022-10-17 20:36:39 +02:00
dsehnal
793696d4c0 Volume slice granuality 2022-10-17 20:34:11 +02:00
dsehnal
305ca05f04 tweaks 2022-10-17 20:24:48 +02:00
dsehnal
f4d7d1920a typos 2022-10-17 20:12:19 +02:00
dsehnal
458aad0161 Volume.PickingGranuality custom property 2022-10-17 20:05:56 +02:00
dsehnal
9e3132461f 3.21.0 2022-10-17 17:32:57 +02:00
dsehnal
8301291215 changelog 2022-10-17 17:29:52 +02:00
David Sehnal
daed14e228 Merge pull request #588 from midlik/picking-whole-isosurfaces
New volume isosurface param pickingGranularity: voxels|surfaces
2022-10-17 17:27:34 +02:00
David Sehnal
7db82c5ba5 Merge pull request #584 from arussell123/master
Prevent component controls collapsing when option is selected
2022-10-17 16:43:01 +02:00
Alexander Rose
91d03c22c2 3.20.0 2022-10-16 21:42:39 -07:00
Alexander Rose
bc188f0d2b changelog 2022-10-16 21:37:18 -07:00
Alexander Rose
3981225824 package updates 2022-10-16 21:34:59 -07:00
Alexander Rose
1886d9d72f add structure-index color theme 2022-10-16 21:28:06 -07:00
Alexander Rose
2a7dec8892 Merge pull request #583 from jpattle/model-index-carbon-color
Model index updates & carbon color
2022-10-16 19:43:23 -07:00
Alexander Rose
35d4a5b297 Merge branch 'master' into model-index-carbon-color 2022-10-16 19:39:22 -07:00
Alexander Rose
26345bfa50 tweak 2022-10-16 17:42:43 -07:00
Alexander Rose
8c9b8676dd handle 'not enough samples' in distinctColors 2022-10-16 16:43:50 -07:00
Alexander Rose
5593c7a75f add Model.MaxIndex and use in model-index theme 2022-10-16 16:37:09 -07:00
Alexander Rose
5b70c14ffe tweak theme descriptions 2022-10-16 16:35:51 -07:00
Alexander Rose
5e4d611044 tweak changelog 2022-10-16 16:33:52 -07:00
David Sehnal
7ab9d57156 Merge pull request #545 from giagitom/lookup3d
adding nearest and distance to point methods to lookup3d
2022-10-14 21:46:33 +02:00
Adam Midlik
9ea6f51126 New volume isosurface param pickingGranularity: voxels|surfaces 2022-10-13 00:57:39 +02:00
giagitom
649fe4f4f0 Lint fix 2022-10-12 16:57:56 +02:00
giagitom
53df86c585 Avoid using unnecessary extractMinimum from heap if k=1 on nearest search, add nearest method as unreleased. 2022-10-12 16:14:51 +02:00
Alice Russell
87c708e3c1 Remove action state from being set to undefined when action selected to stop options from minimising on selection 2022-10-12 10:58:30 +01:00
Jason Pattle
ba927b0490 returned clone of theme params for model and trajectory index themes, added contributor name 2022-10-12 08:30:52 +01:00
Jason Pattle
2a09725c98 added the new model-index color theme as an option in the illustrative color-theme 2022-10-12 08:30:10 +01:00
Jason Pattle
9fa0d17933 removed carbon color adjustment option 2022-10-12 08:29:45 +01:00
Jason Pattle
8d9f8a996a Updated change log with changes to model-index and element-symbol 2022-10-12 08:29:17 +01:00
giagitom
8814b60d0b Increased performances of lookup3d nearest search. 2022-10-11 18:12:27 +02:00
Jason Pattle
541c07c53a Added a parameter to make adjusting the carbon color by the same saturation and lightness carbon colors optional 2022-10-11 16:19:17 +01:00
Jason Pattle
6cbed80815 updated the default color palette and removed the redundant model color map 2022-10-11 16:07:44 +01:00
Jason Pattle
a3c1fdc0f4 Added the model index theme provider as an option for the carbon color when selecting the element-symbol color theme 2022-10-11 15:53:05 +01:00
Jason Pattle
ddf789b01c added a new model-index color theme based off the trajectory index theme but instead using the Model.Index structure property 2022-10-11 15:50:23 +01:00
Jason Pattle
ab86cc0bf3 Renamed the model-index color theme file to trajectory-index 2022-10-11 15:37:04 +01:00
Jason Pattle
dc8fab5820 [BREAKING CHANGE] renamed the model-index color theme and its usages to trajectory-index to better reflect the functionality of the color theme 2022-10-11 15:35:29 +01:00
giagitom
813c4f845a Merge branch 'master' into lookup3d 2022-10-09 15:10:37 +02:00
dsehnal
509e6bc2d8 add TrajectoryFromMmCif.loadAllBlocks param 2022-10-09 14:36:33 +02:00
Alexander Rose
6ed42e9521 add mipmap-based blur for skybox backgrounds 2022-10-08 14:54:29 -07:00
Alexander Rose
fb01ba60ec use resources object to get textures for smaa pass 2022-10-08 14:08:07 -07:00
Alexander Rose
ea4210ded5 add willReadFrequently option to sdf text 2d context 2022-10-08 14:06:25 -07:00
Alexander Rose
75e5cf54d6 remove deprecated vscode extension from recommendations 2022-10-08 14:05:12 -07:00
Jason Pattle
7cebc85a95 fixed linting warnings 2022-10-06 13:02:15 +01:00
Jason Pattle
c00faafa6d Returned a clone of the element symbol params instead of the original const, removing a todo comment 2022-10-06 11:42:53 +01:00
Jason Pattle
c9b14f0742 Updated the element symbol color theme so that the carbon color is also adjusted by saturation and brightness props 2022-10-06 09:13:33 +01:00
Alexander Rose
9624137c0d 3.19.0 2022-10-01 17:26:48 -07:00
Alexander Rose
3eb433368f changelog 2022-10-01 17:21:18 -07:00
Alexander Rose
58691f4f5f package updates 2022-10-01 17:19:59 -07:00
Alexander Rose
5e9295abd5 changelog 2022-10-01 15:45:17 -07:00
Alexander Rose
6ed0ae55b2 fix black artifacts
- on specular highlights with transparent background
2022-10-01 15:34:54 -07:00
Alexander Rose
84448d0aa1 Merge branch 'master' of https://github.com/molstar/molstar 2022-10-01 13:51:58 -07:00
Alexander Rose
31ced24966 Merge pull request #573 from molstar/optimize-binary-packing
Optimize BinaryCIF integer packing
2022-10-01 13:51:21 -07:00
Alexander Rose
24681840af debug tweaks 2022-10-01 13:34:50 -07:00
Alexander Rose
5d28aa4f2e add cameraClipping.minNear param 2022-10-01 13:32:09 -07:00
Alexander Rose
7dabdf3085 dpoit fixes
- when post-processing is off
- when rendering direct-volumes
2022-10-01 13:26:10 -07:00
giagitom
d7cbd5570c Implement lookup & grid nearest search using fibonacci heap 2022-09-30 15:44:10 +02:00
dsehnal
80011d4aea optimize BinaryCIF integer packing 2022-09-29 17:30:26 +02:00
David Sehnal
c6fe440a01 Merge pull request #569 from russellp17/fix-empty-texture-error-on-empty-canvas
Fix "empty textures" error on empty canvas
2022-09-27 16:52:28 +02:00
Russell Parker
ba8d6dc3fa Fix "empty textures" error on empty canvas 2022-09-27 10:24:55 -04:00
giagitom
378f4f8304 Merge branch 'master' into lookup3d 2022-09-19 10:22:43 +02:00
Alexander Rose
aa414485a5 3.18.0 2022-09-17 11:55:04 -07:00
Alexander Rose
3a35a5d66a changelog 2022-09-17 11:49:08 -07:00
Alexander Rose
43b0a72b09 package updates 2022-09-17 11:49:01 -07:00
Alexander Rose
521ac2d13f stereo camera improvements
- fix param updates not applied
- better param ranges and description
- add timer.mark for left/right camera
2022-09-17 11:43:18 -07:00
Alexander Rose
30520c50c2 fix changelog 2022-09-17 11:39:40 -07:00
Alexander Rose
819f07eba3 Merge pull request #533 from giagitom/dpoit
Integration of Dual depth peeling - OIT method
2022-09-17 11:36:56 -07:00
Alexander Rose
d8d6aa7136 wboit, tweak timer.mark 2022-09-17 11:34:48 -07:00
giagitom
0bdcfea276 Merge branch 'master' into lookup3d 2022-09-16 17:45:20 +02:00
giagitom
718f76313f Adding nearest method to lookup3d at unit and structure level. 2022-09-16 17:32:07 +02:00
Alexander Rose
ed75a365d8 dpoit, cleanup 2022-09-12 22:38:49 -07:00
Alexander Rose
f5ff13ffe4 dpoit, fix transparent background 2022-09-12 22:38:26 -07:00
Alexander Rose
44c69b1716 dpoit, fix depthMask not off 2022-09-12 22:27:03 -07:00
Alexander Rose
559ca7ffb8 Merge branch 'master' of https://github.com/molstar/molstar into pr/giagitom/533 2022-09-12 22:22:55 -07:00
Alexander Rose
524f34e8c1 3.17.0 2022-09-11 14:38:51 -07:00
Alexander Rose
d749be11f0 type fixes 2022-09-11 14:34:21 -07:00
Alexander Rose
13dc9ff3cb package updates 2022-09-11 14:12:57 -07:00
Alexander Rose
24b4fce326 improve RG texture format handling 2022-09-10 17:21:20 -07:00
Alexander Rose
f506210bf8 dpoit, fix webgl1 support
- in webgl1 drawbuffers must be in the same format for some reason
2022-09-10 17:12:59 -07:00
Alexander Rose
cb0cbd06ce Merge branch 'master' of https://github.com/molstar/molstar into pr/giagitom/533 2022-09-10 16:02:43 -07:00
Alexander Rose
3356239089 fix click event triggered after move 2022-09-10 15:57:07 -07:00
Alexander Rose
9a5b2edc08 cleanup unused variable 2022-09-10 15:39:07 -07:00
Alexander Rose
2d41b4bd83 dpoit, use half float for color textures when available 2022-09-10 15:36:54 -07:00
Alexander Rose
58f7758ee1 add note to MAX_DPOIT_DEPTH constant 2022-09-10 15:30:28 -07:00
Alexander Rose
9dbb642883 more blend back handling cleanup 2022-09-10 15:26:49 -07:00
Alexander Rose
c5222e4d1d Merge branch 'master' of https://github.com/molstar/molstar into pr/giagitom/533 2022-09-10 14:54:57 -07:00
Alexander Rose
a5a695a17c Merge pull request #514 from yakomaxa/molql_integration_PR
Integration of pymol/vmd/jmol transpilers from MolQL project (WIP rasmol transpiler)
2022-09-10 14:51:53 -07:00
Alexander Rose
7d1dc86cfb Merge branch 'master' into molql_integration_PR 2022-09-10 14:50:27 -07:00
Alexander Rose
03224f914a transpiler helper cleanup 2022-09-10 14:49:03 -07:00
Alexander Rose
1cf1f07232 Merge pull request #552 from molstar/perf-caveat
add support for failIfMajorPerformanceCaveat
2022-09-10 13:43:37 -07:00
Alexander Rose
838d36a74e Merge branch 'master' into perf-caveat 2022-09-10 13:43:24 -07:00
Alexander Rose
6c9300d01b fix useBehavior handling 2022-09-10 13:42:52 -07:00
Alexander Rose
3059f7efef Merge pull request #553 from molstar/pdb-ter
fix handling of PDB TER records
2022-09-10 12:51:08 -07:00
Alexander Rose
fbce7d9afa Merge branch 'master' into pdb-ter 2022-09-10 12:50:59 -07:00
Alexander Rose
1c9f3ed9fa simplify ter record check 2022-09-10 12:50:22 -07:00
Alexander Rose
8c47d2d400 Merge pull request #554 from molstar/repr-getAllLoci
add repr.getAllLoci
2022-09-10 12:46:13 -07:00
Alexander Rose
8a18f25b5d Merge branch 'master' into repr-getAllLoci 2022-09-10 12:46:05 -07:00
Alexander Rose
e7ae0058ed Merge pull request #555 from molstar/bond-key-prop
add key property to intra- and inter-bonds
2022-09-10 12:45:39 -07:00
Alexander Rose
98bf3a3e33 tweak per-group transparency cutoff 2022-09-09 23:45:02 -07:00
Alexander Rose
379fcd4494 dpoit, render volumes with standard blending 2022-09-09 23:13:15 -07:00
Alexander Rose
8589777bac Merge branch 'master' of https://github.com/molstar/molstar into pr/giagitom/533 2022-09-09 22:27:45 -07:00
Alexander Rose
c10a21ecbd add key property to intra- and inter-bonds 2022-09-09 22:19:57 -07:00
Alexander Rose
eddc616b14 add repr.getAllLoci 2022-09-09 19:23:46 -07:00
Alexander Rose
70fc1a9579 support residue ranges in jmol atom expressions 2022-09-09 15:59:14 -07:00
Alexander Rose
f27ec4d6a4 formatting 2022-09-09 15:36:08 -07:00
Alexander Rose
1e6e956e2d improve pymol keywords
- rename polymer.protein and polymer.nucleic
- fix guide "C4'"
2022-09-09 15:35:46 -07:00
Alexander Rose
0a2a3530d1 fix handling of PDB TER records 2022-09-09 13:20:15 -07:00
Alexander Rose
9e4c820e26 add support for failIfMajorPerformanceCaveat 2022-09-09 12:31:40 -07:00
Alexander Rose
05290bfe9e update renderer spec resource counts 2022-09-08 18:40:43 -07:00
Alexander Rose
607f4ce353 dpoit: fix drawbuffer setup and blend to target 2022-09-08 18:10:31 -07:00
Alexander Rose
4b819ead1d formating 2022-09-08 18:08:53 -07:00
Alexander Rose
d07d9d3f31 add missing dpoitIterations param 2022-09-08 18:08:16 -07:00
Alexander Rose
d08776bf19 Merge branch 'master' of https://github.com/molstar/molstar into pr/yakomaxa/514 2022-09-07 18:37:37 -07:00
Alexander Rose
7a61fd44fd remove rasmol transpiler
- functionallity integrated into jmol transpiler
2022-09-07 18:32:43 -07:00
Alexander Rose
151da1487c formatting 2022-09-07 18:28:45 -07:00
Alexander Rose
e3f6dfad5b improve jmol transpiler
- add basic within function
- add basic backbone and protein keyword
- allow withspace in parans
2022-09-07 18:06:15 -07:00
Alexander Rose
32080ce918 improve jmol transpiler
- add resno ranges
- add bracketed resnames
- allow comma as OR
2022-09-07 15:16:28 -07:00
Alexander Rose
aedb2138c8 Merge pull request #548 from molstar/interactions-parent-display
add parentDisplay param to interactions repr
2022-09-06 12:19:25 -07:00
Alexander Rose
90e6938f1c Merge branch 'master' into interactions-parent-display 2022-09-06 11:57:02 -07:00
David Sehnal
eadff35250 Merge pull request #547 from molstar/sifts-alignment/residue-test
alignAndSuperposeWithSIFTSMapping includeResidueTest option
2022-09-05 15:11:53 +02:00
Alexander Rose
487450ec64 show only 'between' interaction in docking-viewer 2022-09-04 22:41:35 -07:00
Alexander Rose
f2f730bab5 fix parentDisplay 'between' logic 2022-09-04 22:41:06 -07:00
Alexander Rose
ceecee37a7 add parentDisplay param to interactions repr 2022-09-02 22:19:45 -07:00
dsehnal
394377bea9 alignAndSuperposeWithSIFTSMapping update 2022-09-02 15:50:58 +02:00
dsehnal
2b47818deb alignAndSuperposeWithSIFTSMapping includeResidueTest option 2022-09-02 15:38:06 +02:00
giagitom
9f72465052 remove unnecessary 2022-09-02 10:21:56 +02:00
giagitom
ac33b4a322 Adding distanceToVec in sphere3d namespace 2022-09-02 10:20:51 +02:00
giagitom
911c844e54 Remove logs and unused variables 2022-09-01 18:09:04 +02:00
giagitom
12b9655565 adding nearest and distance to point methods to lookup3d 2022-09-01 17:41:09 +02:00
dsehnal
2935717a06 Canvas3DParams fix 2022-08-29 16:49:30 +02:00
dsehnal
2c8d2cfa21 3.16.0 2022-08-25 17:55:54 +02:00
dsehnal
d67c0eb757 ViewportHelpContent fix 2022-08-25 17:53:10 +02:00
giagitom
7bcbcd5a7f Exposed dpoitIterations parameter 2022-08-25 16:07:36 +02:00
giagitom
1c06e7f36e Merge branch 'master' into dpoit 2022-08-24 18:44:30 +02:00
giagitom
407297adc0 added dpoit-enable query string 2022-08-24 18:21:34 +02:00
giagitom
b082b31562 Remove logs, changelog, set wboit as default option 2022-08-24 18:19:59 +02:00
giagitom
fcbeb0f82f Add defines for direct-volume 2022-08-24 17:42:08 +02:00
dsehnal
7094f8f265 Improve Viewer theming & label customization 2022-08-24 15:26:24 +02:00
giagitom
48aaa13420 Fix missing texture format 2022-08-24 15:24:30 +02:00
giagitom
d2434cf91f Merge branch 'master' into dpoit 2022-08-24 15:09:13 +02:00
giagitom
8dbe0d2793 Lint-fix 2022-08-24 14:37:33 +02:00
giagitom
7b308cf984 Keep wboit as default OIT method 2022-08-24 14:34:44 +02:00
giagitom
520af504aa Throw an error if wboit and dpoit are both enabled 2022-08-24 14:29:40 +02:00
giagitom
4bee130599 Added credits and contributions + lint-fix 2022-08-24 14:12:12 +02:00
dsehnal
19a9ed3e19 3.15.0 2022-08-23 19:00:36 +02:00
dsehnal
0dac1b93ae changelog 2022-08-23 18:57:45 +02:00
dsehnal
e824863de1 lint 2022-08-23 18:56:07 +02:00
David Sehnal
9ff8becd62 Merge pull request #530 from midlik/volume-streaming-camera-target
Volume streaming camera target (without caching)
2022-08-23 18:53:11 +02:00
Adam Midlik
fcaa1bcfa8 Merge branch 'master' into volume-streaming-camera-target 2022-08-23 18:39:37 +02:00
giagitom
39f51bcc4f Integration of Dual depth peeling - OIT method 2022-08-23 17:09:53 +02:00
Adam Midlik
1b904ee2c9 Addressed PR comments 2022-08-23 17:03:32 +02:00
yakomaxa
e2baafc426 lint 2022-08-23 18:13:14 +09:00
yakomaxa
6dabe73002 Update pymol keywords and properties 2022-08-23 17:16:10 +09:00
David Sehnal
d9b2b99c86 Merge pull request #531 from molstar/safari-wboit
add missing depth renderbuffer to wboit pass
2022-08-23 09:40:27 +02:00
Alexander Rose
bdf23a7c4e add missing depth renderbuffer to wboit pass
- fix wboit in Safari >=15
2022-08-22 23:39:50 -07:00
yakomaxa
c1723e0806 lint 2022-08-21 21:59:10 +09:00
yakomaxa
93590bd482 Remove comment line in vmd keyword 2022-08-21 21:54:38 +09:00
yakomaxa
fbaa9d9e58 Finally enabled selection by negative-valued residue index in RasMol 2022-08-21 21:48:47 +09:00
yakomaxa
ba78a8558c Finally enabled selection by negative-valued residue index 2022-08-21 21:39:20 +09:00
yakomaxa
513be04352 lint PyMOL 2022-08-21 21:38:43 +09:00
yakomaxa
15317aa11b give pymol the ability to deal with negatively indexed residue numbering 2022-08-21 19:37:20 +09:00
yakomaxa
93e107f333 give pymol the ability to deal with negatively indexed residue numbering 2022-08-21 19:32:45 +09:00
yakomaxa
655b334b0a Updated rasmol parser and spec 2022-08-21 17:14:29 +09:00
yakomaxa
95cc1c58a6 remove comment and unused character and functions 2022-08-21 16:56:20 +09:00
yakomaxa
0511d3e599 Unparenthesized residue range enabled in RasMol and parenthesized was un-activated 2022-08-21 16:51:38 +09:00
yakomaxa
92a41b5c46 Unparenthesized residue range enabled in RasMol, which should be ported to Jmol 2022-08-21 16:48:41 +09:00
yakomaxa
be16837c8c Remove unused lines 2022-08-21 15:51:41 +09:00
yakomaxa
bf5f26cb12 Remove comment-out lines. Moved un-bracketed residue name to the supported feature 2022-08-21 15:44:09 +09:00
yakomaxa
ccbcef7eff lint 2022-08-21 15:33:49 +09:00
yakomaxa
d02a97b7f0 un-bracketed residue-name and un-parenthesized residue number is enabeled in RasMol 2022-08-21 15:31:48 +09:00
yakomaxa
e0ca413c54 Remove needless substitutions to a temporary variable x 2022-08-21 10:42:32 +09:00
yakomaxa
a272fc1c05 Remove comment-out lines 2022-08-21 10:39:44 +09:00
yakomaxa
2c3f74d4ea Remove a comment-out line 2022-08-21 10:38:40 +09:00
yakomaxa
c65b2fc0fd Remove a comment-out line 2022-08-21 10:37:25 +09:00
yakomaxa
fd725adf27 Added TODO comment for comment-out functions 2022-08-21 10:36:47 +09:00
yakomaxa
ceba6da91f Remove comment-out lines 2022-08-21 10:27:57 +09:00
yakomaxa
064e7d42ee Remove a comment-out import 2022-08-21 10:26:56 +09:00
yakomaxa
cfdbf0c614 Remove comment-out lines 2022-08-21 10:25:33 +09:00
yakomaxa
436777fe34 Remove a comment-out import and a comment-out piece of code 2022-08-21 10:22:45 +09:00
yakomaxa
f08aa46222 Remove two comment-out import 2022-08-21 10:20:58 +09:00
yakomaxa
e099ac514a Remove three comment-out console.log 2022-08-21 10:19:56 +09:00
yakomaxa
873755f619 Remove comment-out unused import 2022-08-21 10:18:49 +09:00
yakomaxa
2094b7cf83 Update changelog mentioning this feature 2022-08-21 10:16:49 +09:00
yakomaxa
6ffdd81bb1 remove commented console.log 2022-08-21 10:14:32 +09:00
yakomaxa
a69cb17602 remove default paramerter and added whitespace before } 2022-08-21 10:12:56 +09:00
yakomaxa
7c82a9fd6e update transpile.ts 2022-08-21 10:11:59 +09:00
yakomaxa
10d9a6c83d removed console.log in try and replaced it by console.error in catch 2022-08-21 10:01:56 +09:00
Alexander Rose
e474e9b090 3.14.0 2022-08-20 16:43:16 -07:00
Alexander Rose
837f9a6c74 changelog 2022-08-20 16:37:46 -07:00
Alexander Rose
c357aed7bb schema updates 2022-08-20 16:36:48 -07:00
Alexander Rose
59ffddfd8d update packages 2022-08-20 16:33:17 -07:00
Alexander Rose
fb3accaa36 Merge pull request #528 from molstar/safari-surf-fix
wrap gl_VertexID in int()
2022-08-20 15:45:14 -07:00
Alexander Rose
b3e79544ad Merge branch 'master' into safari-surf-fix 2022-08-20 15:44:30 -07:00
Alexander Rose
2ee0f3bf97 Merge pull request #515 from molstar/background-pass
Background pass
2022-08-20 15:41:32 -07:00
Alexander Rose
a56b5edc4e cleanup 2022-08-20 15:32:01 -07:00
Alexander Rose
f2d71b6551 Merge branch 'master' into background-pass 2022-08-20 15:25:20 -07:00
Alexander Rose
ef560ddc03 Merge pull request #529 from molstar/webgl-state
Webgl state
2022-08-20 15:22:04 -07:00
Alexander Rose
2e30ffe1bc Merge branch 'master' into webgl-state 2022-08-20 15:21:54 -07:00
Alexander Rose
325b5e9297 Merge pull request #527 from molstar/custom-prop-fix
fix CustomElementProperty coloring
2022-08-20 15:21:01 -07:00
Alexander Rose
ae9e04b8d4 reduce number of webgl state changes
- add viewport and scissor to state object
- add hasOpaque to scene object
2022-08-20 12:04:51 -07:00
Alexander Rose
ab0010122b handle renderable rendering edge cases
- fix text background rendering for opaque text
- fix helper scenes not shown when rendering directly to draw target
2022-08-20 12:04:04 -07:00
Alexander Rose
08d736ecdc image loading error handling and other tweaks 2022-08-20 11:54:51 -07:00
Alexander Rose
9c362c8ffd Merge branch 'master' of https://github.com/molstar/molstar into background-pass 2022-08-20 11:07:57 -07:00
Alexander Rose
62c8778560 Merge pull request #513 from molstar/inter-bonds-props
expose inter-bonds props & improve performance
2022-08-20 11:06:04 -07:00
Alexander Rose
2fe0665e12 simplify box3d functions 2022-08-20 10:57:40 -07:00
Alexander Rose
14a957f517 Merge branch 'master' of https://github.com/molstar/molstar into inter-bonds-props 2022-08-20 10:56:14 -07:00
Alexander Rose
087010d0a1 Merge pull request #525 from molstar/pairBonds-maxDistance
set some IndexPairBonds maxDistance to Infinity
2022-08-20 10:54:12 -07:00
Alexander Rose
f92657310a Merge branch 'master' into pairBonds-maxDistance 2022-08-20 10:54:03 -07:00
Alexander Rose
19e91400b5 fix CustomElementProperty coloring
- can't check data availabilty in isApplicable because it is obtained on demand
2022-08-20 10:14:21 -07:00
Alexander Rose
7885fb7b4f wrap gl_VertexID in int()
-fix GPU surfaces rendering in Safari with WebGL2
2022-08-20 10:12:51 -07:00
Alexander Rose
331bec11ee cleanup comment 2022-08-20 10:08:47 -07:00
Adam Midlik
f6ed650ef6 Refactoring, cleaning 2022-08-19 15:17:50 +02:00
Adam Midlik
df9ce6add9 Volume Streaming Around Camera - parameter Radius is relative to FOV 2022-08-19 12:42:10 +02:00
Adam Midlik
28ee47d501 Volume Streaming Around Camera - avoid chain-reaction updates 2022-08-19 11:29:52 +02:00
Adam Midlik
df2da479ad Volume Streaming - corrected help text for Detail Level (range is 1-7) 2022-08-19 10:23:00 +02:00
Adam Midlik
46eb9d8baf Volume Streaming - correct init value of Selection Detail and Dynamic Detail when View type changes 2022-08-19 10:21:08 +02:00
Adam Midlik
b6be871a21 Volume Streaming all types use MonoQueue 2022-08-18 23:28:11 +02:00
Adam Midlik
ce2367fc0a Volume streaming Around Focus uses MonoQueue (i.e. never queuing more than 1 update) 2022-08-18 19:27:53 +02:00
dsehnal
f219cd6c8b prefer webgl1 in Safari 16 2022-08-18 17:39:18 +02:00
yakomaxa
7789e8cfea deleted package-lock.json 2022-08-18 19:58:30 +09:00
Alexander Rose
e697624064 prefer WebGL1 for more Safari versions
-avoid broken GPU surfaces rendering
2022-08-17 22:08:17 -07:00
Alexander Rose
92ffdeb5bf don't include glycam names in default saccharides 2022-08-17 21:57:55 -07:00
Alexander Rose
ddefe7e542 package updates 2022-08-17 21:50:54 -07:00
Alexander Rose
fb4019c041 changelog 2022-08-17 21:39:14 -07:00
Alexander Rose
46026e047e set some IndexPairBonds maxDistance to Infinity
- for MOL/SDF and MOL2 (without symmetry) models
- avoid filtering by element-based rules
2022-08-17 21:38:06 -07:00
yakomaxa
51a9effcaa Added a sentence on transpilers in CHANGELOG.md 2022-08-17 12:07:12 +09:00
yakomaxa
fc3b953a8e Added whitespace remover to prefixRemoveKet in helper.ts and update rasmol.spec.ts 2022-08-17 11:55:45 +09:00
yakomaxa
a2ded3cecc Small update for RasMol parser 2022-08-17 10:28:39 +09:00
yakomaxa
ffb1390b51 added conditional evalation to inComplement 2022-08-17 10:15:18 +09:00
yakomaxa
3b92591c05 added conditional evaluation to disjunct and invert 2022-08-17 10:08:15 +09:00
yakomaxa
f173ddcf00 removed comment-out lines from rasmol parser.ts 2022-08-16 22:50:35 +09:00
yakomaxa
f78306f624 removed unused abbr. from rasmol operators.ts 2022-08-16 22:41:18 +09:00
yakomaxa
9852c9301e Changed list name in respective examples.ts and now examples.spec.ts runs without error 2022-08-16 20:07:44 +09:00
yakomaxa
2e4f3de604 debugging example.spec.ts 2022-08-16 19:47:11 +09:00
yakomaxa
300dd97353 Added spec, debugged Jmol parser, removed unused definition from RasMol properties/operators 2022-08-16 19:34:13 +09:00
yakomaxa
8e29ade83a minor change of language name: Rasmol -> RasMol 2022-08-16 16:52:34 +09:00
Alexander Rose
971c770f6a add experimental warning for transpiled scripts 2022-08-15 22:03:24 -07:00
Alexander Rose
0dfad5a757 imporve labels of skybox params 2022-08-15 20:55:45 -07:00
Alexander Rose
a0495f8aae fix SSAO renderable initialization 2022-08-15 20:55:27 -07:00
yakomaxa
7d31a06ae4 Updated atom-set.ts according to suggestion by dsehnal 2022-08-16 12:50:02 +09:00
KoyaS
c5319ad7b1 Update package.json
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:38:31 +09:00
KoyaS
f8bdb28ea6 Update package.json
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:38:18 +09:00
KoyaS
2f8806d7c2 Update src/mol-script/runtime/query/table.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:37:55 +09:00
KoyaS
7d0a181c12 Update src/mol-model/structure/query/queries/atom-set.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:37:46 +09:00
KoyaS
27cb7e53ed Update src/mol-script/runtime/query/table.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:37:36 +09:00
KoyaS
ee5154b510 Update src/mol-script/runtime/query/table.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:37:20 +09:00
KoyaS
080837201a Update src/mol-script/runtime/query/table.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:36:44 +09:00
KoyaS
656e6c0d94 Update src/mol-script/runtime/query/table.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:36:17 +09:00
KoyaS
b018f61bab Update src/mol-script/runtime/query/table.ts
conditional evaluation

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-08-16 12:35:37 +09:00
yakomaxa
b03b306848 Enabling some numerical properties and cleaning by lint 2022-08-16 06:17:58 +09:00
yakomaxa
19bf5c2b3e [SER]3:A.CA type of selection enabled 2022-08-16 05:27:30 +09:00
yakomaxa
c22a716cf9 Update helper.ts for RasMol 2022-08-16 04:35:26 +09:00
yakomaxa
220c65da92 Parentheses re-enabled in RasMol 2022-08-16 04:27:17 +09:00
yakomaxa
675f4b86f8 Minor update of RasMol mode 2022-08-16 04:18:00 +09:00
yakomaxa
d31b3522b2 Added myself as author in package.json. Thanks. 2022-08-15 21:12:22 +09:00
yakomaxa
4ed2bab1d7 cleaning by lint 2022-08-15 20:56:20 +09:00
yakomaxa
a572872806 Updated author information and removed notes 2022-08-15 20:53:47 +09:00
yakomaxa
e3ca23db0b Remove needless setting of class members and added revised author information 2022-08-15 20:24:23 +09:00
KoyaS
67eb16a53f Merge pull request #18 from yakomaxa/rasmol
Merge from RasMol branch and begin answering the reviewers
2022-08-15 20:12:23 +09:00
yakomaxa
d7421cd1a3 Removed unwanted file 2022-08-15 20:00:48 +09:00
yakomaxa
c2e68ced66 cleaning by lint 2022-08-15 19:39:54 +09:00
yakomaxa
10cf0db050 Within operator was implemented in RasMol 2022-08-15 19:38:14 +09:00
yakomaxa
08f1a1dcfe Added experimental within to rasmol 2022-08-15 18:03:16 +09:00
yakomaxa
11bf352295 Added experimental within to rasmol 2022-08-15 15:39:57 +09:00
yakomaxa
5fd560b30a Added experimental within to rasmol 2022-08-15 15:38:38 +09:00
KoyaS
e6d01ca246 Merge pull request #17 from yakomaxa/molql_integration_PR
Molql integration pr
2022-08-15 13:03:55 +09:00
Alexander Rose
1610f05b83 Merge branch 'master' of https://github.com/molstar/molstar into inter-bonds-props 2022-08-14 16:28:21 -07:00
Alexander Rose
8202b75cda Merge branch 'master' of https://github.com/molstar/molstar into background-pass 2022-08-14 16:26:47 -07:00
Alexander Rose
4904bae5a6 background pass improvements
- add PluginConfig.Background.Styles
- file support, asset management
- opacity, saturation, lightness controls for skybox/image
- coverage controls for image/gradient
- add backgrounds extension with examples
- image handling for build/watch (webpack, cpx)
2022-08-14 16:24:28 -07:00
Alexander Rose
04c06db02c Merge pull request #519 from MadCatX/gzip_files
Allow download of Gzipped files
2022-08-14 14:52:10 -07:00
Alexander Rose
0ddf2fa00d typing tweaks 2022-08-14 14:37:30 -07:00
Alexander Rose
8776143ec2 revert to mol-script in StructureSelectionFromScript 2022-08-14 14:07:39 -07:00
Alexander Rose
080c8e7af3 add basic scipt language selector 2022-08-14 14:06:12 -07:00
Michal Malý
a96f94b676 Allow download of Gzipped files 2022-08-14 17:11:35 +02:00
yakomaxa
64998e762b cleaning by lint and adding comments 2022-08-14 11:15:50 +09:00
yakomaxa
b508da5ccc cleaning by lint 2022-08-14 11:06:24 +09:00
KoyaS
84a492655a Merge pull request #16 from yakomaxa/molql_integration_PR
Molql integration pr
2022-08-14 10:57:07 +09:00
yakomaxa
9b9cfe4138 rasmol -> pymol 2022-08-14 10:55:11 +09:00
yakomaxa
f362a7086a rasmol update 2022-08-14 10:54:31 +09:00
KoyaS
9e9ec57a5f Merge pull request #14 from yakomaxa/rasmol
merge from rasmol branch
2022-08-14 04:09:15 +09:00
yakomaxa
da6a153985 Construction of rasmol selection command has nearly finished 2022-08-14 04:03:48 +09:00
yakomaxa
b4bde3f510 Rasmol parser WIP 5 2022-08-14 03:31:08 +09:00
yakomaxa
8a5cebd635 Rasmol parser WIP 4 2022-08-14 03:23:54 +09:00
Alexander Rose
ebdfc694c2 Merge pull request #520 from MadCatX/clean_up_pyramids
Change the lookup logic of NtC steps from residues
2022-08-13 11:19:30 -07:00
yakomaxa
ddf2733d3c Rasmol parser WIP 3 2022-08-14 00:36:37 +09:00
yakomaxa
cf65bfbcd0 Rasmol parser WIP 2 2022-08-13 23:03:26 +09:00
yakomaxa
03cce830bc Rasmol parser WIP 2022-08-13 21:43:05 +09:00
yakomaxa
913cf4c3e9 developing rasmol residue-range selector WIP 2022-08-13 12:44:14 +09:00
yakomaxa
2ccce0beaf developing rasmol residue-range selector WIP 2022-08-13 12:43:07 +09:00
yakomaxa
52239f71cd refined rasmol keywords 2022-08-13 11:20:41 +09:00
KoyaS
d9265af2e8 Merge pull request #13 from yakomaxa/molql_integration_PR
Added transpilers/_spec and checked that they pass the test
2022-08-13 08:57:48 +09:00
yakomaxa
5877f6a627 Added transpilers/_spec and checked that they pass the test 2022-08-13 02:43:54 +09:00
Michal Malý
7f29340797 Change the lookup logic of NtC steps from residues 2022-08-12 15:29:26 +02:00
KoyaS
e3e982c051 Merge pull request #11 from yakomaxa/molql_integration_PR
merge from molql_integration_PR
2022-08-12 18:07:23 +09:00
yakomaxa
17f09ff3de Cleaning and lint 2022-08-12 18:00:45 +09:00
yakomaxa
7a73416c03 Cleaning and lint 2022-08-12 17:44:29 +09:00
yakomaxa
0f799d44ad Found a bug in withSameAtomProperties in filter.ts, where propSet and currentProps are placed inversely in isSuperSet() 2022-08-12 16:08:42 +09:00
yakomaxa
24ebd44f87 remove namedAtomProperty from vmd/parser.ts, removed as any from definition of withSameAtomProperties, un-commented out the continue line in filter.ts 2022-08-12 10:06:44 +09:00
KoyaS
572b10e655 Merge pull request #9 from yakomaxa/molql_integration_PR
merge from molql_integration_pr branch
2022-08-12 07:11:15 +09:00
yakomaxa
60361c176b Updated pick function in filter.ts. This enebles VMD keywords like backbone and many more. 2022-08-12 06:29:13 +09:00
yakomaxa
b232a2c58f Updated atom-set.ts and filter.ts, which leads to correct behavior of inorganic in PyMOL. The bound_to operator was found to behave differently from original PyMOL even in MolQL implementation: it's just mistake in logic. 2022-08-12 06:19:20 +09:00
yakomaxa
2a44ac56fb cleaning by lint 2022-08-12 01:18:56 +09:00
yakomaxa
d0340a3257 The function called by filter.withSameAtomProperties is debugged and almost everything works fine now. 2022-08-11 23:54:57 +09:00
yakomaxa
e708a53ddb atom-set.ts table.ts updates 2022-08-11 22:11:15 +09:00
yakomaxa
23cdd70198 updated atomCount and many problem solved 2022-08-11 21:20:55 +09:00
yakomaxa
ba4bc30a78 remove trash file 2022-08-11 14:28:31 +09:00
yakomaxa
e516ea146d Update for atomCount and countQuery in table.ts 2022-08-11 14:26:10 +09:00
yakomaxa
61af638fe4 Update atom-set 2022-08-11 13:59:56 +09:00
yakomaxa
7a0af4142f Now PyMOL within operator works. The key was to replace xs['max-radius'] -> xs['max-radius'](ctx) in table.ts 2022-08-11 10:52:56 +09:00
yakomaxa
1aa8d596a3 Updates for queryInSelection in src/mol-script/runtime/query/table.ts was reverted (made bug) 2022-08-11 10:30:09 +09:00
yakomaxa
a457810623 queryInSelection in src/mol-script/runtime/query/table.ts was updated 2022-08-11 10:18:16 +09:00
yakomaxa
4bccb7ab84 VMD jmol rasmol parser debugged 2022-08-11 09:46:15 +09:00
yakomaxa
fcd5b2ce0a VMD parser debugged 2022-08-11 09:36:32 +09:00
yakomaxa
57a1184a16 VMD parser updated, now math function to value comparison enabled 2022-08-11 09:22:37 +09:00
Adam Midlik
ef176efed8 Volume streaming 'Around Camera' - prototype 2022-08-11 01:39:22 +02:00
yakomaxa
9943e0317d VMD jmol and rasmol parser updated 2022-08-11 08:39:21 +09:00
yakomaxa
ae11c1c904 VMD keyword update 2022-08-11 03:33:28 +09:00
yakomaxa
f937e069ca Clearning by Lint 2022-08-11 02:41:43 +09:00
yakomaxa
c9326da47b Implemented subset of atomSet: atomCount, queryCount and propertySet, which enables some of PyMOL operators. Implementation should be reviewed as byring is not working, and inorganic working incorrectly 2022-08-11 02:32:45 +09:00
yakomaxa
4698c05f9c re-implementation of VMD's exwithin without using wihtin 2022-08-10 21:41:03 +09:00
yakomaxa
15fd2cd5a0 let transpile.ts show what the query is 2022-08-10 21:27:25 +09:00
yakomaxa
193eb11095 Set some operators that lacks corresponding implementation to isUnsupported : true 2022-08-10 16:34:35 +09:00
yakomaxa
59cc0096cd fixing typo in example of pymol operator: resname CA -> name CA 2022-08-10 16:28:51 +09:00
yakomaxa
6bd7390eb8 Debbuged asAtoms in helper.ts, which enables operation using this function such as byresidue and neighbor. In addition, min-spelling in neighbor operation fixed: neighbour -> neighbor 2022-08-10 16:21:06 +09:00
yakomaxa
eabeb18f34 pymol 2022-08-10 16:11:54 +09:00
yakomaxa
4b6f539ba3 debugging wrapValue in helper.ts : property.head -> property.head.name : This enables secondary structure selection for VMD via valuesTest in helper.ts 2022-08-09 22:22:08 +09:00
yakomaxa
ea55fc5f41 debugging VMD mode 2022-08-09 22:05:04 +09:00
yakomaxa
94787229a4 testLevel in helper.ts was debuged and now comes back in vmd/parser.ts 2022-08-09 19:24:34 +09:00
Alexander Rose
113d0b5141 add background pass
- skybox, image, horizontal/radial gradient
2022-08-07 13:27:06 -07:00
Alexander Rose
163285b0a9 cleanup 2022-08-07 13:20:52 -07:00
Alexander Rose
9f1cf5377a add sceneRadiusFactor param 2022-08-07 13:17:52 -07:00
Alexander Rose
c37636215b expose fov camera param 2022-08-07 13:14:57 -07:00
KoyaS
0cb162022c Merge pull request #6 from yakomaxa/enable_not_and
Enabled NOT operation
2022-08-07 17:45:45 +09:00
yakomaxa
5ff2ca311e structure-query.generator.query-in-selection was implemented: this enables NOT operation. In addition, tranpiler/helper.ts was fixed to use B.struct.generator.all() instead of B.struct.generator.atomGroups(). B.struct.generator.atomGroups() is not working for some reason, which was also met in the keyword 'all' in all of vmd/pymol/jmol parser.ts 2022-08-07 17:42:15 +09:00
KoyaS
44b8d452a8 Merge pull request #5 from yakomaxa/enable_not_and
structure-query.modifier.intersectby was implemented
2022-08-07 15:55:08 +09:00
yakomaxa
82ccb1ab23 structure-query.modifier.intersectBy was implemented: this enables AND operation 2022-08-07 15:51:06 +09:00
yakomaxa
feb8b94e30 modified _spec: I don't understand what these _spec things do 2022-08-07 10:19:03 +09:00
yakomaxa
5adc73e277 removed unsused modules from package.json 2022-08-07 10:18:41 +09:00
KoyaS
c4ac983fc7 Merge pull request #4 from molstar/master
merge from head repository
2022-08-07 08:40:03 +09:00
yakomaxa
5ba7ba3aac Cleaning before PR. Note that many tests fail. 2022-08-07 08:34:22 +09:00
yakomaxa
e879479b3d removed mock-extension for language selector and reverted src/mol-plugin-state/transforms/representation.ts to the original 2022-08-07 07:36:39 +09:00
yakomaxa
7b49463297 NamedAtomProperties was added to vmd parser 2022-08-07 06:16:29 +09:00
Alexander Rose
1f77b19ced changelog 2022-08-06 13:45:29 -07:00
Alexander Rose
9853ebf02f Merge pull request #507 from MadCatX/add_pyramid_labels
Add labels for Confal pyramids
2022-08-06 13:42:02 -07:00
Alexander Rose
6e13aa0bc9 expose inter-bonds props & improve performance 2022-08-06 13:31:10 -07:00
yakomaxa
66600c3373 deleted unused comment lines in monadic-parser.ts 2022-08-07 02:39:22 +09:00
yakomaxa
19401c4bc6 Activated RangeListProperty in vmd/parser.ts with hardcoded 'atom-test' line 2022-08-07 02:38:21 +09:00
yakomaxa
bfc8660c5e replaced structure. -> structure-query. in transpiler directory 2022-08-07 02:21:52 +09:00
yakomaxa
6a83dc56ba reverted vmd parser and properties to original 2022-08-07 02:12:21 +09:00
KoyaS
82df9d8cad Merge pull request #3 from yakomaxa/rasmol
Rasmol transpiler added
2022-08-05 23:47:28 +09:00
yakomaxa
dd30fef078 Added many properties and keywords for PyMOL and rasmol 2022-08-05 23:38:41 +09:00
yakomaxa
79feb5a1cc rasmol branch launched 2022-08-05 20:48:16 +09:00
yakomaxa
0665524b11 refined VMD: RangeListProperty in vmd/parser.ts is not working for unknown reasons, so it was substituted by NamedAtomProperties: This limits the selection like 'residue 10 to 50' and 'residue 10' 2022-08-05 20:36:32 +09:00
yakomaxa
d45367e840 Refining VMD parser and properties 2022-08-05 13:32:46 +09:00
Michal Malý
1b7f0e0f1e Add example mmCIF to allow testing of Confal pyramids 2022-08-04 10:09:50 +02:00
Michal Malý
18cb3360b5 Update changelog 2022-08-04 09:56:28 +02:00
yakomaxa
cb0d988efc Updated language-select/ui, refactored transpile.ts and monadic-parser.ts 2022-08-03 22:52:07 +09:00
yakomaxa
fc0c556967 updated default value for Script and added mock-up for language-selector 2022-08-03 21:31:53 +09:00
yakomaxa
00970164db Debugged all in jmol 2022-08-03 03:24:35 +09:00
yakomaxa
7c3d76e9fe Merge branch 'master' of github:yakomaxa/molstar_my 2022-08-03 02:50:43 +09:00
yakomaxa
190c1f9620 Added pymol, jmol and vmd alongside mol-script: pymol is now enabled 2022-08-03 02:49:52 +09:00
KoyaS
f532325147 Merge pull request #2 from yakomaxa/PyMOL
added all and polymer.protein to keywords of pymol
2022-08-02 13:25:09 +09:00
yakomaxa
278dcb8808 added all and polymer.protein to keywords of pymol 2022-08-02 13:10:42 +09:00
Michal Malý
6fec598b96 Add labels for Confal pyramids 2022-08-01 14:46:35 +02:00
KoyaS
309c25e10b Merge pull request #1 from yakomaxa/jmol
Added Jmol transpiler (not enabled)
2022-07-31 23:05:06 +09:00
yakomaxa
6df728ea3e added jmol transplier (not enabled) 2022-07-31 23:01:11 +09:00
yakomaxa
dcf4ef6d74 added jmol transpiler 2022-07-31 22:49:20 +09:00
yakomaxa
4de1369a5a added jmol transpiler 2022-07-31 22:46:58 +09:00
yakomaxa
2ccfdb1280 added _spec (not tested whether it works) 2022-07-31 21:58:43 +09:00
yakomaxa
9fbf800639 added _spec (not tested whether it works) 2022-07-31 21:58:09 +09:00
yakomaxa
577daf64df PyMOL mode was successfully enabled (though mol-script is disabled...) 2022-07-31 12:27:15 +09:00
yakomaxa
0b1943e9b3 Now it worksgit add src/mol-script/transpile.ts 2022-07-31 12:17:25 +09:00
yakomaxa
30bd2dd876 Compiles but not boot 2022-07-31 12:04:38 +09:00
yakomaxa
cecd4d4179 Compiles but not working again 2022-07-31 11:15:58 +09:00
yakomaxa
364baab18d Added transpile.ts and all.ts 2022-07-31 10:30:37 +09:00
yakomaxa
bb3d4d2171 Added default export 2022-07-31 10:00:36 +09:00
yakomaxa
2355faf899 compiles but not working 2022-07-31 01:54:27 +09:00
yakomaxa
858e0b24ff now with few errors 2022-07-31 00:03:22 +09:00
yakomaxa
f7d0ed3988 Added additional modules 2022-07-30 23:17:21 +09:00
David Sehnal
40096ecdfb Merge pull request #502 from giagitom/master 2022-07-27 10:05:35 +02:00
giagitom
43061b80b8 Deliver defaultAttribs to Passes constructor 2022-07-26 19:24:31 +02:00
Alexander Rose
aa3d657d42 3.13.0 2022-07-24 17:11:08 -07:00
Alexander Rose
b0ef385769 changelog 2022-07-24 17:05:47 -07:00
Alexander Rose
dcf24e6292 Merge pull request #496 from JonStargaryen/master
Download CCD from Configurable URL
2022-07-24 17:04:28 -07:00
Alexander Rose
2fdd77737c Merge pull request #499 from molstar/immediate-isolevel
enable immediateUpdate for iso level
2022-07-24 17:02:55 -07:00
Alexander Rose
31c98ef1ba package updates 2022-07-23 13:40:23 -07:00
Alexander Rose
ceeec2c13a enable immediateUpdate for iso level 2022-07-23 13:36:15 -07:00
Alexander Rose
cc82e0cff8 Merge pull request #498 from molstar/varying-group
Varying group
2022-07-23 13:19:10 -07:00
Alexander Rose
29fc6c59e9 support constant group in gpu mc 2022-07-23 13:18:16 -07:00
Alexander Rose
aa931fab7b add dVaryingGroup to avoid flat qualifier more 2022-07-23 13:06:35 -07:00
Alexander Rose
8e2585a5c0 add material annotation support for textures 2022-07-23 11:26:34 -07:00
Alexander Rose
c115047f74 handle principal axes of points in a plane 2022-07-23 11:06:01 -07:00
Alexander Rose
0ac58cb137 changelog 2022-07-23 11:02:01 -07:00
Alexander Rose
492e0977c3 Merge pull request #494 from giagitom/master
only update camera state if manualReset is off
2022-07-23 10:57:36 -07:00
JonStargaryen
e8a09e81f3 fix short arg names 2022-07-21 14:02:57 -07:00
JonStargaryen
4fcc2c6208 download CCD from configurable URL 2022-07-21 09:50:01 -07:00
giagitom
e3523dc5fe only update camera state if manualReset is off 2022-07-20 18:04:03 +02:00
dsehnal
acf6c31a36 3.12.1 2022-07-20 15:43:33 +02:00
dsehnal
339b2e696c PluginBehavior dispose logic 2022-07-20 15:40:30 +02:00
Alexander Rose
6417fd49d6 3.12.0 2022-07-17 16:28:26 -07:00
Alexander Rose
374fd4db65 changelog 2022-07-17 16:23:08 -07:00
Alexander Rose
0b70dd9e38 Merge pull request #487 from molstar/fix/struct_conn-parsing
struct_conn parsing fix
2022-07-17 16:20:45 -07:00
dsehnal
55b19a7922 changelog 2022-07-17 18:01:28 +02:00
dsehnal
beb1b2655e scan all entities when looking for struct_conn etries
- solves PDB loading issue
2022-07-17 17:58:57 +02:00
Alexander Rose
6a81e48c3a package updates 2022-07-16 13:20:19 -07:00
Alexander Rose
f9841dd3df improve CellPack's adjustStyle option
- disable colorMarker
- set component options
- enable marking w/o ghost
2022-07-16 13:02:04 -07:00
Alexander Rose
b563c773c1 avoid using flat qualifier in shaders
- causing slowdown
2022-07-16 13:01:33 -07:00
Alexander Rose
dcda649d9d add colorMarker option to Renderer
- disables the highlight and select marker at a shader level
- faster rendering of large scenes in some cases.
2022-07-16 12:58:49 -07:00
Alexander Rose
d6cfd23ae5 fix missing material annotation for some uniforms
- causing unnecessary uniform updates
2022-07-16 12:31:38 -07:00
Alexander Rose
b69f62c9a4 remove use of isnan in impostor shaders
- not needed and causing slowdown
2022-07-16 12:28:40 -07:00
Alexander Rose
582ee7d623 bind shared textures only once per pass 2022-07-16 12:27:16 -07:00
ludovic autin
9e69f5dcfa Merge branch 'master' of https://github.com/corredD/molstar-proto into forkdev
# Conflicts:
#	CHANGELOG.md
2022-07-05 08:51:25 -07:00
dsehnal
7c4202186d 3.11.0 2022-07-04 16:30:54 +02:00
dsehnal
7c56e4c09d fix unused import 2022-07-04 16:28:24 +02:00
dsehnal
b10b466c61 changelog 2022-07-04 16:25:23 +02:00
David Sehnal
80d1986c61 Merge pull request #474 from molstar/composable-superposition
coordinate system support for superposition
2022-07-04 16:24:45 +02:00
dsehnal
7f9e413604 coordinate system support for superposition 2022-07-04 16:23:51 +02:00
Alexander Rose
4dfbc3830f Merge pull request #466 from molstar/cellpack-tweaks
Cellpack tweaks
2022-07-03 14:18:26 -07:00
Alexander Rose
46cdefa9ee add adjustStyle option to LoadCellPackModel 2022-07-02 12:48:05 -07:00
Alexander Rose
f857ea6095 fix missing rename
- forceInstanceTheme -> instanceGranularity
2022-07-01 06:34:27 -07:00
Alexander Rose
994920f99f fix shader compilation
- support instance texture params for overpaint, substance, transparency
2022-06-29 22:28:10 -07:00
ludovic autin
409ed9ad67 Merge branch 'forkdev' of https://github.com/corredD/molstar-proto into forkdev
# Conflicts:
#	CHANGELOG.md
2022-06-28 08:11:29 -07:00
Alexander Rose
130d4096d5 Merge branch 'master' of https://github.com/molstar/molstar into cellpack-tweaks 2022-06-26 17:50:14 -07:00
Alexander Rose
d5659529d7 3.10.2 2022-06-26 17:34:46 -07:00
Alexander Rose
f6e06ab16e changelog 2022-06-26 17:29:48 -07:00
Alexander Rose
4245eaf1b2 improve use of gl_VertexID when possible 2022-06-26 17:29:21 -07:00
Alexander Rose
c41bd702e2 remove superfluous shader varying 2022-06-26 17:25:14 -07:00
Alexander Rose
3911145f87 Merge branch 'master' of https://github.com/molstar/molstar into cellpack-tweaks 2022-06-26 14:54:15 -07:00
Alexander Rose
350f5c4266 3.10.1 2022-06-26 14:17:31 -07:00
Alexander Rose
ed4056bc8b changelog 2022-06-26 14:04:20 -07:00
Alexander Rose
0d96fa21b7 schema updates 2022-06-26 14:03:09 -07:00
Alexander Rose
0ee8d33d36 package updates 2022-06-26 13:30:44 -07:00
Alexander Rose
64cedec12b fix groupCount updating TextureMesh-based visuals 2022-06-26 12:42:26 -07:00
Alexander Rose
a16eaca42e finalize instanceGranularity 2022-06-26 12:27:02 -07:00
dsehnal
366b3b1b75 3.10.0 2022-06-24 15:59:45 +02:00
dsehnal
33963c085a ShowTrajectoryControls option 2022-06-24 15:56:39 +02:00
Alexander Rose
f3b18ef518 fix & simplify lociApply for instanceGranularity 2022-06-20 22:33:24 -07:00
Alexander Rose
bca1b45fd4 tweak name
- useInstanceGranularity -> instanceGranularity
2022-06-20 22:00:21 -07:00
Alexander Rose
3448d5ef03 Merge branch 'master' of https://github.com/molstar/molstar into cellpack-tweaks 2022-06-20 21:23:32 -07:00
David Sehnal
0f5a6194ff Merge pull request #455 from molstar/support-glycam-names
Support glycam names
2022-06-20 13:37:16 +02:00
David Sehnal
9266faec59 Merge branch 'master' into support-glycam-names 2022-06-20 13:37:10 +02:00
Alexander Rose
94347c6dde cleanup app.ts (#450) 2022-06-19 19:38:43 -07:00
Alexander Rose
7a07701be0 3.9.1 2022-06-19 19:21:25 -07:00
Alexander Rose
42519a4f75 changelog 2022-06-19 19:16:15 -07:00
Alexander Rose
c898c16430 package updates 2022-06-19 19:15:06 -07:00
Alexander Rose
318863bd18 fix missing aromatic bond display
- simplify code to always show when aromatic
2022-06-19 19:05:58 -07:00
Alexander Rose
ce94760d02 fix missing uGroupCount update for visuals 2022-06-19 18:51:16 -07:00
Alexander Rose
99759b5282 add useInstanceGranularity option
- for marker, transparency, clipping, overpaint, substance data
- saves memory
2022-06-19 18:45:31 -07:00
dsehnal
d9d8562ed9 changelog 2022-06-13 19:52:44 +02:00
dsehnal
dee55ea874 support glycam names 2022-06-13 19:52:14 +02:00
dsehnal
da413cc9e6 added missing super.componentWillUnmount 2022-06-10 14:53:26 +02:00
David Sehnal
c72e93a13d Merge pull request #452 from simeonborko/sborko/screenshot-unmount
DownloadScreenshotControls: componentWillUnmount
2022-06-10 14:46:19 +02:00
Simeon Borko
21f910a3ca DownloadScreenshotControls: componentWillUnmount
This should solve the error:

Warning: Can't perform a React state update on an unmounted component.
This is a no-op, but it indicates a memory leak in your application.
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
2022-06-10 10:04:31 +02:00
ludovic autin
06e78e19d0 Merge branch 'forkdev' of https://github.com/corredD/molstar-proto into forkdev 2022-05-31 09:55:03 -07:00
Alexander Rose
2c51edb4c2 changelog 2022-05-30 19:20:41 -07:00
Alexander Rose
da2c893721 Merge branch 'master' of https://github.com/molstar/molstar into cellpack-tweaks 2022-05-30 19:18:49 -07:00
Alexander Rose
e7ce693e50 3.9.0 2022-05-30 11:46:42 -07:00
Alexander Rose
29e8fe7904 fix types 2022-05-30 11:41:40 -07:00
Alexander Rose
baf3a6077e package updates 2022-05-30 11:32:05 -07:00
Alexander Rose
e030e7a32d changelog 2022-05-30 11:29:23 -07:00
Alexander Rose
125566ed75 only call renderBlendedTransparent when needed 2022-05-30 11:27:58 -07:00
Alexander Rose
c51cb67519 Merge pull request #447 from molstar/pick-drawbuffers
use drawbuffers for picking
2022-05-29 23:35:53 -07:00
Alexander Rose
57f086b530 Merge branch 'master' into pick-drawbuffers 2022-05-29 23:32:57 -07:00
Alexander Rose
d1e17785b8 Merge pull request #446 from molstar/webgl-timer
Webgl timing support
2022-05-29 23:32:29 -07:00
Alexander Rose
774328a1d8 Merge branch 'master' into webgl-timer 2022-05-29 23:31:13 -07:00
Alexander Rose
175a0f48fa lint fix 2022-05-29 23:30:36 -07:00
Alexander Rose
60b91ff032 Merge branch 'master' into pick-drawbuffers 2022-05-29 11:11:29 -07:00
David Sehnal
2b003bc5b0 Merge pull request #445 from aliaksei-chareshneu/fix_bad_axis_order
Add check that a data block contains volume data before parsing
2022-05-29 16:00:10 +02:00
David Sehnal
029a2fcab1 Merge branch 'master' into fix_bad_axis_order 2022-05-29 15:59:52 +02:00
Alexander Rose
aa47f7fe4a use instances to create dna/rna curves
- much less memory use (but can't show as single cartoon)
2022-05-28 19:49:56 -07:00
Alexander Rose
a828113d9b use drawbuffers for picking 2022-05-28 13:17:35 -07:00
Alexander Rose
ab4d509eda fix rendering volumes
- when wboit is switched off and postprocessing is enabled
2022-05-28 13:13:35 -07:00
Alexander Rose
1296f32fa8 tweak alpha-orbitals example 2022-05-28 11:54:33 -07:00
Alexander Rose
5aa1ec9876 add timing mode 2022-05-28 11:43:13 -07:00
Alexander Rose
f2cf1ab226 add support for GPU timer queries 2022-05-28 11:20:22 -07:00
Alexander Rose
2d34c2a40b fix Scene.clear not clearing primitives/volumes 2022-05-28 11:07:03 -07:00
Aliaksei
a7181e865c Skipping server data block
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-05-28 08:16:58 +02:00
Aliaksei
0a71b788b3 Apply suggestions from code review
fix bugs and optimizing the code related to iteration over data blocks

Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-05-27 18:22:00 +02:00
aliaksei-chareshneu
1ed3d84043 fix to skip block with header SERVER 2022-05-27 14:26:42 +02:00
aliaksei-chareshneu
f472b75d0d iterate over all blocks as even 0th can contain data 2022-05-27 13:53:08 +02:00
aliaksei-chareshneu
072a9d1ccd add name and email to header; add changelog entry 2022-05-27 12:19:51 +02:00
aliaksei-chareshneu
8e26d1be68 fix bad axis ordering bug 2022-05-27 10:34:48 +02:00
Alexander Rose
c5871e9025 3.8.2 2022-05-22 08:36:50 -07:00
Alexander Rose
f26911b358 changelog 2022-05-22 08:31:57 -07:00
Alexander Rose
3a595b80b5 package updates 2022-05-22 08:30:15 -07:00
Alexander Rose
45760ddd41 fix Scene.opacityAverage not handling xray shaded 2022-05-22 08:22:39 -07:00
Alexander Rose
447d068bf1 3.8.1 2022-05-14 11:59:03 -07:00
Alexander Rose
7e1642a4a3 changelog 2022-05-14 11:53:55 -07:00
Alexander Rose
7781267e78 package updates 2022-05-14 11:53:18 -07:00
Alexander Rose
f824fdcfed improve scene marker/opacity average calculation 2022-05-14 11:43:24 -07:00
Alexander Rose
79dd441967 Merge pull request #436 from JonStargaryen/master
Fix Polymer Chain Instance Coloring
2022-05-09 22:41:33 -07:00
Sebastian Bittrich
9dcf9c0785 CHANGELOG 2022-05-09 15:58:22 -07:00
Sebastian Bittrich
83569462c6 fix instance coloring 2022-05-09 15:53:26 -07:00
Alexander Rose
947e169c3a Merge pull request #434 from JonStargaryen/master
proposed fix for headless-gl issues
2022-05-06 22:29:40 -07:00
Sebastian Bittrich
e6b36c52d1 CHANGELOG 2022-05-06 09:11:40 -07:00
Sebastian Bittrich
7fed3b84fa Merge remote-tracking branch 'upstream/master' 2022-05-06 09:08:53 -07:00
Sebastian Bittrich
cbc941f193 simplify array uniform check 2022-05-06 09:08:22 -07:00
Alexander Rose
a7ef0fb85f add interesting pdb entry 2022-05-05 22:41:16 -07:00
Alexander Rose
d10c36eaf5 fix issues with marking camera/handle helper 2022-05-05 22:40:52 -07:00
Sebastian Bittrich
e4c3a66753 proposed fix for headless-gl issues 2022-05-04 11:50:42 -07:00
Alexander Rose
f58f2cdc90 3.8.0 2022-04-30 16:11:07 -07:00
Alexander Rose
8f2676e91e schema updates 2022-04-30 16:05:30 -07:00
Alexander Rose
89d397898e changelog 2022-04-30 15:24:26 -07:00
Alexander Rose
2dc32be9ee Merge pull request #427 from molstar/transparent-object-outline
Transparent object outline
2022-04-30 15:08:46 -07:00
Alexander Rose
769220bd82 Merge pull request #421 from molstar/color-theme-typing
better color theme typing
2022-04-30 15:06:06 -07:00
Alexander Rose
c75aa5dd52 improve transparency & outlines
- proper per-group transparency with wboit off
- fixed outlines with transparent backgound
2022-04-30 12:53:14 -07:00
Alexander Rose
88f1cfd8c4 fix ignoreLight for direct-volume with webgl1 2022-04-30 09:24:39 -07:00
Alexander Rose
108279c1aa add clearDepth & blendColor to WebGLState 2022-04-30 08:42:01 -07:00
Alexander Rose
8150490aac Merge branch 'master' of https://github.com/molstar/molstar into transparent-object-outline 2022-04-30 08:39:16 -07:00
Alexander Rose
9497aa6362 package updates 2022-04-30 08:38:07 -07:00
Alexander Rose
3769da48a1 handle building GridLookup3D with zero cell size 2022-04-29 20:18:40 -07:00
Alexander Rose
3c21fcd53a fix FormatRegistry.isApplicable
- was returning true for unregistered formats
2022-04-29 20:16:09 -07:00
Alexander Rose
102ef2795d handle outlines for per-group transparency
- fix allowTransparentBackfaces for per-group transparency
2022-04-23 23:02:11 -07:00
Alexander Rose
0befa253c2 add WebGLState.depthFunc 2022-04-23 20:07:41 -07:00
Alexander Rose
87189cee58 support outlines for transparent objects
- cleanup of renderer and draw pass
2022-04-23 15:19:01 -07:00
Alexander Rose
3284f13fc6 fix spec of emptyDepthTexture in Renderer 2022-04-23 15:17:20 -07:00
Alexander Rose
70d219b120 improve Renderer.renderPick typing 2022-04-23 15:13:38 -07:00
Alexander Rose
a5ed3a08ea add Scene.getOpacityAverage 2022-04-23 15:12:16 -07:00
Alexander Rose
3665e7e999 expose RenderTarget.depthRenderbuffer 2022-04-23 15:10:40 -07:00
Alexander Rose
9b583b23ae add Renderbuffer.detachFramebuffer 2022-04-23 15:10:16 -07:00
Alexander Rose
d602415e98 check if WEBGL_depth_texture is supported 2022-04-23 15:09:44 -07:00
Alexander Rose
2c49a423e2 type assertion 2022-04-21 19:47:13 -07:00
Alexander Rose
8a266e70c8 fix handling of struct_conf mmCIF field (#425) 2022-04-21 19:46:50 -07:00
Alexander Rose
0df3bcd65d document supported file formats 2022-04-19 17:43:33 -07:00
dsehnal
f5ecf5648e 3.7.0 2022-04-13 20:04:01 +02:00
dsehnal
821f82fc3f changelog 2022-04-13 20:01:04 +02:00
David Sehnal
92305fe628 Merge pull request #420 from molstar/transparentBackfaces
improve transparentBackfaces handling
2022-04-13 19:57:29 +02:00
David Sehnal
17fe57b8a5 Merge pull request #423 from jpattle/option-to-disable-drag-overlay
Added an option to disable the drag overlay
2022-04-13 16:31:21 +02:00
Jason Pattle
47433a51d3 Added an option to the components spec to allow disabling of the drag-and-drop overlap for Molstar that loads files into the viewer. By default the drag overlay is enabled, just as it was before 2022-04-13 15:00:03 +01:00
Alexander Rose
e090827ced Merge branch 'master' of https://github.com/molstar/molstar into transparentBackfaces 2022-04-10 13:20:22 -07:00
Alexander Rose
856e6a8b74 use ColorTypeLocation as default
- for backwards compatibility
- most used
2022-04-09 19:27:06 -07:00
Alexander Rose
a813b4d40e Merge branch 'master' of https://github.com/molstar/molstar into color-theme-typing 2022-04-09 16:53:17 -07:00
dsehnal
98afc27442 fix react typing 2022-04-09 21:24:14 +02:00
Alexander Rose
9d4f28a395 fix type deps 2022-04-09 11:36:17 -07:00
Alexander Rose
50266d9a56 package updates 2022-04-09 11:20:28 -07:00
Alexander Rose
602a532cf2 better color theme typing 2022-04-09 10:38:03 -07:00
Alexander Rose
b23d610c94 improve transparentBackfaces handling
- off: don't show (default)
- on: show with transparency
- opaque: show fully opaque
2022-04-09 10:17:41 -07:00
Alexander Rose
119c43d527 fix xrayShaded for texture-mesh geometries 2022-04-09 10:04:06 -07:00
Alexander Rose
124feeb790 color theme tweaks
- add optional grid property
- handle dColorType_direct for non direct-volume shaders
2022-04-09 09:57:31 -07:00
dsehnal
2c0e7e84da 3.6.2 2022-04-05 17:59:48 +02:00
dsehnal
0d1e105343 changelog 2022-04-05 17:57:14 +02:00
dsehnal
f040c89ab3 React 18 friendly useBehavior hook 2022-04-05 17:51:13 +02:00
David Sehnal
5e9d8298ef Merge pull request #415 from JonStargaryen/master
ModelServer Ligand Export: Fix Alternate Locations & Mismatching Atoms
2022-04-05 17:49:16 +02:00
Sebastian Bittrich
7766ca2793 CHANGELOG 2022-04-04 11:36:39 -07:00
Sebastian Bittrich
fb2f22f120 Merge remote-tracking branch 'upstream/master' 2022-04-04 11:33:01 -07:00
Sebastian Bittrich
146fed3504 CHANGELOG 2022-04-04 11:32:51 -07:00
Sebastian Bittrich
0b7a6e3375 cleanup 2022-04-04 10:55:44 -07:00
Sebastian Bittrich
f1fbdeaca0 handle missing atoms (ignore hydrogen, fail for heavy) 2022-04-04 10:49:40 -07:00
Sebastian Bittrich
ee7e37f6bc handle deuterated part 2 2022-04-04 09:45:42 -07:00
Sebastian Bittrich
861f665ab3 handle deuterated 2022-04-04 09:17:39 -07:00
dsehnal
456de23ad4 remove console.log 2022-04-03 14:45:41 +02:00
dsehnal
6d3578c17e fix alpha orbitals example 2022-04-03 14:08:31 +02:00
dsehnal
57da7267e2 3.6.1 2022-04-03 13:50:46 +02:00
dsehnal
578b764406 fix react 18 ui: use hooks for overlay components 2022-04-03 13:48:05 +02:00
dsehnal
f65a38a085 TransformControlBase fix 2022-04-03 13:00:09 +02:00
dsehnal
d187757bbc 3.6.0 2022-04-03 11:19:12 +02:00
dsehnal
df83b24cf4 changelog 2022-04-03 11:16:16 +02:00
dsehnal
8e31ce0f5b react 18 support 2022-04-03 11:15:47 +02:00
David Sehnal
4f69eb7963 Merge pull request #414 from molstar/lowercase-str-column
lowercase column schema
2022-04-03 10:53:08 +02:00
Alexander Rose
4b9009216b mmcif schema: use lowercase instead of uppercase 2022-04-02 22:49:57 -07:00
Alexander Rose
895076c837 Merge branch 'master' of https://github.com/molstar/molstar into lowercase-str-column 2022-04-02 16:31:15 -07:00
Alexander Rose
6e398ee64a gh action 2022-04-02 16:13:24 -07:00
Alexander Rose
c2177272b5 gh action 2022-04-02 16:07:32 -07:00
Alexander Rose
4877de5839 re-add gl support to gh action 2022-04-02 15:55:22 -07:00
Alexander Rose
3cb9d10126 fix shader tests & cleanup shader code 2022-04-02 15:52:39 -07:00
Alexander Rose
23c53cd9fb fix disable-wboit Viewer GET param 2022-04-02 15:42:33 -07:00
Alexander Rose
3471743a63 changelog 2022-04-02 15:26:25 -07:00
Alexander Rose
1b0b1809ef handle case-insensitve mmcif fields
- support upper/lower case transforms
- handle case transform for CifField to Column
2022-04-02 15:24:01 -07:00
dsehnal
0833cffead fix undefined value handling and update alised type 2022-04-02 21:48:15 +02:00
Alexander Rose
a0a8ae88b7 Merge branch 'master' of https://github.com/molstar/molstar into lowercase-str-column 2022-04-02 12:27:40 -07:00
David Sehnal
e415cbeca4 Merge pull request #413 from molstar/allowTransparentBackfaces
add allowTransparentBackfaces parameter
2022-04-02 21:00:43 +02:00
dsehnal
4c15c93381 lowercase column schema 2022-04-02 20:54:35 +02:00
Alexander Rose
bd19822112 add allowTransparentBackfaces parameter
- for mesh, spheres, cylinders, texture-mesh geometries
2022-04-01 19:18:24 -07:00
Sebastian Bittrich
b87beb4a6e better msg for UNL 2022-04-01 16:58:32 -07:00
Sebastian Bittrich
62a58facb2 better error msg for unknown components 2022-04-01 15:51:00 -07:00
Sebastian Bittrich
5fa8178df7 fix handling of alternate locations in ligand-encoder#_getAtoms 2022-04-01 11:47:59 -07:00
David Sehnal
d6043e7d1f Merge pull request #411 from JonStargaryen/master
fix volume streaming for entries with multiple contour lists
2022-04-01 13:35:57 +02:00
Sebastian Bittrich
8e432dfbb4 CHANGELOG 2022-03-30 09:27:40 -07:00
Sebastian Bittrich
324ab3744b fix volume streaming for entries with multiple contour lists 2022-03-30 09:19:36 -07:00
Alexander Rose
33ee4d0418 Merge pull request #409 from JonStargaryen/master
Fix unit mapping in bondedAtomicPairs MolScript query
2022-03-29 18:11:59 -07:00
Alexander Rose
cbb104ccba Merge branch 'master' into master 2022-03-29 18:11:37 -07:00
Alexander Rose
0bda5461ae Merge pull request #403 from molstar/pdb-conect
improve pdb parsing
2022-03-29 18:01:56 -07:00
Sebastian Bittrich
4096a03de1 CHANGELOG 2022-03-29 11:40:46 -07:00
Sebastian Bittrich
fbee5f83df fix mapping issues in bondedAtomicPairs 2022-03-29 11:34:53 -07:00
Alexander Rose
84a1b19850 improve Model.hasSecondaryStructure
- check ModelSecondaryStructure.Provider.isApplicable
2022-03-28 18:51:54 -07:00
Alexander Rose
1df5bd6d03 make use of PDB TER record 2022-03-28 18:47:00 -07:00
Alexander Rose
8bd4221a85 improve pdb parsing
- handle non unique atom and chain names
- fixes #156
2022-03-26 11:26:20 -07:00
Alexander Rose
4d97ccdfb3 improve bonds assignment of coarse grained models
- check for IndexPairBonds and exhaustive StructConn
2022-03-26 11:22:04 -07:00
Alexander Rose
ca5e57ddbf fix aromatic rings assignment 2022-03-26 11:17:46 -07:00
Alexander Rose
ed6511799b check model and coordinates element count 2022-03-26 11:15:19 -07:00
Alexander Rose
9b1223ec15 improve webgl error/type handling 2022-03-26 11:12:28 -07:00
Alexander Rose
97210ee67a avoid calculating actionItems for isDisabled check 2022-03-26 11:11:22 -07:00
David Sehnal
308d1003ad Merge pull request #401 from molstar/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-03-25 14:07:50 +01:00
dependabot[bot]
ce9e193958 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 12:50:11 +00:00
dsehnal
2a83afa8c1 3.5.0 2022-03-25 13:49:33 +01:00
dsehnal
8891fa328b cif2bcif BCIF => CIF conversion support 2022-03-25 13:45:00 +01:00
David Sehnal
a23c06c456 Merge pull request #399 from MadCatX/dnatco-changeable-colors
Make Confal pyramids colors changeable
2022-03-22 13:25:32 +01:00
Michal Malý
34e87121e1 Make Confal pyramids colors changeable 2022-03-21 09:07:49 +01:00
Alexander Rose
6e5c20f442 improve surface bounding-sphere
- use exact max radius to expand structure/unit sphere
2022-03-19 12:21:55 -07:00
Alexander Rose
8ac3bec451 improve color-smoothing
- use padded box
2022-03-19 12:20:12 -07:00
Alexander Rose
5128d0f405 improve Sphere3D.expand & Box3D.fromSphere3D
- ensure extrema are within radius
- avoid degenerate box for low number of points
2022-03-19 12:19:39 -07:00
Alexander Rose
6ae2121391 guard against zero window.devicePixelRatio 2022-03-19 11:43:41 -07:00
David Sehnal
749e0c5a47 Merge pull request #396 from MadCatX/dnatco-off-by-one
DNATCO extension: Fix off-by-one error in element lookup
2022-03-17 09:21:11 +01:00
Michal Malý
7b55ef85e1 DNATCO extension: Fix missing Confal pyramids in some structures 2022-03-17 07:47:47 +01:00
Alexander Rose
23ec35d1f9 3.4.0 2022-03-13 13:12:32 -07:00
Alexander Rose
ff089c2b9f changelog 2022-03-13 12:50:44 -07:00
Alexander Rose
1ab088718a package updates 2022-03-13 12:49:03 -07:00
Alexander Rose
0cb2e5857a Merge pull request #393 from molstar/zenodo-import
Zenodo import
2022-03-13 12:19:04 -07:00
Alexander Rose
7c5ae5d7ee tweak guessElementSymbolString 2022-03-13 12:16:12 -07:00
Alexander Rose
6e2665d98d Merge branch 'master' of https://github.com/molstar/molstar into zenodo-import 2022-03-12 18:03:45 -08:00
Alexander Rose
b3b4692237 add top format support 2022-03-12 17:46:29 -08:00
Alexander Rose
55ff1d4999 add nctraj format support 2022-03-12 14:17:58 -08:00
Alexander Rose
511c839237 add prmtop format support 2022-03-12 13:48:10 -08:00
Alexander Rose
384cd6e5d9 add trr format support 2022-03-12 13:02:50 -08:00
Alexander Rose
6fd9dcc72e split structure formats into topology & coordinates 2022-03-12 11:51:03 -08:00
Alexander Rose
12ca06fe91 fix handling of empty symmetry cell data 2022-03-12 11:44:27 -08:00
Alexander Rose
652f6c651b fix wrong element assignment 2022-03-12 10:58:33 -08:00
Alexander Rose
7dd808a772 add custom import controls 2022-03-12 10:52:43 -08:00
Alexander Rose
945e55f8a7 add formated file size 2022-03-07 22:06:22 -08:00
Alexander Rose
866a30abe5 cleanup getFileInfo 2022-03-07 22:05:11 -08:00
Alexander Rose
f0e33e1e4e fix legend of hydrophobicity color theme 2022-03-07 21:44:57 -08:00
Alexander Rose
8723ca38b4 improve saccharide detection 2022-03-07 21:31:33 -08:00
Alexander Rose
efffca0026 zenode import fixes 2022-03-06 21:57:42 -08:00
Alexander Rose
6c5eb3035f remove default record id 2022-03-06 17:55:52 -08:00
Alexander Rose
0bf385f2ca add zip file support to zenodo extension 2022-03-06 17:37:39 -08:00
Alexander Rose
9d5f51f513 improve handling of compressed files
- fix loading of some compressed files within sessions
- ignore some hidden MACOSX files
2022-03-06 17:32:56 -08:00
Alexander Rose
a1448131d8 add Zenodo import extension 2022-03-06 11:12:21 -08:00
Alexander Rose
664cacc7ac add LoadTrajectory action 2022-03-06 11:11:16 -08:00
Alexander Rose
1aec37dd05 fix 2022-03-06 11:09:51 -08:00
Alexander Rose
3ff2c0840e Merge pull request #392 from molstar/assert-unreachable
make use of assertUnreachable
2022-03-06 11:06:04 -08:00
Alexander Rose
5ca3c3ac52 Update src/mol-script/language/parser.ts 2022-03-06 11:04:58 -08:00
Alexander Rose
714ee50965 Update src/mol-script/language/parser.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-03-06 11:03:33 -08:00
Alexander Rose
ae1df3c5aa Update src/mol-script/language/parser.ts
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-03-06 11:03:28 -08:00
Alexander Rose
28afb39550 make use of assertUnreachable 2022-03-05 10:18:40 -08:00
Alexander Rose
3466a8a024 Merge pull request #389 from molstar/cif-check-present
fix handling of mmcif with empty label_asym_id
2022-03-05 09:20:19 -08:00
Alexander Rose
90db3321f5 changelog
Co-authored-by: David Sehnal <dsehnal@users.noreply.github.com>
2022-03-05 09:20:04 -08:00
Alexander Rose
bf4e5ed7c2 normalize mmcif data 2022-03-04 22:47:14 -08:00
Alexander Rose
d3b2c20c26 normalize atom_site early 2022-03-03 18:31:54 -08:00
Alexander Rose
c3afabb4b1 spelling 2022-03-02 19:50:30 -08:00
Alexander Rose
18cc9790d1 fix handling of mmcif with empty label_asym_id 2022-03-02 19:17:31 -08:00
Alexander Rose
d5ed3aa674 3.3.1 2022-02-27 18:45:45 -08:00
Alexander Rose
cfb9c9acfe changelog 2022-02-27 18:40:48 -08:00
Alexander Rose
67feef0b1d add option to ignore ions for inter-unit bonds 2022-02-27 18:40:27 -08:00
Alexander Rose
e0192ab5aa fix issue with unit boundary reuse
- do at visual level instead
2022-02-27 18:03:41 -08:00
Alexander Rose
eae7c11c55 3.3.0 2022-02-27 13:03:01 -08:00
Alexander Rose
b8251e1ade changelog 2022-02-27 12:57:51 -08:00
Alexander Rose
2ff2b9f348 schema updates 2022-02-27 12:50:48 -08:00
Alexander Rose
164e3f3343 package updates 2022-02-27 12:47:45 -08:00
Alexander Rose
4901a1bd87 rename occlusion scaleFactor to resolutionScale 2022-02-27 12:16:37 -08:00
Alexander Rose
cd194cca65 Merge pull request #385 from molstar/traj-anim
Coordinate trajectory related improvements
2022-02-27 12:04:28 -08:00
Alexander Rose
1748efbc18 Merge branch 'master' of https://github.com/molstar/molstar into traj-anim 2022-02-27 12:03:54 -08:00
Alexander Rose
4d60b40403 fix interUnitBonds parent check 2022-02-27 12:02:36 -08:00
Alexander Rose
6e5a41879f Merge pull request #386 from molstar/improve-ao
Improve AO performance
2022-02-27 11:58:50 -08:00
Alexander Rose
c5f9eb54da set default occlusion scaleFactor to 1 2022-02-26 23:51:21 -08:00
Alexander Rose
aebbfeb061 add support for lower resolution AO
- downsample depth for AO
- add scaleFactor param
- full res for image/video
2022-02-26 22:23:52 -08:00
Alexander Rose
a0a5a6b578 add encoder spec
- mostly as example
2022-02-26 17:43:37 -08:00
Alexander Rose
6bdafb85d7 Check if marking passes are needed
- add Scene.getMarkerAverage
2022-02-26 13:30:05 -08:00
Alexander Rose
0dd7debf5d reuse occlusion in multi-sample pass 2022-02-26 13:02:53 -08:00
Alexander Rose
962b9ee7af Merge pull request #378 from molstar/ar-bonds
fix visuals for aromatic/delocalized bonds
2022-02-26 11:34:42 -08:00
Alexander Rose
15bcc5df88 Merge branch 'master' into ar-bonds 2022-02-26 11:26:29 -08:00
Alexander Rose
8495d834c8 add getTripletIndices & triplets to UnitResonance 2022-02-26 11:25:35 -08:00
Alexander Rose
7282399709 fix/improve canRemap handling in IntraUnitBonds 2022-02-26 10:56:32 -08:00
Alexander Rose
780bdd6e7e don't compute InterUnitBonds when parent ones empty 2022-02-26 10:53:54 -08:00
Alexander Rose
ad08e7c67f reuse unit boundary if it has not changed too much 2022-02-26 10:52:26 -08:00
Alexander Rose
ff089964ca improve line visuals in polymerAndLigand preset 2022-02-26 10:50:02 -08:00
Alexander Rose
990191529a reuse Model.CoarseGrained for coordinate trajectories 2022-02-26 10:48:05 -08:00
Alexander Rose
ce1bec12b4 fix mononucleotides detected as polymer components 2022-02-26 10:46:51 -08:00
Alexander Rose
703ea9af53 change line geometry default scaleFactor to 2
- 3 is too big after fixing line rendering
2022-02-26 10:45:51 -08:00
David Sehnal
df0227ae1e Merge pull request #383 from molstar/batch-highlights
Resolve marking in main render loop
2022-02-24 07:46:44 +01:00
dsehnal
486d12b6ac Fix multisample pass "forceOn" 2022-02-24 07:20:03 +01:00
dsehnal
9c18375ab4 typo 2022-02-23 23:34:09 +01:00
dsehnal
e1708aed68 dispose mark buffer 2022-02-23 19:09:40 +01:00
dsehnal
a42d778b84 changelog 2022-02-23 12:04:38 +01:00
dsehnal
7692b59c7c resolve marking in main render loop insread of eagerly 2022-02-23 11:59:29 +01:00
dsehnal
82de9b36b3 addRing check tweak 2022-02-22 16:02:11 +01:00
dsehnal
49b3c8f65f ring computation algorithm fixes 2022-02-22 13:16:32 +01:00
Alexander Rose
90ad32d936 add ring example PDB IDs 2022-02-21 13:48:43 -08:00
David Sehnal
2509e91f1a Merge pull request #381 from russellp17/disable-ts-config-for-sourceMappingURL
Disable ts config that leads to sourceMappingURL comment
2022-02-21 15:20:00 +01:00
David Sehnal
80dc2219e4 Merge pull request #380 from russellp17/allow-react-16-in-peer-dependency
Allow React ^16.14.0 as peer dependency
2022-02-21 15:10:33 +01:00
Russell Parker
931cb0fa7d Disable ts config that leads to sourceMappingURL comment in transpilation 2022-02-21 08:24:09 -05:00
Russell Parker
4383f2ea90 Allow React ^16.14.0 as peer dependency 2022-02-21 08:20:55 -05:00
dsehnal
add79dc242 ring computation algorithm fix 2022-02-21 14:15:13 +01:00
Alexander Rose
b6e142f04c move delocalizedTriplets code to unit.resonance 2022-02-20 16:28:42 -08:00
Alexander Rose
105f6c3041 fix visuals for aromatic/delocalized bonds 2022-02-20 12:50:44 -08:00
Alexander Rose
4babbb65c1 fix spec 2022-02-19 17:22:25 -08:00
Alexander Rose
878159f7ed fix texture warnings (#319)
- bind real texture to tDepth in renderer
- ensure textures are not empty; init as 1x1(x1)
2022-02-19 16:59:03 -08:00
Alexander Rose
c320386019 changelog 2022-02-19 14:23:37 -08:00
Alexander Rose
1e7a0159f0 Merge pull request #377 from JonStargaryen/master
parse contour-level from emdb v3 header files
2022-02-19 14:20:48 -08:00
JonStargaryen
bbf4f1d1d3 break early 2022-02-19 11:02:30 -08:00
Alexander Rose
8cd1c69c76 css tweaks, fixes #376 2022-02-19 10:46:06 -08:00
JonStargaryen
2372a878ac parse contour-level from emdb v3 header files 2022-02-19 09:12:20 -08:00
dsehnal
9bec644997 3.2.0 2022-02-17 19:24:55 +01:00
dsehnal
650d38dff8 Store IndexPairBonds as a dynamic property 2022-02-17 19:21:49 +01:00
David Sehnal
097277e397 Merge pull request #373 from JonStargaryen/master
Add TraceOnly option for Structure Superposition
2022-02-14 19:53:51 +01:00
Sebastian Bittrich
82a4d5eedf cleanup 2022-02-14 10:46:03 -08:00
Sebastian Bittrich
2a00248812 determine trace during buildIndex 2022-02-14 10:41:10 -08:00
Sebastian Bittrich
9841c773cb reset camera after all alignments 2022-02-10 13:55:09 -08:00
Sebastian Bittrich
b21a78ad14 support shuffled atoms when aligning SIFTS trace 2022-02-10 13:49:37 -08:00
Sebastian Bittrich
7329fa597d options obj for alignAndSuperposeWithSIFTSMapping 2022-02-10 11:36:50 -08:00
Sebastian Bittrich
f1d8f0ecb4 auth 2022-02-10 11:32:21 -08:00
Sebastian Bittrich
1d127f2364 changelog 2022-02-10 11:30:55 -08:00
Sebastian Bittrich
b244405cc3 polymer-based query 2022-02-10 10:39:22 -08:00
Sebastian Bittrich
38adfe0ca6 cleanup 2022-02-10 10:29:34 -08:00
Sebastian Bittrich
6f0d798847 optional filtering for trace during alignment 2022-02-10 10:23:31 -08:00
Sebastian Bittrich
6e58bfd2b0 traceOnly param for superpos 2022-02-08 16:03:05 -08:00
David Sehnal
bc2e8d8ac4 Merge pull request #369 from molstar/pdbx_sifts-export
Better support for atom_site.pdbx_sifts_xref
2022-02-08 10:19:02 +01:00
dsehnal
7be654d47f tweak labels 2022-02-08 10:18:01 +01:00
dsehnal
bfe46e3604 pdbx_sifts_xref PR feedback 2022-02-08 10:12:21 +01:00
dsehnal
008b597fc5 changelog 2022-02-07 17:51:13 +01:00
dsehnal
c4b4f2e3b1 rename BestDatabaseSequenceMapping -> SIFTSMapping 2022-02-07 17:49:10 +01:00
dsehnal
76ee97301b atom_site.pdbx_label_index support 2022-02-07 17:44:03 +01:00
dsehnal
289dc09eae add support for atom_site.pdbx_sifts_xref export 2022-02-07 17:33:11 +01:00
Alexander Rose
f23f84f0f3 3.1.0 2022-02-06 15:56:41 -08:00
Alexander Rose
62259f3295 changelog 2022-02-06 15:51:40 -08:00
Alexander Rose
854a430a12 tweak quick-styles order 2022-02-06 15:46:40 -08:00
Alexander Rose
d27cdb5637 schema updates 2022-02-06 15:41:09 -08:00
Alexander Rose
7d12d9ee90 package udpdates 2022-02-06 15:38:09 -08:00
Alexander Rose
d70a4ff347 Merge pull request #366 from molstar/repr-defaults-tweaks
cleaner default representation style
2022-02-06 15:24:27 -08:00
Alexander Rose
49541558d1 Merge branch 'master' into repr-defaults-tweaks 2022-02-06 15:24:16 -08:00
Alexander Rose
7b00a1227c changelog 2022-02-06 15:22:50 -08:00
Alexander Rose
7800603c81 Merge pull request #367 from molstar/quick-styles
Quick styles
2022-02-06 15:16:43 -08:00
Alexander Rose
fca00c8116 variable naming 2022-02-06 15:15:55 -08:00
Alexander Rose
00fa549e44 Merge pull request #368 from JonStargaryen/master
iterate over `structure.unitSymmetryGroups`, fixes #364
2022-02-06 15:13:57 -08:00
Alexander Rose
36181b6b87 tweak quick style names 2022-02-06 15:13:15 -08:00
JonStargaryen
88a95162e9 iterate over structure.unitSymmetryGroups, fixes #364 2022-02-06 10:47:40 -08:00
Alexander Rose
9c1d59a2c8 add Quick Styles panel 2022-02-05 12:58:32 -08:00
Alexander Rose
fdd894956a fix representation preset side effects 2022-02-05 12:56:55 -08:00
Alexander Rose
eb6dc0859d cleaner default representation style 2022-02-05 12:23:28 -08:00
Alexander Rose
b99026bba2 add ignoreLight to component params 2022-02-05 12:10:56 -08:00
Alexander Rose
6fa50eb8d5 fix xrayShader & ignoreLight not working together 2022-02-05 11:57:39 -08:00
David Sehnal
e5046f15a9 Merge pull request #365 from JonStargaryen/master
Volume Streaming Error Message
2022-02-04 17:11:31 +01:00
JonStargaryen
09f1c066a0 logic 2022-02-03 17:11:50 -08:00
Sebastian Bittrich
ed2f0b34c9 volume streaming err msg 2022-02-03 16:11:10 -08:00
Alexander Rose
c7f75861de 3.0.2 2022-01-30 12:24:48 -08:00
Alexander Rose
ccd04dbc9d changelog 2022-01-30 12:19:49 -08:00
Alexander Rose
e71f8d2c10 Merge pull request #360 from molstar/fix/visual-visibility
Fix visual visibility edge case
2022-01-30 12:17:12 -08:00
dsehnal
d9b4c60239 Fix visual visibility edge case 2022-01-30 15:02:46 +01:00
Alexander Rose
103c1fca21 measurement options tweaks
- allow larger text size
- make customText essential
2022-01-29 19:30:03 -08:00
Alexander Rose
49559bf5fb citation tweak 2022-01-29 16:05:17 -08:00
Alexander Rose
26dceabf83 add citation file 2022-01-29 15:56:39 -08:00
Alexander Rose
abe506182e fix multi-instance entity label display
- fix empty elements created in extendToAllInstances
2022-01-29 11:21:48 -08:00
Alexander Rose
582a0e2a38 fix Sphere.expand for highly directional extrema 2022-01-29 11:13:19 -08:00
dsehnal
2784ccf379 3.0.1 2022-01-27 12:15:53 +01:00
dsehnal
0ad1d578fe changelog 2022-01-27 12:13:22 +01:00
David Sehnal
31fd1c9c68 Merge pull request #353 from molstar/drag-tweak
emit drag event whenever started within viewport
2022-01-27 12:12:07 +01:00
David Sehnal
9c961297a2 Merge branch 'master' into drag-tweak 2022-01-27 12:11:59 +01:00
David Sehnal
b920053349 Merge pull request #352 from molstar/var-fixes
Various fixes
2022-01-27 12:09:39 +01:00
David Sehnal
0a5c764e4a Merge pull request #351 from molstar/volume-server-data-fix
Volume server data fix
2022-01-27 11:37:31 +01:00
Alexander Rose
b9a71c83ff emit drag event whenever started within viewport 2022-01-26 21:32:14 -08:00
Alexander Rose
3255f207d0 Merge branch 'master' of https://github.com/molstar/molstar into var-fixes 2022-01-26 20:46:11 -08:00
Alexander Rose
e3b4ca8862 add entity-id and entity-source as carbonColor 2022-01-26 20:42:38 -08:00
Alexander Rose
6810793015 fix marking of InteractionsInterUnitVisual 2022-01-26 20:40:12 -08:00
Alexander Rose
1feb3c2095 fix entity-id coloring broken for non-ihm models 2022-01-26 20:38:46 -08:00
Alexander Rose
f2da6033d0 fix pdbe xray maps url 2022-01-26 20:36:52 -08:00
Alexander Rose
28bc212132 fix marking pass for transparentBackground 2022-01-26 20:35:38 -08:00
dsehnal
1a7c62eec6 remove gl from dependencies & install it on demand instead
- installing gl on M1 Mac was taking several minutes to compile on each update
2022-01-26 23:12:12 +01:00
dsehnal
de67dbacba iso-value adjustment for VolumeServer data in default Viewer 2022-01-26 17:47:23 +01:00
dsehnal
57223a0f9a Fix VolumeServer/query CLI 2022-01-26 16:49:18 +01:00
Alexander Rose
2ad0754b90 3.0.0 2022-01-23 18:12:48 -08:00
Alexander Rose
3ecb3af57b changelog 2022-01-23 18:08:01 -08:00
Alexander Rose
ec4f15f549 improve/fix InteractionsIntraUnitVisual marking 2022-01-23 17:55:51 -08:00
Alexander Rose
2458ea7b92 Merge pull request #349 from molstar/custom-theme-colors
add custom theme colors
2022-01-23 15:13:24 -08:00
Alexander Rose
c5e6bedf11 Merge branch 'master' into custom-theme-colors 2022-01-23 13:54:57 -08:00
dsehnal
8528e5a666 Support/bugfixes for atom_site.pdbx_sifts_xref categories 2022-01-23 20:46:49 +01:00
dsehnal
6ed232b3d9 fix using default values for webgl1/wboit features in the default viewer app 2022-01-23 19:25:09 +01:00
dsehnal
f8aae8cbd1 skip Coarse models in export extension 2022-01-23 16:13:02 +01:00
Alexander Rose
00c2517045 package updates 2022-01-22 14:06:26 -08:00
Alexander Rose
99b043a929 avoid circular dependency 2022-01-22 11:10:41 -08:00
Alexander Rose
5900e27e39 add custom theme colors
- element-symbol
- molecule-type
- residue-name
- secondary-structure
2022-01-22 10:51:41 -08:00
Alexander Rose
1b79d34907 fix marking of carbohydrate visuals 2022-01-22 08:53:47 -08:00
Alexander Rose
fc52e29c92 re-add using _struct_asym cat in getStructAsymMap
- needed for ihm model support
2022-01-22 08:50:29 -08:00
Alexander Rose
df23b3c0fe fix coarse model support in entity-id color theme
- add StructureProperties.coarse.entity_id
2022-01-22 08:48:07 -08:00
David Sehnal
5e25716c98 Merge pull request #334 from molstar/export-extension
Model export extension & related improvements
2022-01-18 13:23:11 +01:00
dsehnal
f70a10bc56 add info about CIF export failure 2022-01-18 13:20:53 +01:00
dsehnal
0ccb045f4e Merge branch 'master' of https://github.com/molstar/molstar into export-extension 2022-01-18 12:30:45 +01:00
Alexander Rose
fa18d0d852 3.0.0-dev.10 2022-01-17 14:08:28 -08:00
Alexander Rose
687c4342fb changelog 2022-01-17 14:03:55 -08:00
Alexander Rose
9459af46b8 Merge pull request #337 from molstar/anim-rock
Add rock animation
2022-01-17 13:38:08 -08:00
Alexander Rose
fc5832747a Merge pull request #345 from molstar/bump-immutable
bump immutable to 4.0
2022-01-17 13:37:19 -08:00
Alexander Rose
01205d244b tweak trackball speed calc 2022-01-17 13:16:19 -08:00
dsehnal
31a555255a bump immutable to 4.0 2022-01-17 17:56:39 +01:00
dsehnal
fbb60c9493 Treat empty string as non-present value in BinaryCIF 2022-01-17 16:21:14 +01:00
dsehnal
9f953ef51c add Model Export overlay 2022-01-17 15:47:56 +01:00
dsehnal
4871f1547c Generate structAsymMap from normalized atomic hierarchy
- Fixes issue with remapped chains
- Requires to parse PRD separately
2022-01-17 14:52:53 +01:00
dsehnal
d6413529f4 PR feedback 2022-01-17 13:58:20 +01:00
dsehnal
724cf5a0da Add integrations section to readme 2022-01-17 12:58:35 +01:00
dsehnal
b6847907ca Add ModelExport to viewer/app.ts 2022-01-17 11:37:49 +01:00
dsehnal
fb54a1aed7 Merge branch 'master' of https://github.com/molstar/molstar into export-extension 2022-01-17 11:37:16 +01:00
Alexander Rose
9815318daf add entity-source option to illustrative coloring 2022-01-16 23:08:43 -08:00
Alexander Rose
bc13b98111 Merge branch 'master' of https://github.com/molstar/molstar into anim-rock 2022-01-16 15:48:33 -08:00
Alexander Rose
238b70c121 simplify rock state/trackball animation
- use sin() instead of smoothstep()
2022-01-16 15:47:25 -08:00
Alexander Rose
dcd23bc0cb improve illustrative style support
- add illustrative representation preset
- add style option to illustrative color theme
2022-01-16 13:13:00 -08:00
Alexander Rose
4694ea85fa support custom colors in molecule-type theme 2022-01-16 13:05:43 -08:00
Alexander Rose
bdb17743d7 update schemas 2022-01-15 19:54:22 -08:00
Alexander Rose
8b76ff2461 update packages 2022-01-15 19:53:04 -08:00
Alexander Rose
ea5421002b add camera rock state animation 2022-01-15 18:59:12 -08:00
Alexander Rose
76ac55917d type, tweaks 2022-01-15 18:45:56 -08:00
Alexander Rose
5cfb2376c4 Merge branch 'master' of https://github.com/molstar/molstar into anim-rock 2022-01-15 15:56:55 -08:00
Alexander Rose
6b9d3fd80e cleaner MembraneOrientationVisuals defaults 2022-01-15 13:52:14 -08:00
dsehnal
a09752b62e changelog and contibutors in package.json 2022-01-14 12:53:51 +01:00
David Sehnal
3134e1d9f9 Merge pull request #341 from molstar/fix-camera-spin-stutter
Pass animation info to state animations
2022-01-14 12:51:51 +01:00
David Sehnal
e94ecf2a0b Merge pull request #314 from ptourlas/feature/formal-charge-labels
Feature/formal charge labels
2022-01-14 12:51:09 +01:00
ptourlas
1bd4d841a1 ADD: Test multiple charge lines in molfiles 2022-01-12 17:01:36 +02:00
ptourlas
8e349f47a5 (author tags) 2022-01-12 16:50:06 +02:00
ptourlas
119c0a4231 ADD: Test formal charge parsing in sdf reader 2022-01-12 16:25:23 +02:00
ptourlas
f009f533e0 TWEAK: Default charges in V3000 sdf files 2022-01-12 15:05:07 +02:00
ptourlas
3ab0c1e509 ADD: Test formal charge parsing in mol reader 2022-01-12 12:42:29 +02:00
dsehnal
e3d264e239 Pass animation info to state animations
+ Fix camera stutter for "camera spin"
2022-01-11 19:38:32 +01:00
dsehnal
9bd60f8e8e Fix getOperatorsForIndex 2022-01-11 17:34:43 +01:00
ptourlas
bcec1d9637 (forgot to cleanup) 2022-01-11 16:41:23 +02:00
ptourlas
1b431b1d20 RFR: Formal charge assignment at model creation 2022-01-11 16:04:46 +02:00
ptourlas
23c2dcdfd4 FIX: Use tokenizer to ensure the loop terminates 2022-01-11 15:01:15 +02:00
ptourlas
dd415bf802 FTR: Support multiple formal charge lines
* Start with two empty arrays for indexes and charges.
* Each `M CHG` line is passed to `handleFormalCharges()` and the
parsed elements are pushed to the arrays.
* The `Column`s are made at the end of this process.
2022-01-11 14:40:57 +02:00
ptourlas
7bc0e9db7c RFR: formalChargeMapper tweaks
* The key is of type number, no need to stringify it.
* Simplified `switch()`.
2022-01-11 00:18:25 +02:00
ptourlas
ca10bb01db Merge branch 'molstar:master' into feature/formal-charge-labels 2022-01-10 23:46:37 +02:00
Alexander Rose
c0f14b7c33 3.0.0-dev.9 2022-01-09 18:24:30 -08:00
Alexander Rose
b096f328fc changelog 2022-01-09 18:19:52 -08:00
Alexander Rose
88dbd43884 re-allow interaction during trackball animation
- was disallowed as a stop-gap measure
- ok after improving temporal multi sampling
2022-01-09 14:39:09 -08:00
Alexander Rose
ade5e4d4b8 re-allow interaction during trackball animation
- was disallowed as a stop-gap measure
- ok after improving temporal multi sampling
2022-01-09 14:30:43 -08:00
ptourlas
cb76b53a1b FTR: Add formal charges during model creation
This implementation takes into account both the property and atom block
cases and makes sure the latter is ignored if the first one is present.
2022-01-10 00:30:25 +02:00
Alexander Rose
b9423f70d4 Merge branch 'master' of https://github.com/molstar/molstar into anim-rock 2022-01-09 14:25:36 -08:00
Alexander Rose
d61e18e6f3 fix mol2 element symbol assignment 2022-01-09 14:04:31 -08:00
Alexander Rose
ca4a725a79 Merge pull request #336 from molstar/bond-dist-id
IndexPairBonds improvements
2022-01-09 13:37:38 -08:00
Alexander Rose
17a18d5fea tweak bond assignment from IndexPairBonds
- fix & clarify logic
2022-01-09 13:25:14 -08:00
Alexander Rose
73be238ac4 rename IndexPairBonds mapping field from id to key 2022-01-09 12:51:26 -08:00
Alexander Rose
796a034fec add rock animation to trackball controls 2022-01-08 17:02:33 -08:00
Alexander Rose
952b320975 Merge branch 'master' of https://github.com/molstar/molstar into bond-dist-id 2022-01-08 13:23:15 -08:00
Alexander Rose
be0f06ff0f fix mol2 crysin support 2022-01-08 13:22:26 -08:00
Alexander Rose
6294ef2db2 fix stats for single element in multi-chain unit
- observe in, e.g., label for water molecule in 3pqr
2022-01-08 12:42:37 -08:00
Alexander Rose
78b5d505bd improve IndexPairBonds
- add id field
- better distance-based assignment
2022-01-08 12:35:40 -08:00
Alexander Rose
22afdffa15 add mol2 symmetry support
- only for spacegroup setting 1
2022-01-08 12:14:14 -08:00
Alexander Rose
d1056eddeb Merge pull request #335 from molstar/standalone-viewer
move Viewer class to separate file
2022-01-08 11:55:53 -08:00
dsehnal
8655f4d85a move viewer app to separate file 2022-01-08 10:31:53 +01:00
ptourlas
f9deb54352 FIX: Found the right tokenizer operations
(at last)
2022-01-08 01:16:59 +02:00
ptourlas
eae3c1b33a FIX: Formal charges are all on the same line
Therefore we have to get the count of charges and iterate based on that.
A handle properties function is added so that new handler can be used based
the property type. Note that this function only returns the charges at
the moment for simplicity. A more general version should return multiple
properties.
2022-01-07 16:14:47 +02:00
ptourlas
5c5f8aa741 FTR:(WIP) Add formal charges during model creation 2022-01-06 16:12:44 +02:00
ptourlas
ba68ac2e32 FTR: Parse formal charges in the atom block 2022-01-06 15:58:49 +02:00
ptourlas
239fef281e Merge branch 'master' into feature/formal-charge-labels 2022-01-06 13:32:05 +02:00
dsehnal
c0880b647f changelog 2022-01-03 13:51:09 +01:00
dsehnal
039dc6a76b changelog 2022-01-03 13:49:59 +01:00
dsehnal
042a7625ad isWithoutOperator tweak 2022-01-03 13:46:13 +01:00
dsehnal
41827c478d open zip files with multiple entries 2022-01-03 13:42:37 +01:00
dsehnal
9a73180c3c support transformed export & structAsymMap parsing fix 2022-01-03 13:15:51 +01:00
dsehnal
333ee85fdb omit suffix for identity assembly operators 2022-01-03 12:52:05 +01:00
dsehnal
fa8ca45b6a do not include assembly categories in export if an operator has been applied 2022-01-03 12:34:37 +01:00
dsehnal
c2bae1aeb7 model export extension 2022-01-03 12:26:36 +01:00
Alexander Rose
ada7a45fe6 add PDBj pdb-provider option 2022-01-01 16:56:23 -08:00
Alexander Rose
2d09df55a9 3.0.0-dev.8 2021-12-31 11:42:09 -08:00
Alexander Rose
ec2554537e changelog 2021-12-31 11:37:40 -08:00
Alexander Rose
f266dfadc6 emulate round function for webgl1 compatibility 2021-12-31 11:37:02 -08:00
Alexander Rose
99048eed61 Merge pull request #323 from molstar/dv-refactor
Direct-volume refactor
2021-12-31 10:43:26 -08:00
Alexander Rose
fe63718b0c Merge branch 'master' into dv-refactor 2021-12-31 10:34:50 -08:00
Alexander Rose
2c1200433c Merge pull request #333 from molstar/surface-size-theme
Use size theme in molecular/gaussian surface & label representations
2021-12-31 10:33:46 -08:00
Alexander Rose
4a3252c929 use size theme in label repr 2021-12-30 18:17:40 -08:00
Alexander Rose
5e052174ee use size theme in molecular/gaussian surface repr 2021-12-30 18:12:53 -08:00
Alexander Rose
cda0966105 filter repr size themes to applicable types 2021-12-30 18:01:02 -08:00
Alexander Rose
c0a9716846 Merge branch 'master' of https://github.com/molstar/molstar into dv-refactor 2021-12-30 17:30:44 -08:00
Alexander Rose
18c7395f9d Merge pull request #326 from molstar/marker-fixes
Marker improvements
2021-12-30 17:29:07 -08:00
Alexander Rose
d3da79f3dd better use of StateSelection API 2021-12-30 17:18:21 -08:00
Alexander Rose
5a215daca4 remove superfluous arg from canvas3d.requestDraw 2021-12-30 17:14:07 -08:00
Alexander Rose
8527a3b3ef change canvas3d draw to use options argument 2021-12-30 17:08:28 -08:00
Alexander Rose
492dc1ba32 Merge branch 'master' of https://github.com/molstar/molstar into marker-fixes 2021-12-30 17:04:17 -08:00
Alexander Rose
305a8ca802 Merge pull request #332 from molstar/fix-331
fix gpu isosurface group id
2021-12-30 17:02:54 -08:00
Alexander Rose
6d2a35494f rename float-packing to number-packing
- more telling name
2021-12-30 17:01:23 -08:00
Alexander Rose
e76a08c73a remove unused en/decodeFloatLog 2021-12-30 16:59:39 -08:00
Alexander Rose
a0fef0c20f rename en/decodeFloatRGB
- since they only work for positive integers
- encodeFloatRGB -> packIntToRGB
- decodeFloatRGB -> unpackRGBToInt
2021-12-30 16:57:50 -08:00
Alexander Rose
605432ddd1 fix glsl decodeFloatRGB 2021-12-30 16:39:06 -08:00
Alexander Rose
0c895071d8 support axis order in direct-volume shader 2021-12-30 15:36:12 -08:00
Alexander Rose
79cd833ae6 cleanup 2021-12-30 14:37:34 -08:00
Alexander Rose
0fee928e37 fix gpu isosurface group id
- was wrong for axis order other than 012
- fixes #331
2021-12-30 13:49:08 -08:00
Alexander Rose
7f698336d7 fix webgl error in volume-streaming behavior
- don't use gpu mc for small volumes
- return empty texture-mesh for volumes of size 1 or 0
2021-12-29 18:51:55 -08:00
Alexander Rose
cef04f192a no picking during camera spinning 2021-12-29 16:54:26 -08:00
Alexander Rose
4087c4c226 changelog 2021-12-29 16:27:43 -08:00
Alexander Rose
87bdcd2372 add prefer-webgl1 & disable-wboit Viewer GET params 2021-12-29 16:03:45 -08:00
Alexander Rose
1dbcc0d7c8 Merge branch 'master' of https://github.com/molstar/molstar into dv-refactor 2021-12-29 15:42:41 -08:00
Alexander Rose
4c93f01c64 improve temporal multi-smaple handling
- add forceOn arg
- instead of letting temporal converge do full sampling
- saves one geometry pass
2021-12-28 20:39:03 -08:00
Alexander Rose
0a18412da0 refactor draw/multiSample .render args 2021-12-28 20:24:16 -08:00
Alexander Rose
b67d16bdc4 enable marking pass by default 2021-12-28 19:47:54 -08:00
Alexander Rose
976542d355 ensure mark changes are rendered (even w/ noDraw)
- schedule using forceNextRender to avoid rendering twice
2021-12-28 19:30:45 -08:00
Alexander Rose
a2e5fda646 improve temporal multi-sample rendering
- don't render all when spinning
- only render all when explicitely requested (new allowMulti arg)
2021-12-28 19:28:36 -08:00
Alexander Rose
41b1b65d5f improve SelectLoci behavior
- only handle direct children of updated objects (no update of same repr multiple times)
2021-12-28 19:25:40 -08:00
Alexander Rose
2ec2d1997f improve StructureSelectionManager.onUpdate
- only process for root structure (processing childs is superfluous)
2021-12-28 19:20:54 -08:00
Alexander Rose
0bc65f3b72 improve visual marking performance
- treat structure-loci as every-loci
2021-12-28 19:17:46 -08:00
Alexander Rose
9ed96b3599 fix getMarkersAverage edge case with small arrays 2021-12-28 19:16:08 -08:00
David Sehnal
b1cf9566f6 Merge pull request #324 from molstar/safari15-wboit
PluginFeatureDetection and disable WBOIT in Safari
2021-12-28 20:46:46 +01:00
ptourlas
13ea97bd98 Merge branch 'master' into feature/formal-charge-labels 2021-12-27 18:18:27 +02:00
ptourlas
009a17a9ca (forgot the author tag) 2021-12-27 17:56:25 +02:00
ptourlas
ca38d9adb1 (WIP) Formal charges handler implementation 2021-12-27 17:44:59 +02:00
ptourlas
4e5a86e3db (WIP) Add the formal charges handler to sdf parser 2021-12-27 17:37:52 +02:00
dsehnal
983ae4f8c2 PluginFeatureDetection and disable WBOIT in Safari 2021-12-24 11:21:15 +01:00
Alexander Rose
7ce3531cc7 direct-volume define cleanup 2021-12-23 15:35:14 -08:00
Alexander Rose
11f1a7fd1c add general dGeometryType
- remove dRenderMode & dGeoTexture
2021-12-23 15:16:14 -08:00
Alexander Rose
47d7dd4d22 move direct-volume coloring into theme
- add 'direct' color type
- remove color from transfer-function (now only alpha)
- add direct-volume color theme support
- add volume-value color theme
2021-12-23 14:47:17 -08:00
Alexander Rose
0d4f6bb5d9 3.0.0-dev.7 2021-12-20 22:42:23 -08:00
Alexander Rose
b3a4e1976d changelog 2021-12-20 22:36:56 -08:00
Alexander Rose
8b3c0fd94e Merge branch 'master' of https://github.com/molstar/molstar into dv-refactor 2021-12-20 17:51:38 -08:00
Alexander Rose
ab4a24d8ab Merge pull request #310 from molstar/clipping
Per Object Clip Objects
2021-12-20 17:38:41 -08:00
Alexander Rose
7c93e9f834 changelog & fix clipping exclude group filtering 2021-12-20 17:22:15 -08:00
Alexander Rose
90ea8cfebd Merge branch 'master' of https://github.com/molstar/molstar into clipping 2021-12-20 16:49:58 -08:00
Alexander Rose
7fc1866dac Merge pull request #320 from molstar/shader-compilation
Shader compilation
2021-12-20 16:46:56 -08:00
Alexander Rose
bb520ff424 fix spec 2021-12-20 16:38:24 -08:00
Alexander Rose
f9d2e20cb9 webgl1 compat 2021-12-20 16:16:22 -08:00
Alexander Rose
6f13b67bf1 combine markingDepth/markingMask shader variants 2021-12-20 16:14:37 -08:00
Alexander Rose
f37026a980 Merge branch 'master' of https://github.com/molstar/molstar into shader-compilation 2021-12-20 14:15:06 -08:00
Alexander Rose
ddc4d8e867 3.0.0-dev.6 2021-12-19 13:15:50 -08:00
Alexander Rose
7cded03598 changelog 2021-12-19 13:11:41 -08:00
Alexander Rose
744b04edc6 add demos to deploy script
- include analytics in deployed demos
2021-12-19 13:06:41 -08:00
Alexander Rose
f2119b1d0b tweak alpha-orbitals example
- remove direct-volume option
- enable tryUseGpu for isosurface repr
2021-12-19 13:05:34 -08:00
Alexander Rose
b4783909d7 fix lighting example
- adjust to new light & material handling
2021-12-19 13:04:05 -08:00
Alexander Rose
fe5f841ab8 improve docking-viewer example
- add example pdbqt & mol2
2021-12-19 13:03:10 -08:00
Alexander Rose
2c3f0dbc97 fix missing uniform in direct-volume shader 2021-12-19 13:02:23 -08:00
Alexander Rose
224fd1733f improve aromatic bonds
- Don't detect aromatic bonds for rings < 5 atoms based on planarity
- Prefer atoms in aromatic rings as bond reference positions
2021-12-19 13:02:02 -08:00
Alexander Rose
1f262ee422 Merge pull request #321 from molstar/update-create-plugin
mol-plugin-ui/createPluginUI
2021-12-19 11:51:44 -08:00
Alexander Rose
df3bcdd05a fix embedded 2021-12-19 11:41:53 -08:00
dsehnal
d5d08542ed tweak 2021-12-19 17:36:32 +01:00
dsehnal
564a360c8f Added createPluginUI, removed createPlugin and createPluginAsync 2021-12-19 17:32:58 +01:00
Alexander Rose
74f123265b correctly set shader define flags
- overpaint, transparency, substance, clipping
2021-12-18 19:53:35 -08:00
Alexander Rose
ccfae65b01 fix tests 2021-12-18 19:29:02 -08:00
Alexander Rose
bcfaef77c9 combined pick shader variant 2021-12-18 18:11:31 -08:00
Alexander Rose
0b6243c0d1 remove log statement 2021-12-18 16:53:48 -08:00
Alexander Rose
472866d8ec support ignoring defines for shader variants 2021-12-18 16:48:56 -08:00
Alexander Rose
471163f3d8 better defaults for postprocessing pass 2021-12-18 16:44:08 -08:00
Alexander Rose
ab6106896d only include vPaletteV for color shaders 2021-12-18 16:43:48 -08:00
Alexander Rose
7ca624d04b remove dMarkerType shader define 2021-12-18 16:42:43 -08:00
Alexander Rose
bd3d18f43f use uniform for double-sided shader param 2021-12-18 16:39:15 -08:00
Alexander Rose
21eb21b6dd support variants for graphics render-itms 2021-12-18 16:32:20 -08:00
Alexander Rose
fe0d4dc11e warn (not throw) about erroneous symmetry matrix
- #303
2021-12-18 15:24:52 -08:00
Alexander Rose
812eb0efa9 Merge pull request #309 from molstar/ma-support
ModelArchive / AlphaFold support
2021-12-18 14:52:55 -08:00
Alexander Rose
10d0bf293a fix wrong method name loadAfdb 2021-12-18 14:41:38 -08:00
Alexander Rose
ce2544b9f3 add model-archive viewer helpers 2021-12-18 14:40:45 -08:00
Alexander Rose
1964de1e44 Merge branch 'master' of https://github.com/molstar/molstar into ma-support 2021-12-18 14:26:00 -08:00
Alexander Rose
20c9d2cc41 enable aromaticBonds by default 2021-12-18 14:22:21 -08:00
Alexander Rose
3b1513adc0 fix eslint warnings 2021-12-18 14:12:58 -08:00
Alexander Rose
eaa60fc5cd fix linting errors and vscode settings 2021-12-18 12:47:41 -08:00
Alexander Rose
ce1e3960a2 avoid standard polymers misqualified as ligands
- overrule erroneous chem comp type in some files
2021-12-18 12:13:36 -08:00
Alexander Rose
176f80ea9b ensure trace element for polymer residues 2021-12-18 12:09:17 -08:00
Alexander Rose
28c9dc8286 refactor Model.isFromPdbArchive
- split into isFromPdbArchive and hasPdbId
- improve when secondary structure is calculated
2021-12-18 10:45:59 -08:00
Alexander Rose
2135f76441 fix temporal multi-sample flicker, enable by default 2021-12-18 10:29:42 -08:00
Alexander Rose
5637a23153 fix unnecessary cartoon geometry recreation 2021-12-18 10:14:55 -08:00
dsehnal
2818389741 update label 2021-12-17 23:33:50 +01:00
dsehnal
805f772696 3.0.0-dev.5 2021-12-16 12:21:45 +01:00
dsehnal
308bbc1ea0 lint 2021-12-16 12:19:32 +01:00
dsehnal
4a248b5591 shouldResetCamera reset fix 2021-12-16 12:17:46 +01:00
David Sehnal
704a9a111d Merge pull request #316 from JonStargaryen/master
update State Snapshots canApply when snapshots are added
2021-12-16 11:48:15 +01:00
JonStargaryen
a6befc5509 update State Snapshots canApply when snapshots are added 2021-12-16 11:31:53 +01:00
ptourlas
a736fe7989 Add formal charge option to atom site 2021-12-15 00:35:34 +02:00
ptourlas
1970b7f249 Spot the formal charge prefix 2021-12-15 00:34:06 +02:00
dsehnal
9e7aa4226d CI task 2021-12-14 21:55:23 +01:00
David Sehnal
7a25699c23 Merge pull request #312 from molstar/dependabot/npm_and_yarn/swagger-ui-dist-4.1.3
Bump swagger-ui-dist from 4.1.1 to 4.1.3
2021-12-14 14:29:01 +01:00
dependabot[bot]
901ae7f6d6 Bump swagger-ui-dist from 4.1.1 to 4.1.3
Bumps [swagger-ui-dist](https://github.com/swagger-api/swagger-ui) from 4.1.1 to 4.1.3.
- [Release notes](https://github.com/swagger-api/swagger-ui/releases)
- [Commits](https://github.com/swagger-api/swagger-ui/compare/v4.1.1...v4.1.3)

---
updated-dependencies:
- dependency-name: swagger-ui-dist
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 13:26:49 +00:00
dsehnal
c57a4cdf6e 3.0.0-dev.4 2021-12-14 14:25:51 +01:00
dsehnal
18573e17f0 package.lock 2021-12-14 14:23:37 +01:00
dsehnal
5bc7ffa8a7 react and react-dom as peerDependencies 2021-12-14 14:17:25 +01:00
David Sehnal
430cc83259 Merge pull request #311 from molstar/upload-overlay
Drag and Drop Overlay
2021-12-14 14:11:15 +01:00
dsehnal
3cd3afb775 drag and drop overlay 2021-12-14 14:10:05 +01:00
dsehnal
93215b6beb prefer webgl 1 in Safari 15.1-15.3 2021-12-14 13:19:27 +01:00
Alexander Rose
694261c19c add ModelArchive to DownloadStructure action 2021-12-13 19:57:19 -08:00
Alexander Rose
24ad38e260 add clip support to components & focus repr 2021-12-12 18:09:26 -08:00
Alexander Rose
53bac83dff remove renderable.noClip 2021-12-12 17:59:09 -08:00
Alexander Rose
ab1578f667 move clip props to base geometry 2021-12-12 17:56:14 -08:00
Alexander Rose
4e70301b62 cleanup after merge 2021-12-12 17:27:47 -08:00
Alexander Rose
76ed2e9e11 Merge branch 'master' of https://github.com/molstar/molstar into clipping 2021-12-12 17:11:59 -08:00
Alexander Rose
58ce1f6498 Viewer.loadAfdb -> Viewer.loadAlphaFoldDb 2021-12-12 14:56:04 -08:00
Alexander Rose
47c4353eb9 use web api to get alphafold model for uniprot ac 2021-12-12 14:55:09 -08:00
Alexander Rose
d82cd3a8fe fix: do plugin ui render after context init 2021-12-12 14:45:57 -08:00
Alexander Rose
8f06b603e6 add bond location support to qmean & pLDDT color themes 2021-12-11 21:35:56 -08:00
Alexander Rose
0865c1b7fb changelog 2021-12-11 18:04:40 -08:00
Alexander Rose
c8c32b89c1 improve loading of ModelArchive schema structures
- includes AlphaFold mmcif structures
- add Viewer.loadAfdb
- add afdb GET param to Viewer html
- add Viewer default presets showing quality assessment (qmean & pLDDT)
- add alphafolddb option to download structure action
2021-12-11 17:56:26 -08:00
Alexander Rose
658c789906 tweak: use PD.arrayToOptions 2021-12-11 17:47:29 -08:00
Alexander Rose
c9ad7fce5b add PluginConfig.Structure.DefaultRepresentationPreset 2021-12-11 17:46:21 -08:00
Alexander Rose
720a8a440f tweak param comparision
- avoid unneccesary update
2021-12-11 17:42:41 -08:00
Alexander Rose
84fe2d2502 add ModelArchive extension
- QualityAssessment prop (from ma_qa_metric_local mmcif category)
- pLDDT & qmean coloring
- pLDDT & qmean repr presets
- pLDDT & qmean molql symbol
- pLDDT & qmean loci labels (including avg for mutli residue selections)
- pLDDT selection query
2021-12-11 17:40:04 -08:00
Alexander Rose
6f159c592f cleanup mmcif schema generation
- remove BRANCH and CARB extension (nwo included in mmCIF)
2021-12-11 16:57:09 -08:00
Alexander Rose
beff1ecb3e add model-archive cif schema 2021-12-11 16:40:29 -08:00
Alexander Rose
e4f630dbef improve drag and drop support
- any file type
- multiple files
- if session, only first is loaded
2021-12-11 16:37:20 -08:00
Alexander Rose
ccaf18af04 add analytics to viewer on deployment
- only for molstar.org (done in ./scripts/deploy.js)
2021-12-11 12:25:05 -08:00
Alexander Rose
2b72098f95 fix: false positives in Model.isFromPdbArchive
- wrong for, e.g., AlphaFold DB entries
2021-12-11 11:42:15 -08:00
Alexander Rose
b32546bea7 add outline color option to renderer 2021-12-11 11:30:00 -08:00
Alexander Rose
b9b0413e9f improve label repr defaults 2021-12-11 11:25:35 -08:00
David Sehnal
1d29b4627f Merge pull request #305 from MadCatX/cleanup-old-nodejs
Make cleanup script work with older vesions of Node.js
2021-12-10 12:43:08 +01:00
Michal Malý
bd44c76709 Make cleanup script work with older versions of Node.js 2021-12-10 09:36:58 +01:00
Alexander Rose
06b4761f2b add `carbonLightness` to illustrative color theme 2021-12-06 20:02:25 -08:00
Alexander Rose
daa3d1dbaa handle zero light count 2021-12-06 20:01:46 -08:00
Alexander Rose
5490d5ceb5 fixes for material bumpiness 2021-12-06 20:01:18 -08:00
dsehnal
cf3c1cfcce update Group Presets UI 2021-12-06 10:44:20 +01:00
Alexander Rose
be2607ae84 add bumpAmplitude render parameter 2021-12-05 21:29:07 -08:00
Alexander Rose
aa1f081664 remove direct-volume isosurface render-mode 2021-12-05 14:24:18 -08:00
Alexander Rose
e2966241e8 Merge pull request #299 from molstar/bump
procedural bump mapping
2021-12-05 12:42:27 -08:00
Alexander Rose
447792b1ef changelog 2021-12-05 12:30:28 -08:00
Alexander Rose
1cbcb5c530 remove duplicated line 2021-12-05 12:10:26 -08:00
Alexander Rose
f8d32d1d8d fix temp texture usage for color smoothing 2021-12-05 12:07:32 -08:00
Alexander Rose
8c556c2849 Merge branch 'master' of https://github.com/molstar/molstar into bump 2021-12-05 12:02:21 -08:00
Alexander Rose
4d0f0ceebf 3.0.0-dev.3 2021-12-04 22:23:51 -08:00
Alexander Rose
14abcddfcf changelog 2021-12-04 22:17:24 -08:00
Alexander Rose
704cc96a9f Merge pull request #300 from sukolsak/fix-export
Fix USDZ and OBJ export
2021-12-04 22:13:41 -08:00
Sukolsak Sakshuwong
b51f610173 fix USDZ and OBJ export 2021-12-04 20:08:15 -08:00
Alexander Rose
98050875c7 add bumpiness to material 2021-12-04 16:54:23 -08:00
dsehnal
470280ea1a changelog and update eslint 2021-12-01 13:29:02 +01:00
dsehnal
dafb5a8299 3.0.0-dev.2 2021-12-01 13:26:08 +01:00
dsehnal
4a1af03744 package.json fix 2021-12-01 13:23:50 +01:00
dsehnal
bb176f1efb 3.0.0-dev.1 2021-12-01 13:17:15 +01:00
dsehnal
a53bcde973 npmignore tweaks 2021-12-01 13:14:28 +01:00
David Sehnal
1a8dc2c637 Merge pull request #295 from molstar/material-object
Refactor Material Representation
2021-11-29 18:04:52 +01:00
dsehnal
f96211ff91 comment 2021-11-29 18:04:23 +01:00
dsehnal
77f9c02785 udpate presets 2021-11-29 18:01:41 +01:00
dsehnal
7910b65fdc Merge branch 'master' of https://github.com/molstar/molstar 2021-11-29 14:49:53 +01:00
dsehnal
eb4fc4588d remove console.log 2021-11-29 14:49:51 +01:00
David Sehnal
5430674071 Merge pull request #294 from MadCatX/fixtypo
Fix typo in README
2021-11-29 14:10:20 +01:00
dsehnal
17e67e3b79 Refactor Material representation 2021-11-29 14:09:56 +01:00
dsehnal
e87a0d72e4 Fix docking viewer material usage 2021-11-29 12:48:26 +01:00
dsehnal
67d3c65907 ParamDefinition.Group.presets support 2021-11-29 12:35:57 +01:00
dsehnal
564a5486c9 StructureComponentManager.Options state saving support 2021-11-29 11:57:37 +01:00
Michal Malý
9ce11c4c32 Fix typo in README 2021-11-29 11:41:57 +01:00
dsehnal
5e97b551a5 changelog 2021-11-29 11:10:30 +01:00
David Sehnal
77536e75af Merge pull request #292 from MadCatX/provide-rebuild-cmd
Add packaging command to force a full rebuild
2021-11-29 11:05:44 +01:00
Alexander Rose
6f12f714d2 3.0.0-dev.0 2021-11-28 14:02:46 -08:00
Alexander Rose
1f67077400 changelog 2021-11-28 13:56:07 -08:00
Alexander Rose
d1c4cf69cb Merge pull request #291 from molstar/lighting
Lighting
2021-11-28 13:53:42 -08:00
Alexander Rose
803c5eaa15 changelog 2021-11-28 13:39:53 -08:00
Alexander Rose
970fd5d9c3 Merge branch 'master' of https://github.com/molstar/molstar into lighting 2021-11-28 13:32:56 -08:00
Alexander Rose
7ccd4a1e0d 2.4.1 2021-11-28 13:31:12 -08:00
Michal Malý
3a6ab55266 Add a cleanup packaging script 2021-11-28 22:29:50 +01:00
Alexander Rose
eb41882c56 Merge branch 'master' of https://github.com/molstar/molstar 2021-11-28 13:25:42 -08:00
Alexander Rose
734851a810 changelog 2021-11-28 12:46:12 -08:00
Alexander Rose
6318717a15 tweak material param 2021-11-28 12:42:33 -08:00
dsehnal
d8498feaef updade npmignore 2021-11-28 14:36:54 +01:00
Michal Malý
aaec452bc2 Add packaging command to force a full rebuild 2021-11-28 13:28:06 +01:00
Alexander Rose
bce959195a fix renderer spec baseline 2021-11-27 17:31:42 -08:00
Alexander Rose
4287e09a9a fix material param number formating 2021-11-27 17:25:51 -08:00
Alexander Rose
fdc006f833 Merge branch 'master' of https://github.com/molstar/molstar into lighting 2021-11-27 17:08:56 -08:00
Alexander Rose
c704b7505c add Substance theming (per-group material) 2021-11-27 17:06:55 -08:00
Alexander Rose
ceaf238322 material improvements
- material helpers
- material in structure component manager
2021-11-27 17:02:48 -08:00
Alexander Rose
b7224ce5c7 lighting tweaks 2021-11-26 18:04:33 -08:00
Alexander Rose
95654175fe improve 'rounded' tube geometry
- correct normals
- circle offset
2021-11-26 15:34:16 -08:00
Alexander Rose
de96244706 allow atoms in aromatic rings to do hydrogen bonds 2021-11-26 14:37:50 -08:00
Alexander Rose
3104ee5742 Merge branch 'master' of https://github.com/molstar/molstar into lighting 2021-11-25 15:00:19 -08:00
Alexander Rose
73ac445a44 2.4.0 2021-11-25 14:46:10 -08:00
Alexander Rose
1a1d1d9d30 changelog 2021-11-25 14:41:19 -08:00
Alexander Rose
062aff76da update schemas 2021-11-25 14:40:35 -08:00
Alexander Rose
7d0d24b66d update packages 2021-11-25 14:40:26 -08:00
Alexander Rose
6655672d11 Merge pull request #290 from molstar/smoothing2
Smooth Overpaint and Transparency
2021-11-25 14:13:10 -08:00
Alexander Rose
6e573ae410 reduce args counts in geo exporters 2021-11-25 14:04:58 -08:00
Alexander Rose
1c48c02473 basic overpaint for direct-volume isosurface 2021-11-24 19:49:42 -08:00
Alexander Rose
78be3320ce geo export support smoothed overpaint/transparency 2021-11-24 19:49:05 -08:00
Alexander Rose
c8018800cc grid-based smoothing of Overpaint and Transparency 2021-11-24 19:47:07 -08:00
Alexander Rose
bb795aca98 refactor grid-based color smoothing
- support rgba and alpha values
- CPU and GPU versions
- for Mesh and TextureMesh
2021-11-24 19:43:15 -08:00
Alexander Rose
2cb1279f4c gl compute utils improvements
- CopyRenderable
- readTexture and readAlphaTexture helpers
2021-11-24 19:10:15 -08:00
Alexander Rose
b876c6f618 avoid unnecessary representation state updates 2021-11-24 18:51:16 -08:00
Alexander Rose
3a7dfc055e add Representation.geometryVersion
- increments whenever the geometry of any visual changes
2021-11-24 18:49:10 -08:00
Alexander Rose
928e521ac7 improve handling of .meta in Mesh & TextureMesh 2021-11-24 18:36:04 -08:00
Alexander Rose
e5e9598e4b changelog 2021-11-24 18:31:08 -08:00
Alexander Rose
e6e1809592 Fix secondary-structure property handling
- StructureElement.Property was incorrectly resolving type & key
- StructureSelectionQuery helpers 'helix' & 'beta' were not ensuring property availability
2021-11-24 18:30:53 -08:00
Alexander Rose
812f97ddb7 skip picking/depth pass for volume rendering
- not supported in shader anyway
- was printing 'no output' warning in Chrome console
2021-11-24 18:20:42 -08:00
Alexander Rose
c6b814b31b re-enable VAO with better workaround 2021-11-24 18:17:48 -08:00
Alexander Rose
98566fa389 improve error handling
- console.error if not re-thrown
- better messages for users
2021-11-24 18:15:47 -08:00
David Sehnal
4318c89bdb Merge pull request #288 from jpattle/allow-v3-sdf
Added the ability to handle v3000 sd files
2021-11-23 15:49:42 +01:00
Jason Pattle
b41a97ce6a Added a separate function to handle v2 counts and refactored the existing code that distinguishes v2 and v3 atom and bond counts 2021-11-23 10:30:09 +00:00
Jason Pattle
862c384dc0 Added the ability to handle v3000 sd files. Added a set of utility functions for parsing atoms and bonds from v3000 sd files. Updated the existing sdf parser to determine the version and run the v3000 sd file parser functions instead of the default v2000 ones. Added tests to verify parsing functionality for example v3000 ctab 2021-11-22 16:00:35 +00:00
Alexander Rose
26cc7e94c2 2.3.9 2021-11-20 16:58:28 -08:00
Alexander Rose
c6fe6ddcba switch off VAO support for now 2021-11-20 16:54:38 -08:00
Alexander Rose
154984e74d 2.3.8 2021-11-20 16:30:22 -08:00
Alexander Rose
72fcaf8321 changelog 2021-11-20 16:24:54 -08:00
Alexander Rose
0c14ca5888 workaround for VAO issue in Chrome 96 2021-11-20 16:14:30 -08:00
Alexander Rose
a85ede5058 fix unused vertex attribute handling 2021-11-20 16:13:18 -08:00
Alexander Rose
db49a16184 fix double canvas context creation 2021-11-20 12:52:47 -08:00
dsehnal
0704db2343 replace webpack-version-file-plugin 2021-11-20 13:45:28 +01:00
dsehnal
425dca4665 fix sass division 2021-11-20 12:55:46 +01:00
dsehnal
8d65ccabd2 update packages
- use sass instead of node sass
2021-11-20 12:49:26 +01:00
ludovic autin
9a1d746170 Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-11-17 10:06:49 -08:00
Alexander Rose
cbd417ca13 2.3.7 2021-11-15 19:31:07 -08:00
Alexander Rose
1e4d1e45f9 Merge branch 'master' of https://github.com/molstar/molstar into lighting 2021-11-13 13:36:03 -08:00
Alexander Rose
1578211157 add helix profile option to cartoon repr 2021-11-13 13:16:11 -08:00
Alexander Rose
15932dc5df handle parent in Structure.remapModel 2021-11-13 09:23:57 -08:00
ludovic autin
ef87ce3507 Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-11-10 14:35:24 -08:00
dsehnal
7db2205956 changelog 2021-11-09 21:18:55 +01:00
dsehnal
d87f0d236a ViewerOptions.collapseRightPanel 2021-11-09 21:17:01 +01:00
dsehnal
16daca6008 undo test code 2021-11-09 21:13:28 +01:00
dsehnal
a0d919c8db Viewer.loadTrajectory 2021-11-09 21:12:24 +01:00
David Sehnal
ffee2bf1c4 Merge pull request #285 from MadCatX/tweak-measurement-order-labels
Tweak measurement order labels
2021-11-09 10:28:13 +01:00
Michal Malý
de77f6ac59 Fix a visual glitch where the label border was initially rendered with
half of the intended size.
2021-11-09 09:59:25 +01:00
Michal Malý
c8c2ebcd65 Reduce Z-offset of measurement order labels to avoid too early clipping 2021-11-09 09:59:25 +01:00
Michal Malý
42796b984f Reduce border width of measurement order labels 2021-11-09 09:58:58 +01:00
David Sehnal
746557bf52 Merge pull request #284 from russellp17/master
Move jest types to devDependencies
2021-11-08 22:48:15 +01:00
Russell Parker
a5020a9e96 Move jest types to devDependencies 2021-11-08 15:58:14 -05:00
dsehnal
2ebb0a35fd 2.3.6 2021-11-08 18:57:06 +01:00
dsehnal
64aaa92d45 changelog 2021-11-08 18:54:52 +01:00
dsehnal
4baf391efe prefer webgl1 in safari 15.1
- WebGL2 is broken there for Mol* shaders
- It works again in Safari 15.4 tech preview
2021-11-08 18:50:16 +01:00
David Sehnal
5afdcff6a5 Merge pull request #273 from molstar/shader-tests
add basic unit tests for graphics shaders
2021-11-08 18:40:51 +01:00
dsehnal
339c397860 package lock 2021-11-08 18:30:52 +01:00
dsehnal
a58cbd31ef Merge branch 'master' of https://github.com/molstar/molstar into shader-tests 2021-11-08 18:30:30 +01:00
David Sehnal
d232b01cf9 Merge pull request #283 from MadCatX/improve-measurements-ux
Improve measurements user experience
2021-11-08 17:12:37 +01:00
Michal Malý
ec95270854 Use the entire element to trigger highlighting of loci from additionsHistory 2021-11-08 15:46:07 +01:00
Michal Malý
78cc0d960f Show the order of locis to be used for measurements in 3D view 2021-11-08 15:46:02 +01:00
Alexander Rose
b5ccdfdd53 multiple lights, per object materials
- multiple directional lights
- per-object materials (roughness & metalness)
- fixed reflectivity to 0.5
- update PhysicalMaterial from three.js to r134
2021-11-06 21:14:14 -07:00
Alexander Rose
d0c0d8e703 require standardDerivatives glsl extension 2021-11-06 20:57:22 -07:00
Alexander Rose
ebf64404be add loop unrolling glsl support 2021-11-06 15:02:14 -07:00
Alexander Rose
7f39cf0f37 add missing updateFocusRepr to atomicDetail preset
- fixes #280
2021-11-02 22:10:35 -07:00
ludovic autin
2b9053eac4 Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-11-01 10:21:08 -07:00
Alexander Rose
e5dcc8e54f wip, lighting improvements
- set light direction
- set light color
- set ambient color
2021-10-31 14:59:19 -07:00
Alexander Rose
4592510a95 linting fix 2021-10-30 21:50:15 -07:00
Alexander Rose
46d5442dc5 Merge pull request #252 from corredD/forkdev
binary model loading support and latest mycoplasma model.
2021-10-30 17:11:27 -07:00
Alexander Rose
271cff4aba changelog 2021-10-30 17:09:35 -07:00
Alexander Rose
94fd5a97d6 Merge branch 'master' of https://github.com/molstar/molstar into pr/corredD/252 2021-10-30 16:53:35 -07:00
Alexander Rose
28678e2f80 Merge pull request #270 from molstar/measurements
Additional measurement controls
2021-10-30 16:52:32 -07:00
Alexander Rose
406307a432 add radiusScale param to orientation measurement 2021-10-30 16:48:47 -07:00
Alexander Rose
56345b5096 Merge branch 'master' of https://github.com/molstar/molstar into measurements 2021-10-30 16:31:12 -07:00
Alexander Rose
3fcc42ee0e fix, proper EmptyRepresentationProvider 2021-10-30 16:26:37 -07:00
Alexander Rose
b903677f8a gh action, add npm run build 2021-10-30 16:12:42 -07:00
Alexander Rose
ef4b632a07 update package-lock 2021-10-30 16:05:24 -07:00
Alexander Rose
e9d485ca85 gh action, use npm ci 2021-10-30 16:01:09 -07:00
Alexander Rose
a149fa5929 gh action 2021-10-30 15:53:58 -07:00
Alexander Rose
bb3dde585b gh action 2021-10-30 15:46:23 -07:00
Alexander Rose
cd6bbeaa86 gh action 2021-10-30 15:44:06 -07:00
Alexander Rose
e3d24dae4b gh action 2021-10-30 15:43:05 -07:00
Alexander Rose
687a814a62 gh action
- update eslint
- add jest
2021-10-30 15:02:25 -07:00
Alexander Rose
8f2e99dc51 improve shader tests
- made gl package optional
- skip test if gl package not available
2021-10-30 14:52:11 -07:00
Alexander Rose
568be030c3 Merge branch 'master' of https://github.com/molstar/molstar into shader-tests 2021-10-30 14:45:19 -07:00
Alexander Rose
97c3ab8b5a changelog 2021-10-30 14:44:27 -07:00
Alexander Rose
5db646d139 fix marker highlight color overriding select color 2021-10-30 14:43:57 -07:00
Alexander Rose
340f8f1af3 add additional aromatic bond visual params 2021-10-30 14:42:17 -07:00
dsehnal
4484a4452c 2.3.5 2021-10-19 18:22:50 +02:00
dsehnal
65b654a0a2 fix index pair bonds order assignment 2021-10-19 18:20:54 +02:00
dsehnal
a8e0c13b0e fix sequence viewer for PDB files with COMPND record and multichain entities 2021-10-17 13:21:57 +02:00
Alexander Rose
b371f8c11c Merge branch 'master' of https://github.com/molstar/molstar into shader-tests 2021-10-03 15:24:02 -07:00
Alexander Rose
895a13fc0d Merge branch 'master' into shader-tests 2021-10-03 14:36:23 -07:00
Alexander Rose
2f9ac711d1 add basic unit tests for graphics shaders
- compile using `gl` package
2021-10-03 10:52:58 -07:00
ludovic autin
116ef719be Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-09-20 09:17:09 -07:00
Alexander Rose
b06c134b61 add additional measurement controls
- orientation (box, axes, ellipsoid)
- plane (best fit)
2021-09-18 22:39:40 -07:00
Alexander Rose
3436d03468 add helpers to work with many locis
- StructureElement.Loci.getPrincipalAxesMany
- structureElementLociLabelMany
2021-09-18 22:13:22 -07:00
Alexander Rose
58df6f3b85 formating 2021-09-18 22:12:08 -07:00
Alexander Rose
ffaf008dce limit max display counts in sequence panel
- MaxSelectOptionsCount
- MaxSequenceWrappersCount
- workaround for cellpack models
2021-09-18 16:30:14 -07:00
ludovic autin
eb196a41b5 change variables names to avoid confusion with other types. Added the xrayshading for the compartment geometry 2021-09-14 11:25:15 -07:00
ludovic autin
35baaaf594 support for compartment PLY file. 2021-09-13 11:46:27 -07:00
Alexander Rose
0fc305aaea fix linting issues 2021-09-12 23:32:55 -07:00
Alexander Rose
bf67546a61 Merge branch 'master' of https://github.com/molstar/molstar into pr/corredD/252 2021-09-12 23:30:26 -07:00
Alexander Rose
80d54afdd0 Merge branch 'master' into forkdev 2021-09-12 20:16:00 -07:00
Alexander Rose
2a74dfcf46 factor out membrane sphere handling 2021-09-12 10:26:10 -07:00
Alexander Rose
b0f447adde fix cellpack results file asset handling 2021-09-12 10:17:37 -07:00
ludovic autin
b8628ccff1 Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-09-01 09:55:13 -07:00
ludovic autin
4c30057edf I am trying to get the binary asset to get cached. But still can't save a working session. 2021-08-27 16:14:43 -07:00
ludovic autin
53a4826274 Merge branch 'master' of https://github.com/molstar/molstar into forkdev 2021-08-27 14:55:22 -07:00
ludovic autin
393fc99ed2 moved the model loading in model.ts and get the info from the recipe dictionary ( result file and lipids file ) if available. Fix the dates and some const / let variable defintion 2021-08-16 12:35:51 -07:00
ludovic autin
7c5dff1c8b Merge remote-tracking branch 'upstream/master' into forkdev 2021-08-16 11:55:09 -07:00
ludovic autin
ce3f13431d endianess test with IsNativeEndianLittle 2021-08-13 10:58:25 -07:00
ludovic autin
df54766ab2 lower-case icosahedron 2021-08-12 10:48:27 -07:00
ludovic autin
94233fbcd9 eslint error fix 2021-08-11 11:07:34 -07:00
ludovic autin
d044496eaa fix eslint errors 2021-08-11 11:04:08 -07:00
ludovic autin
ca825d720e binary model loading support, latest mycoplasma model. 2021-08-11 10:44:44 -07:00
Alexander Rose
504406eb22 move clip variant and objects to repr state 2021-08-01 21:16:44 -07:00
990 changed files with 195228 additions and 36978 deletions

View File

@@ -18,7 +18,7 @@
],
"brace-style": "off",
"comma-spacing": "off",
"space-infix-ops": "error",
"space-infix-ops": "off",
"comma-dangle": "off",
"eqeqeq": [
"error",
@@ -55,7 +55,8 @@
"block-spacing": "error",
"keyword-spacing": "off",
"space-before-blocks": "error",
"semi-spacing": "error"
"semi-spacing": "error",
"no-constant-binary-expression": "error"
},
"overrides": [
{
@@ -107,6 +108,7 @@
"1tbs", { "allowSingleLine": true }
],
"@typescript-eslint/comma-spacing": "error",
"@typescript-eslint/space-infix-ops": "error",
"@typescript-eslint/space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",

11
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,11 @@
<!-- Thank you for contributing to Mol* -->
# Description
## Actions
- [ ] Added description of changes to the `[Unreleased]` section of `CHANGELOG.md`
- [ ] Updated headers of modified files
- [ ] Added my name to `package.json`'s `contributors`
- [ ] (Optional but encouraged) Improved documentation in `docs`

62
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: Build & Deploy Docs
on:
push:
branches: master
paths:
- docs/**
- ".github/workflows/docs.yml"
pull_request:
branches: master
paths:
- docs/**
- ".github/workflows/docs.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 👨🏼‍💻 checkout
uses: actions/checkout@v4
- name: 🐍 python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: ⛓️ dependencies
run: |
pip install mkdocs-material
- name: 🔧 build site
run: |
cd docs
mkdocs build
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: 👨🏼‍💻 checkout
uses: actions/checkout@v4
- name: 🐍 python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: ⛓️ dependencies
run: |
pip install mkdocs-material
- name: 🔧 build site
run: |
cd docs
mkdocs build
- name: 🚢 deploy docs
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
external_repository: molstar/docs
publish_branch: gh-pages
publish_dir: ./docs/site

View File

@@ -1,18 +0,0 @@
on:
push:
pull_request:
jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v14
uses: actions/setup-node@v1
with:
node-version: 14
- name: yarn install
run: yarn install
- name: eslint
uses: icrawl/action-eslint@v1

24
.github/workflows/node.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Build
on:
push:
branches: master
pull_request:
branches: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
- run: npm ci
- run: sudo apt-get install xvfb
- name: Lint
run: npm run lint
- name: Test
run: npm install --no-save "gl@^6.0.2" && xvfb-run --auto-servernum npm run jest
- name: Build
run: npm run build

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
build/
lib/
docs/site/
node_modules/
debug.log

View File

@@ -1 +1,5 @@
tsconfig.commonjs.tsbuildinfo
tests
perf-tests
_spec
*.tsbuildinfo
*.js.map

View File

@@ -1,18 +0,0 @@
language: node_js
os: linux
sudo: required
dist: trusty
before_install:
- sudo apt-get install -y mesa-utils
- sudo apt-get install -y xvfb
- sudo apt-get install -y libgl1-mesa-dri
- sudo apt-get install -y libglapi-mesa
- sudo apt-get install -y libosmesa6
- sudo apt-get install -y gcc-4.9
- sudo apt-get install -y libstdc++6
- sudo apt-get install -y libxi-dev
node_js:
- "12"
- "10"
before_script:
- export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start

View File

@@ -6,7 +6,6 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"firsttris.vscode-jest-runner",
"msjsdiag.debugger-for-chrome",
"slevesque.shader",
"stpn.vscode-graphql",
"wayou.vscode-todo-highlight"

View File

@@ -7,6 +7,8 @@
"*.gql.ts": "graphql"
},
"eslint.options": {
"ignorePattern": ["webpack.config.js", "scripts/*"],
"overrideConfig": {
"ignorePatterns": ["webpack.config.js", "scripts/*"],
},
}
}

View File

@@ -3,9 +3,920 @@ All notable changes to this project will be documented in this file, following t
Note that since we don't clearly distinguish between a public and private interfaces there will be changes in non-major versions that are potentially breaking. If we make breaking changes to less used interfaces we will highlight it in here.
## [Unreleased]
## [v4.2.0] - 2023-04-05
- Add emissive material support
- Add bloom post-processing
- MolViewSpec extension: `loadMVS` supports `keepCamera` parameter
- Return StateTransform selectors from measurements API (addDistance, addAngle, etc.)
- Refactor transparency rendering
- More uniform behavior for blended, wboit, dpoit
- Fix issues with text & image geometry
- Fix render-spheres example (#1100)
- Wrong step size in sphere geometry boundingSphere & groupmapping
- Handle empty `instanceGrid` in renderer & renderable
- Fix bond assignment from `IndexPairBonds`
- Can not always be cached in `ElementSetIntraBondCache`
- Wrong operator checks in `findPairBonds`
- Fix SSAO artifacts (@corredD, #1082)
- Fix bumpiness artifacts (#1107, #1084)
## [v4.1.0] - 2023-03-31
- Add `VolumeTransform` to translate/rotate a volume like in a structure superposition
- Fix BinaryCIF encoder edge cases caused by re-encoding an existing BinaryCIF file
- Fix edge-case where width/height in InputObserver are not correct
- Fix transparency rendering fallback (#1058)
- Fix SSAO broken when `OES_texture_float_linear` is unavailable
- Add `normalOffset` to `external-volume` color theme
- This can give results similar to pymol's surface_ramp_above_mode=1
- Add `rotation` parameter to skybox background
## [v4.0.1] - 2023-02-19
- Fix BinaryCIF decoder edge cases. Fixes mmCIF model export from data provided by ModelServer.
- MolViewSpec extension: support for MVSX file format
- Revert "require WEBGL_depth_texture extension" & "remove renderbuffer use"
## [v4.0.0] - 2023-02-04
- Add Mesoscale Explorer app for investigating large systems
- [Breaking] Remove `cellpack` extension (superseded by Mesoscale Explorer app)
- [Breaking] Set minimal node.js version to 18
- [Breaking] Generalize rcsb/assembly-symmetry/ extension
- Move to assembly-symmetry/
- Remove RCSB specific dependencies and prefixes
- [Breaking] Require `WEBGL_depth_texture` webgl extension
- Remove `renderbuffer` use
- [Breaking] Change build target to ES2018
- Custom builds only require ES6 for dependencies like immer.js
- [Breaking] Changed `createPluginUI`
- The function now takes a single `options` argument
- The caller must specify a `render` method that mounts the Mol* react component to DOM
- A default `renderReact18` method is provided, but needs to be imported separately
- To support React 16 and 17, `ReactDOM.render` can be passed
- Improve `SetUtils` performance using ES6 features
- [Breaking] Reduce memory usage of `SymmetryOperator.ArrayMapping`
- Requires calling methods from instance
- [Breaking] Fix `mol-model/structure/model/properties/seconday-structure.ts` file name (#938)
- [Breaking] Add `Canvas3DContext` runtime props
- Props: pixelScale, pickScale, transparency (blended, wboit, dpoit)
- Replaces instantiation-time attribs
- [Breaking] Change default compile target to ES2018
- [Breaking] Add culling & LOD support
- Cull per-object and per-instance
- Cull based on frustum and camera distance
- LOD visibility based on camera distance
- Special LOD mode for spheres with automatic levels
- Occlusion culling (only WebGL2)
- Hi-Z pass
- Cull based on previous frame's Hi-Z buffer
- Add stochastic/dithered transparency to fade overlapping LODs in and out
- Add "Automatic Detail" preset that shows surface/cartoon/ball & stick based on camera distance
## [v3.45.0] - 2023-02-03
- Add color interpolation to impostor cylinders
- MolViewSpec components are applicable only when the model has been loaded from MolViewSpec
- Add `snapshotKey` and `tooltip` params to loci `LabelRepresentation`
- Update `FocusLoci` behavior to support `snapshotKey` param
- Clicking a visual with `snapshotKey` will trigger that snapshot
- Render multiline loci label tooltips as Markdown
- `ParamDefinition.Text` updates:
- Support `multiline` inputs
- Support `placeholder` parameter
- Support `disableInteractiveUpdates` to only trigger updates once the control loses focus
- Move dependencies related to the headless context from optional deps to optional peer deps
## [v3.44.0] - 2023-01-06
- Add new `cartoon` visuals to support atomic nucleotide base with sugar
- Add `thicknessFactor` to `cartoon` representation for scaling nucleotide block/ring/atomic-fill visuals
- Use bonds from `_struct_conn` in mmCIF files that use `label_seq_id`
- Fix measurement label `offsetZ` default: not needed when `scaleByRadius` is enbaled
- Support for label rendering in HeadlessPluginContext
- MolViewSpec extension
- Support all X11 colors
- Support relative URIs
- CLI tools: mvs-validate, mvs-render, mvs-print-schema
- Labels applied in one node
- ModelServer SDF/MOL2 ligand export: fix atom indices when additional atoms are present
- Avoid showing (and calculating) inter-unit bonds for huge structures
- Fixed `DragOverlay` on WebKit/Safari browsers
## [v3.43.1] - 2023-12-04
- Fix `react-markdown` dependency
## [v3.43.0] - 2023-12-02
- Fix `State.tryGetCellData` (return type & data check)
- Don't change camera.target unless flyMode or pointerLock are enabled
- Handle empty CIF files
- Snapshot improvements:
- Add `key` property
- Ability to existing snapshot name, key, and description
- Support markdown in descriptions (ignores all HTML tags)
- Ability to link to snapshots by key from descriptions
- Separate UI control showing description of the current snapshot
- Do not activate drag overlay for non-file content
- Add `structure-element-sphere` visual to `spacefill` representation
- Fix missing `await` in `HeadlessPluginContext.saveStateSnapshot`
- Added support for providing custom sequence viewers to the plugin spec
- MolViewSpec extension (MVS)
- Add URL parameters `mvs-url`, `mvs-data`, `mvs-format`
- Add drag&drop for `.mvsj` files
- Fix `bumpiness` scaling with `ignoreLight` enabled
- Add `transforms` & `label` params to `ShapeFromPly`
- Optimize `LociSelectManager.selectOnly` to avoid superfluous loci set operations
- Dispose of viewer on `unload` event to aid GC
## [v3.42.0] - 2023-11-05
- Fix handling of PDB files with insertion codes (#945)
- Fix de-/saturate of colors with no hue
- Improve `distinctColors` function
- Add `sort` and `sampleCountFactor` parameters
- Fix clustering issues
- Add `clipPrimitive` option to spheres geometry, clipping whole spheres instead of cutting them
- Add `DragAndDropManager`
- Add `options` support for default bond labels
## [v3.41.0] - 2023-10-15
- Add `PluginContext.initialized` promise & support for it in the `Plugin` UI component.
- Fix undesired interaction between settings panel and the panel on the right.
- Add ability to customize server parameters for `RCSBAssemblySymmetry`.
## [v3.40.1] - 2023-09-30
- Do not call `updateFocusRepr` if default `StructureFocusRepresentation` isn't present.
- Treat "tap" as a click in `InputObserver`
- ModelServer ligand queries: fix atom count reported by SDF/MOL/MOL2 export
- CCD extension: Make visuals for aromatic bonds configurable
- Add optional `file?: CifFile` to `MmcifFormat.data`
- Add support for webgl extensions
- `WEBGL_clip_cull_distance`
- `EXT_conservative_depth`
- `WEBGL_stencil_texturing`
- `EXT_clip_control`
- Add `MultiSampleParams.reduceFlicker` (to be able to switch it off)
- Add `alphaThickness` parameter to adjust alpha of spheres for radius
- Ability to hide "right" panel from simplified viewport controls
- Add `blockIndex` parameter to TrajectoryFromMmCif
- Fix bounding sphere calculation for "element-like" visuals
- Fix RCSB PDB validation report URL
- Add sharpening postprocessing option
- Take pixel-ratio into account for outline scale
- Gracefully handle missing HTMLImageElement
- Fix pixel-ratio changes not applied to all render passes
## [v3.39.0] - 2023-09-02
- Add some elements support for `guessElementSymbolString` function
- Faster bounding rectangle calculation for imposter spheres
- Allow toggling of hydrogens as part of `LabelTextVisual`
## [v3.38.3] - 2023-07-29
- Fix imposter spheres not updating, e.g. in trajectories (broke in v3.38.0)
## [v3.38.2] - 2023-07-24
- Don't rely solely on `chem_comp_atom` when detecting CCD files (#877)
- Actually support non-physical keys in `Bindings.Trigger.code`
## [v3.38.1] - 2023-07-22
- Fix pixel-scale not updated in SSAO pass
## [v3.38.0] - 2023-07-18
- Fix display issue with SIFTS mapping
- Support non-physical keys in `Bindings.Trigger.code`
- Update `getStateSnapshot` to only overwrite current snapshot if it was created automatically
- Fix distinct palette's `getSamples` infinite loop
- Add 'NH2', 'FOR', 'FMT' to `CommonProteinCaps`
- Add `opened` event to `PluginStateSnapshotManager`
- Properly switch-off fog
- Add `approximate` option for spheres rendering
- Reduce `Spheres` memory usage
- Derive mapping from VertexID
- Pull position and group from texture
- Add `Euler` math primitive
- Add stride option to element sphere & point visuals
- Add `disabledExtensions` field to default viewer's options
- Add `LRUCache.remove`
- Add 'Chain Instance' and 'Uniform' options for 'Carbon Color' param (in Color Theme: Element Symbol)
## [v3.37.1] - 2023-06-20
- Fix issues with wboit/dpoit in large scenes
- Fix lines, text, points rendering (broken in v3.37.0)
## [v3.37.0] - 2023-06-17
- Add `inverted` option to `xrayShaded` parameter
- Model-export extension: Add ability to set a file name for structures
- Add `contextHash` to `SizeTheme`
- Add mipmap-based blur for image backgrounds
## [v3.36.1] - 2023-06-11
- Allow parsing of CCD ligand files
- Add dedicated wwPDB CCD extension to align and visualize ideal & model CCD coordinates
- Make operators in `IndexPairBonds` a directed property
- Remove erroneous bounding-box overlap test in `Structure.eachUnitPair`
- Fix `EdgeBuilder.addNextEdge` for loop edges
- Optimize inter unit bond compute
- Ensure consistent state for volume representation (#210)
- Improve SSAO for thin geometry (e.g. lines)
- Add snapshot support for structure selections
- Add `nucleicProfile` parameter to cartoon representation
- Add `cartoon` theme with separate colorings for for mainchain and sidechain visuals
## [v3.35.0] - 2023-05-14
- Enable odd dash count (1,3,5)
- Add principal axes spec and fix edge cases
- Add a uniform color theme for NtC tube that still paints residue and segment dividers in a different color
- Mesh exporter improvements
- Support points & lines in glTF export
- Set alphaMode and doubleSided in glTF export
- Fix flipped cylinder caps
- Fix bond assignments `struct_conn` records referencing waters
- Add StructConn extension providing functions for inspecting struct_conns
- Fix `PluginState.setSnapshot` triggering unnecessary state updates
- Fix an edge case in the `mol-state`'s `State` when trying to apply a transform to an existing Null object
- Add `SbNcbrPartialCharges` extension for coloring and labeling atoms and residues by partial atomic charges
- uses custom mmcif categories `_sb_ncbr_partial_atomic_charges_meta` and `_sb_ncbr_partial_atomic_charges` (more info in [README.md](./src/extensions/sb-ncbr/README.md))
- Parse HEADER record when reading PDB file
- Support `ignoreHydrogens` in interactions representation
- Add hydroxyproline (HYP) commonly present in collagen molecules to the list of amino acids
- Fix assemblies for Archive PDB files (do not generate unique `label_asym_id` if `REMARK 350` is present)
- Add additional functions to `core.math` in `mol-script`
- `cantorPairing`, `sortedCantorPairing`, `invertCantorPairing`,
- `trunc`, `sign`
## [v3.34.0] - 2023-04-16
- Avoid `renderMarkingDepth` for fully transparent renderables
- Remove `camera.far` doubling workaround
- Add `ModifiersKeys.areNone` helper function
- Do not render NtC tube segments unless all required atoms are present in the structure
- Fix rendering issues caused by VAO reuse
- Add "Zoom All", "Orient Axes", "Reset Axes" buttons to the "Reset Camera" button
- Improve trackball move-state handling when key bindings use modifiers
- Fix rendering with very small viewport and SSAO enabled
- Fix `.getAllLoci` for structure representations with `structure.child`
- Fix `readAllLinesAsync` refering to dom length property
- Make mol-util/file-info node compatible
- Add `eachLocation` to representation/visual interface
## [v3.33.0] - 2023-04-02
- Handle resizes of viewer element even when window remains the same size
- Throttle canvas resize events
- Selection toggle buttons hidden if selection mode is off
- Camera focus loci bindings allow reset on click-away to be overridden
- Input/controls improvements
- Move or fly around the scene using keys
- Pointer lock to look around scene
- Toggle spin/rock animation using keys
- Apply bumpiness as lightness variation with `ignoreLight`
- Remove `JSX` reference from `loci-labels.ts`
- Fix overpaint/transparency/substance smoothing not updated when geometry changes
- Fix camera project/unproject when using offset viewport
- Add support for loading all blocks from a mmcif file as a trajectory
- Add `Frustum3D` and `Plane3D` math primitives
- Include `occupancy` and `B_iso_or_equiv` when creating `Conformation` from `Model`
- Remove LazyImports (introduced in v3.31.1)
## [v3.32.0] - 2023-03-20
- Avoid rendering of fully transparent renderables
- Add occlusion color parameter
- Fix issue with outlines and orthographic camera
- Reduce over-blurring occlusion at larger view distances
- Fix occlusion artefact with non-canvas viewport and pixel-ratio > 1
- Update nodejs-shims conditionals to handle polyfilled document object in NodeJS environment.
- Ensure marking edges are at least one pixel wide
- Add exposure parameter to renderer
- Only trigger marking when mouse is directly over canvas
- Fix blurry occlusion in screenshots
- [Breaking] Add `setFSModule` to `mol-util/data-source` instead of trying to trick WebPack
## [v3.31.4] - 2023-02-24
- Allow link cylinder/line `dashCount` set to '0'
- Stop animation loop when disposing `PluginContext` (thanks @gfrn for identifying the issue)
## [v3.31.3] - 2023-02-22
- Fix impostor bond visuals not correctly updating on `sizeFactor` changes
- Fix degenerate case in PCA
- Fix near clipping avoidance in impostor shaders
- Update `fs` import in `data-source.ts`
## [v3.31.2] - 2023-02-12
- Fix exit code of volume pack executable (pack.ts). Now exits with non-0 status when an error happens
- Remove pca transform from components ui focus (too distracting)
- Fix artefacts with opaque outlines behind transparent objects
- Fix polymer trace visual not updating
- Fix use of `WEBGL_provoking_vertex`
## [v3.31.1] - 2023-02-05
- Improve Component camera focus based on the PCA of the structure and the following rules:
- The first residue should be in first quadrant if there is only one chain
- The average position of the residues of the first chain should be in the first quadrant if there is more than one chain
- Add `HeadlessPluginContext` and `HeadlessScreenshotHelper` to be used in Node.js
- Add example `image-renderer`
- Fix wrong offset when rendering text with orthographic projection
- Update camera/handle helper when `devicePixelRatio` changes
- Add various options to customize the axes camera-helper
- Fix issue with texture-mesh color smoothing when changing themes
- Add fast boundary helper and corresponding unit trait
- Add Observable for Canvas3D commits
## [v3.30.0] - 2023-01-29
- Improve `Dnatco` extension
- Factor out common code in `Dnatco` extension
- Add `NtC tube` visual. Applicable for structures with NtC annotation
- [Breaking] Rename `DnatcoConfalPyramids` to `DnatcoNtCs`
- Improve boundary calculation performance
- Add option to create & include images in state snapshots
- Fix SSAO artefacts with high bias values
- Fix SSAO resolution scale parameter handling
- Improve outlines, visually more stable at different view distances
## [v3.29.0] - 2023-01-15
- `meshes` extension: Fixed a bug in mesh visualization (show backfaces when opacity < 1)
- Add color quick select control to Volume controls
- Fix `dropFiles` bug
- Fix some cyclic imports and reduce the use of const enums. This should make it easier to use the library with the `isolatedModules: true` TS config.
- Fix `dropFiles` bug (#679)
- Add `input type='color'` picker to `CombinedColorControl`
- Set `ParameterMappingControl` disabled when state is updating
- Performance tweaks
- Update clip `defines` only when changed
- Check for identity in structure/unit areEqual methods
- Avoid cloning of structure representation parameters
- Make SymmetryOperator.createMapping monomorphic
- Improve bonding-sphere calculation
- Defer Scene properties calculation (markerAverage, opacityAverage, hasOpaque)
- Improve checks in in UnitsRepresentation setVisualState
- Add StructureElement.Loci.forEachLocation
- Add RepresentationRegistry.clear and ThemeRegistry.clear
- Add generic Loci support for overpaint, substance, clipping themes
- Add `.getCenter` and `.center` to `Camera`
- Add support to dim unmarked groups
- Add support for marker edge strength
## [v3.28.0] - 2022-12-20
- Show histogram in direct volume control point settings
- Add `solidInterior` parameter to sphere/cylinder impostors
- [Breaking] Tweak `ignoreHydrogens` non-polar handling (introduced in 3.27.0)
- Add `meshes` and `volumes-and-segmentations` extensions
- See https://molstarvolseg.ncbr.muni.cz/ for more info
- Fix missing support for info in `ParamDefinition.Converted`
- Add support for multi-visual volume representations
- Improve volume isosurface bounding-sphere
- Add basic volume segmentation support to core
- Add `Volume.Segment` model
- Add `Segmentation` custom volume property
- Add `SegmentRepresentation` representation
- Add `volume-segment` color theme
- Fix GPU marching cubes failing for large meshes with webgl2 (due to use of float16)
## [v3.27.0] - 2022-12-15
- Add an `includeTransparent` parameter to hide/show outlines of components that are transparent
- Fix 'once' for animations of systems with many frames
- Better guard against issue (black fringes) with bumpiness in impostors
- Improve impostor shaders
- Fix sphere near-clipping with orthographic projection
- Fix cylinder near-clipping
- Add interior cylinder caps
- Add per-pixel object clipping
- Fix `QualityAssessment` assignment bug for structures with different auth vs label sequence numbering
- Refresh `ApplyActionControl`'s param definition when toggling expanded state
- Fix `struct_conn` bond assignment for ions
- Ability to show only polar hydrogens
## [v3.26.0] - 2022-12-04
- Support for ``powerPreference`` webgl attribute. Add ``PluginConfig.General.PowerPreference`` and ``power-preference`` Viewer GET param.
- Excluded common protein caps `NME` and `ACE` from the ligand selection query
- Add screen-space shadow post-processing effect
- Add "Structure Molecular Surface" visual
- Add `external-volume` theme (coloring of arbitrary geometries by user-selected volume)
## [v3.25.1] - 2022-11-20
- Fix edge-case in `Structure.eachUnitPair` with single-element units
- Fix 'auto' structure-quality for coarse models
## [v3.25.0] - 2022-11-16
- Fix handling of gzipped assets (reverts #615)
## [v3.24.0] - 2022-11-13
- Make `PluginContext.initContainer` checkered canvas background optional
- Store URL of downloaded assets to detect zip/gzip based on extension (#615)
- Add optional `operator.key`; can be referenced in `IndexPairBonds`
- Add overpaint/transparency/substance theme strength to representations
- Fix viewport color for transparent background
## [v3.23.0] - 2022-10-19
- Add `PluginContext.initContainer/mount/unmount` methods; these should make it easier to reuse a plugin context with both custom and built-in UI
- Add `PluginContext.canvas3dInitialized`
- `createPluginUI` now resolves after the 3d canvas has been initialized
- Change EM Volume Streaming default from `Whole Structure` to `Auto`
## [v3.22.0] - 2022-10-17
- Replace `VolumeIsosurfaceParams.pickingGranularity` param with `Volume.PickingGranuality`
## [v3.21.0] - 2022-10-17
- Add `VolumeIsosurfaceParams.pickingGranularity` param
- Prevent component controls collapsing when option is selected
## [v3.20.0] - 2022-10-16
- [Breaking] Rename the ``model-index`` color theme to ``trajectory-index``
- Add a new ``model-index`` color theme that uniquely colors each loaded model
- Add the new ``model-index`` and ``structure-index`` color themes as an option for the carbon color in the ``element-symbol`` and ``ilustrative`` color themes
- Add ``structure-index`` color theme that uniquely colors each root structure
- Add ``nearest`` method to ``Lookup3D``
- Add mipmap-based blur for skybox backgrounds
## [v3.19.0] - 2022-10-01
- Fix "empty textures" error on empty canvas
- Optimize BinaryCIF integer packing encoder
- Fix dual depth peeling when post-processing is off or when rendering direct-volumes
- Add ``cameraClipping.minNear`` parameter
- Fix black artifacts on specular highlights with transparent background
## [v3.18.0] - 2022-09-17
- Integration of Dual depth peeling - OIT method
- Stereo camera improvements
- Fix param updates not applied
- Better param ranges and description
- Add timer.mark for left/right camera
## [v3.17.0] - 2022-09-11
- [Fix] Clone ``Canvas3DParams`` when creating a ``Canvas3D`` instance to prevent shared state between multiple instances
- Add ``includeResidueTest`` option to ``alignAndSuperposeWithSIFTSMapping``
- Add ``parentDisplay`` param for interactions representation.
- [Experimental] Add support for PyMOL, VMD, and Jmol atom expressions in selection scripts
- Support for ``failIfMajorPerformanceCaveat`` webgl attribute. Add ``PluginConfig.General.AllowMajorPerformanceCaveat`` and ``allow-major-performance-caveat`` Viewer GET param.
- Fix handling of PDB TER records (#549)
- Add support for getting multiple loci from a representation (``.getAllLoci()``)
- Add ``key`` property to intra- and inter-bonds for referencing source data
- Fix click event triggered after move
## [v3.16.0] - 2022-08-25
- Support ``globalColorParams`` and ``globalSymmetryParams`` in common representation params
- Support ``label`` parameter in ``Viewer.loadStructureFromUrl``
- Fix ``ViewportHelpContent`` Mouse Controls section
## [v3.15.0] - 2022-08-23
- Fix wboit in Safari >=15 (add missing depth renderbuffer to wboit pass)
- Add 'Around Camera' option to Volume streaming
- Avoid queuing more than one update in Volume streaming
## [v3.14.0] - 2022-08-20
- Expose inter-bonds compute params in structure
- Improve performance of inter/intra-bonds compute
- Fix defaultAttribs handling in Canvas3DContext.fromCanvas
- Confal pyramids extension improvements
- Add custom labels to Confal pyramids
- Improve naming of some internal types in Confal pyramids extension coordinate
- Add example mmCIF file with categories necessary to display Confal pyramids
- Change the lookup logic of NtC steps from residues
- Add support for download of gzipped files
- Don't filter IndexPairBonds by element-based rules in MOL/SDF and MOL2 (without symmetry) models
- Fix Glycam Saccharide Names used by default
- Fix GPU surfaces rendering in Safari with WebGL2
- Add ``fov`` (Field of View) Canvas3D parameter
- Add ``sceneRadiusFactor`` Canvas3D parameter
- Add background pass (skybox, image, horizontal/radial gradient)
- Set simple-settings presets via ``PluginConfig.Background.Styles``
- Example presets in new backgrounds extension
- Load skybox/image from URL or File (saved in session)
- Opacity, saturation, lightness controls for skybox/image
- Coverage (viewport or canvas) controls for image/gradient
- [Breaking] ``AssetManager`` needs to be passed to various graphics related classes
- Fix SSAO renderable initialization
- Reduce number of webgl state changes
- Add ``viewport`` and ``scissor`` to state object
- Add ``hasOpaque`` to scene object
- Handle edge cases where some renderables would not get (correctly) rendered
- Fix text background rendering for opaque text
- Fix helper scenes not shown when rendering directly to draw target
- Fix ``CustomElementProperty`` coloring not working
## [v3.13.0] - 2022-07-24
- Fix: only update camera state if manualReset is off (#494)
- Improve handling principal axes of points in a plane
- Add 'material' annotation support for textures
- More effort to avoid using ``flat`` qualifier in shaders: add ``dVaryingGroup``
- Enable ``immediateUpdate`` for iso level in isosurface and volume streaming controls
- Add support to download CCD from configurable URL
## [v3.12.1] - 2022-07-20
- Fix plugin behavior dispose logic to correctly unsubscribe observables.
## [v3.12.0] - 2022-07-17
- Add ``colorMarker`` option to Renderer. This disables the highlight and select marker at a shader level for faster rendering of large scenes in some cases.
- Bind shared textures only once per pass, not for each render item
- Fix missing 'material' annotation for some uniforms, causing unnecessary uniform updates
- Remove use of ``isnan`` in impostor shaders, not needed and causing slowdown
- Avoid using ``flat`` qualifier in shaders, causing slowdown
- Improve CellPack's ``adjustStyle`` option (disable ``colorMarker``, set component options, enable marking w/o ghost)
- Scan all entities when looking for ``struct_conn`` entries (fixes issue when the same ``label_asym_id`` is used in more than one entity)
## [v3.11.0] - 2022-07-04
- Add ``instanceGranularity`` option for marker, transparency, clipping, overpaint, substance data to save memory
- CellPack extension tweaks
- Use instancing to create DNA/RNA curves to save memory
- Enable ``instanceGranularity`` by default
- Add ``adjustStyle`` option to LoadCellPackModel action (stylized, no multi-sample, no far clipping, chain picking)
- Structure Superposition now respects pivot's coordinate system
## [v3.10.2] - 2022-06-26
- Fix superfluous shader varying
- Improve use of gl_VertexID when possible
## [v3.10.1] - 2022-06-26
- Fix groupCount when updating TextureMesh-based visuals
## [v3.10.0] - 2022-06-24
- Add support for Glycam saccharide names
- Add ``PluginConfig.Viewport.ShowTrajectoryControls`` config option
## [v3.9.1] - 2022-06-19
- Fix missing ``super.componentWillUnmount()`` calls (@simeonborko)
- Fix missing ``uGroupCount`` update for visuals
- Fix missing aromatic bond display
## [v3.9.0] - 2022-05-30
- Improve picking by using drawbuffers (when available) to reduce number of drawcalls
- GPU timing support
- Add ``timing-mode`` Viewer GET param
- Add support for webgl timer queries
- Add timer marks around GPU render & compute operations
- Volume Server CIF: Add check that a data block contains volume data before parsing
- Fix ``Scene.clear`` not clearing primitives & volumes arrays (@JonStargaryen)
- Fix rendering volumes when wboit is switched off and postprocessing is enabled
## [v3.8.2] - 2022-05-22
- Fix ``Scene.opacityAverage`` not taking xray shaded into account
## [v3.8.1] - 2022-05-14
- Fix issues with marking camera/handle helper (#433)
- Fix issues with array uniforms when running with headless-gl
- Fix Polymer Chain Instance coloring
- Improve performance of scene marker/opacity average calculation
## [v3.8.0] - 2022-04-30
- Add support for outlines around transparent objects
- Improve per-group transparency when wboit is switched off
- Improve ``ColorTheme`` typing with ``ColorType`` generic.
- Defaults to ``ColorTypeLocation``
- Set when using ``ColorTypeDirect`` or ``ColorTypeGrid``
- Fix case handling of ``struct_conf`` mmCIF enumeration field (#425)
- Fix ``allowTransparentBackfaces`` for per-group transparency
- Fix ``FormatRegistry.isApplicable`` returning true for unregistered formats
- Fix: handle building of ``GridLookup3D`` with zero cell size
- Fix ``ignoreLight`` for direct-volume rendering with webgl1
- Fix (non-black) outlines when using transparent background
## [v3.7.0] - 2022-04-13
- Fix ``xrayShaded`` for texture-mesh geometries
- [Breaking] Change ``allowTransparentBackfaces`` to ``transparentBackfaces`` with options ``off``, ``on``, ``opaque``. This was only added in 3.6.0, so allowing a breaking change here.
- ``off``: don't show (default)
- ``on``: show with transparency
- ``opaque``: show fully opaque
- Add option to disable file drop overlay.
## [v3.6.2] - 2022-04-05
- ModelServer ligand queries: fixes for alternate locations, additional atoms & UNL ligand
- React 18 friendly ``useBehavior`` hook.
## [v3.6.1] - 2022-04-03
- Fix React18 related UI regressions.
## [v3.6.0] - 2022-04-03
- Check that model and coordinates have same element count when creating a trajectory
- Fix aromatic rings assignment: do not mix flags and planarity test
- Improve bonds assignment of coarse grained models: check for IndexPairBonds and exhaustive StructConn
- Fix unit mapping in bondedAtomicPairs MolScript query
- Improve pdb parsing: handle non unique atom and chain names (fixes #156)
- Fix volume streaming for entries with multiple contour lists
- Add ``allowTransparentBackfaces`` parameter to support double-sided rendering of transparent geometries
- Fix handling of case insensitive mmCIF enumeration fields (including entity.type)
- Fix ``disable-wboit`` Viewer GET param
- Add support for React 18.
- Used by importing ``createPluginUI`` from ``mol-plugin-ui/react18``;
- In Mol* 4.0, React 18 will become the default option.
## [v3.5.0] - 2022-03-25
- Fix issues with bounding-sphere & color-smoothing (mostly for small geometries)
- Support BCIF => CIF conversion in ``cif2bcif`` CLI tool
## [v3.4.0] - 2022-03-13
- Fix handling of mmcif with empty ``label_*`` fields
- Improve saccharide detection (compare against list from CCD)
- Fix legend label of hydrophobicity color theme
- Add ``LoadTrajectory`` action
- Add ``CustomImportControls`` to left panel
- Add Zenodo import extension (load structures, trajectories, volumes, and zip files)
- Fix loading of some compressed files within sessions
- Fix wrong element assignment for atoms with Charmm ion names
- Fix handling of empty symmetry cell data
- Add support for ``trr`` and ``nctraj`` coordinates files
- Add support for ``prmtop`` and ``top`` topology files
## [v3.3.1] - 2022-02-27
- Fix issue with unit boundary reuse (do at visual level instead)
- Add option to ignore ions for inter-unit bond computation
## [v3.3.0] - 2022-02-27
- Fix parsing contour-level from emdb v3 header files
- Fix invalid CSS (#376)
- Fix "texture not renderable" & "texture not bound" warnings (#319)
- Fix visual for bonds between two aromatic rings
- Fix visual for delocalized bonds (parsed from mmcif and mol2)
- Fix ring computation algorithm
- Add ``UnitResonance`` property with info about delocalized triplets
- Resolve marking in main renderer loop to improve overall performance
- Use ``throttleTime`` instead of ``debounceTime`` in sequence viewer for better responsiveness
- Change line geometry default ``scaleFactor`` to 2 (3 is too big after fixing line rendering)
- Trajectory animation performance improvements
- Reuse ``Model.CoarseGrained`` for coordinate trajectories
- Avoid calculating ``InterUnitBonds`` when ``Structure.parent`` ones are empty
- Reuse unit boundary if sphere has not changed too much
- Don't show 'inter-bond' and 'element-cross' visuals in line representations of polymerAndLigand preset
- Fix additional mononucleotides detected as polymer components
- Fix and improve ``canRemap`` handling in ``IntraUnitBonds``
- Reuse occlusion for secondary passes during multi-sampling
- Check if marking passes are needed before doing them
- Add ``resolutionScale`` parameter to allow trading quality of occlusion for performance
## [v3.2.0] - 2022-02-17
- Rename "best database mapping" to "SIFTS Mapping"
- Add schema and export support for ``atom_site.pdbx_sifts_xref_*`` fields
- Add schema export support for ``atom_site.pdbx_label_index`` field
- Add `traceOnly` parameter to chain/UniProt-based structure alignment
- Store ``IndexPairBonds`` as a dynamic property.
## [v3.1.0] - 2022-02-06
- Fix ``xrayShaded`` & ``ignoreLight`` params not working at the same time
- Add ``ignoreLight`` to component params
- Tweaks for cleaner default representation style
- Cartoon: use ``nucleotide-ring`` instead of ``nucleotide-block``
- Focus: use ``xrayShaded`` instead of opacity; adjust target size; don't show non-covalent interactions twice
- Fix representation preset side effects (changing post-processing parameters, see #363)
- Add Quick Styles panel (default, illustrative, stylized)
- Fix exported structure missing secondary-structure categories (#364)
- Fix volume streaming error message: distinguish between missing data and server error (#364)
## [v3.0.2] - 2022-01-30
- Fix color smoothing of elongated structures (by fixing ``Sphere.expand`` for spheres with highly directional extrema)
- Fix entity label not displayed when multiple instances of the same entity are highlighted
- Fix empty elements created in ``StructureElement.Loci.extendToAllInstances``
- Measurement options tweaks (allow larger ``textSize``; make ``customText`` essential)
- Fix visual visibility sync edge case when changing state snapshots
## [v3.0.1] - 2022-01-27
- Fix marking pass not working with ``transparentBackground``
- Fix pdbe xray maps url not https
- Fix entity-id color theme broken for non-IHM models
- Improve/fix marking of ``InteractionsInterUnitVisual`` (mark when all contact-feature members are given)
- Add missing "entity-id" and "enity-source" options for carbon coloring to "element-symbol" color theme
- Fix VolumeServer/query CLI
- Support automatic iso-value adjustment for VolumeServer data in ``Viewer.loadVolumeFromUrl``
- Emit drag event whenever started within viewport (not only for non-empty loci)
## [v3.0.0] - 2022-01-23
- Assembly handling tweaks:
- Do not include suffix for "identity assembly operators"
- Do not include assembly-related categories to export if the structure was composed from an assembly
- Special case for ``structAsymMap`` if Mol* asym id operator mapping is present
- Support for opening ZIP files with multiple entries
- Add Model Export extension
- Bugfix: Automatically treat empty string as "non-present" value in BinaryCIF writer.
- Fix coarse model support in entity-id color theme
- Fix marking of carbohydrate visuals (whole chain could get marked instead of single residue)
- Add custom colors to "element-symbol", "molecule-type", "residue-name", and "secondary-structure" themes
- Support/bugfixes for ``atom_site.pdbx_sifts_xref`` categories
- Improve/fix marking of ``InteractionsIntraUnitVisual`` (mark when all contact-feature members are given)
## [v3.0.0-dev.10] - 2022-01-17
- Fix ``getOperatorsForIndex``
- Pass animation info (current frame & count) to state animations
- Fix camera stutter for "camera spin" animation
- Add formal charge parsing support for MOL/SDF files (thanks @ptourlas)
- [Breaking] Cleaner looking ``MembraneOrientationVisuals`` defaults
- [Breaking] Add rock animation to trackball controls
- Add ``animate`` to ``TrackballControlsParams``, remove ``spin`` and ``spinSpeed``
- Add ``animate`` to ``SimpleSettingsParams``, remove ``spin``
- Add "camera rock" state animation
- Add support for custom colors to "molecule-type" theme
- [Breaking] Add style parameter to "illustrative" color theme
- Defaults to "entity-id" style instead of "chain-id"
- Add "illustrative" representation preset
## [v3.0.0-dev.9] - 2022-01-09
- Add PDBj as a ``pdb-provider`` option
- Move Viewer APP to a separate file to allow use without importing light theme & index.html
- Add symmetry support for mol2 files (only spacegroup setting 1)
- Fix mol2 files element symbol assignment
- Improve bond assignment from ``IndexPairBonds``
- Add ``key`` field for mapping to source data
- Fix assignment of bonds with unphysical length
- Fix label/stats of single atom selection in multi-chain units
## [v3.0.0-dev.8] - 2021-12-31
- Add ``PluginFeatureDetection`` and disable WBOIT in Safari 15.
- Add ``disable-wboit`` Viewer GET param
- Add ``prefer-webgl1`` Viewer GET param
- [Breaking] Refactor direct-volume rendering
- Remove isosurface render-mode (use GPU MC instead)
- Move coloring into theme (like for other geometries/renderables)
- Add ``direct`` color type
- Remove color from transfer-function (now only alpha)
- Add direct-volume color theme support
- Add volume-value color theme
- [Breaking] Use size theme in molecular/gaussian surface & label representations
- This is breaking because it was hardcoded to ``physical`` internally but the repr size theme default was ``uniform`` (now ``physical``)
## [v3.0.0-dev.7] - 2021-12-20
- Reduce number of created programs/shaders
- Support specifying variants when creating graphics render-items
- Change double-side shader param from define to uniform
- Remove dMarkerType shader define (use uMarker as needed)
- Support to ignore defines depending on the shader variant
- Combine pickObject/pickInstance/pickGroup shader variants into one
- Combine markingDepth/markingMask shader variants into one
- Correctly set shader define flags for overpaint, transparency, substance, clipping
- [Breaking] Add per-object clip rendering properties (variant/objects)
- ``SimpleSettingsParams.clipping.variant/objects`` and ``RendererParams.clip`` were removed
## [v3.0.0-dev.6] - 2021-12-19
- Enable temporal multi-sampling by default
- Fix flickering during marking with camera at rest
- Enable ``aromaticBonds`` in structure representations by default
- Add ``PluginConfig.Structure.DefaultRepresentationPreset``
- Add ModelArchive support
- schema extensions (e.g., AlphaFold uses it for the pLDDT score)
- ModelArchive option in DownloadStructure action
- ``model-archive`` GET parameter for Viewer app
- ``Viewer.loadModelArchive`` method
- Improve support for loading AlphaFold structures
- Automatic coloring by pLDDT
- AlphaFold DB option in DownloadStructure action
- ``afdb`` GET parameter for Viewer app
- ``Viewer.loadAlphaFoldDb`` method
- Add QualityAssessment extension (using data from ma_qa_metric_local mmcif category)
- pLDDT & qmean score: coloring, repr presets, molql symbol, loci labels (including avg for mutli-residue selections)
- pLDDT: selection query
- Warn about erroneous symmetry operator matrix (instead of throwing an error)
- Added ``createPluginUI`` to ``mol-plugin-ui``
- Support ``onBeforeUIRender`` to make sure initial UI works with custom presets and similar features.
- [Breaking] Removed ``createPlugin`` and ``createPluginAsync`` from ``mol-plugin-ui``
- Please use ``createPluginUI`` instead
- Improve aromatic bonds handling
- Don't detect aromatic bonds for rings < 5 atoms based on planarity
- Prefer atoms in aromatic rings as bond reference positions
## [v3.0.0-dev.5] - 2021-12-16
- Fix initial camera reset not triggering for some entries.
## [v3.0.0-dev.4] - 2021-12-14
- Add ``bumpiness`` (per-object and per-group), ``bumpFrequency`` & ``bumpAmplitude`` (per-object) render parameters (#299)
- Change ``label`` representation defaults: Use text border instead of rectangle background
- Add outline color option to renderer
- Fix false positives in Model.isFromPdbArchive
- Add drag and drop support for loading any file, including multiple at once
- If there are session files (.molx or .molj) among the dropped files, only the first session will be loaded
- Add drag and drop overlay
- Safari 15.1 - 15.3 WebGL 2 support workaround
- [Breaking] Move ``react`` and ``react-dom`` to ``peerDependencies``. This might break some builds.
## [v3.0.0-dev.3] - 2021-12-4
- Fix OBJ and USDZ export
## [v3.0.0-dev.2] - 2021-12-1
- Do not include tests and source maps in NPM package
## [v3.0.0-dev.0] - 2021-11-28
- Add multiple lights support (with color, intensity, and direction parameters)
- [Breaking] Add per-object material rendering properties
- ``SimpleSettingsParams.lighting.renderStyle`` and ``RendererParams.style`` were removed
- Add substance theme with per-group material rendering properties
- ``StructureComponentManager.Options`` state saving support
- ``ParamDefinition.Group.presets`` support
## [v2.4.1] - 2021-11-28
- Fix: allow atoms in aromatic rings to do hydrogen bonds
## [v2.4.0] - 2021-11-25
- Fix secondary-structure property handling
- StructureElement.Property was incorrectly resolving type & key
- StructureSelectionQuery helpers 'helix' & 'beta' were not ensuring property availability
- Re-enable VAO with better workaround (bind null elements buffer before deleting)
- Add ``Representation.geometryVersion`` (increments whenever the geometry of any of its visuals changes)
- Add support for grid-based smoothing of Overpaint and Transparency visual state for surfaces
## [v2.3.9] - 2021-11-20
- Workaround: switch off VAO support for now
## [v2.3.8] - 2021-11-20
- Fix double canvas context creation (in plugin context)
- Fix unused vertex attribute handling (track which are used, disable the rest)
- Workaround for VAO issue in Chrome 96 (can cause WebGL to crash on geometry updates)
## [v2.3.7] - 2021-11-15
- Added ``ViewerOptions.collapseRightPanel``
- Added ``Viewer.loadTrajectory`` to support loading "composed" trajectories (e.g. from gro + xtc)
- Fix: handle parent in Structure.remapModel
- Add ``rounded`` and ``square`` helix profile options to Cartoon representation (in addition to the default ``elliptical``)
## [v2.3.6] - 2021-11-8
- Add additional measurement controls: orientation (box, axes, ellipsoid) & plane (best fit)
- Improve aromatic bond visuals (add ``aromaticScale``, ``aromaticSpacing``, ``aromaticDashCount`` params)
- [Breaking] Change ``adjustCylinderLength`` default to ``false`` (set to true for focus representation)
- Fix marker highlight color overriding select color
- CellPack extension update
- add binary model support
- add compartment (including membrane) geometry support
- add latest mycoplasma model example
- Prefer WebGL1 in Safari 15.1.
## [v2.3.5] - 2021-10-19
- Fix sequence viewer for PDB files with COMPND record and multichain entities.
- Fix index pair bonds order assignment
## [v2.3.4] - 2021-10-12
- Fix pickScale not taken into account in line/point shader
@@ -148,29 +1059,22 @@ Note that since we don't clearly distinguish between a public and private interf
- Fixed Measurements UI labels (#166)
## [v2.0.3] - 2021-04-09
### Added
- Support for ``ColorTheme.palette`` designed for providing gradient-like coloring.
### Changed
- Add support for ``ColorTheme.palette`` designed for providing gradient-like coloring.
- [Breaking] The ``zip`` function is now asynchronous and expects a ``RuntimeContext``. Also added ``Zip()`` returning a ``Task``.
- [Breaking] Add ``CubeGridFormat`` in ``alpha-orbitals`` extension.
## [v2.0.2] - 2021-03-29
### Added
- ``Canvas3D.getRenderObjects``.
- Add ``Canvas3D.getRenderObjects``.
- [WIP] Animate state interpolating, including model trajectories
### Changed
- Recognise MSE, SEP, TPO, PTR and PCA as non-standard amino-acids.
### Fixed
- VolumeFromDensityServerCif transform label
- Fix VolumeFromDensityServerCif transform label
## [v2.0.1] - 2021-03-23
### Fixed
- Exclude tsconfig.commonjs.tsbuildinfo from npm bundle
## [v2.0.0] - 2021-03-23
Too many changes to list as this is the start of the changelog... Notably, default exports are now forbidden.

72
CITATION.cff Normal file
View File

@@ -0,0 +1,72 @@
cff-version: 1.2.0
title: >-
Mol* library
message: >-
Please cite this software using the metadata from
'preferred-citation'.
authors:
- given-names: Alexander S
family-names: Rose
orcid: 'https://orcid.org/0000-0002-0893-5551'
- given-names: David
family-names: Sehnal
orcid: 'https://orcid.org/0000-0002-0682-3089'
- given-names: Sebastian
family-names: Bittrich
orcid: 'https://orcid.org/0000-0003-3576-0387'
- given-names: Áron Samuel
family-names: Kovács
- given-names: Ludovic
family-names: Autin
orcid: 'https://orcid.org/0000-0002-2197-191X'
- given-names: Michal
family-names: Malý
- given-names: Jiří
family-names: Černý
- given-names: Panagiotis
family-names: Tourlas
type: software
doi: 10.5281/zenodo.3947306
preferred-citation:
authors:
- given-names: David
family-names: Sehnal
orcid: 'https://orcid.org/0000-0002-0682-3089'
- given-names: Sebastian
family-names: Bittrich
orcid: 'https://orcid.org/0000-0003-3576-0387'
- given-names: Mandar
family-names: Deshpande
orcid: 'https://orcid.org/0000-0002-9043-7665'
- given-names: Radka
family-names: Svobodová
orcid: 'https://orcid.org/0000-0002-3840-8760'
- given-names: Karel
family-names: Berka
orcid: 'https://orcid.org/0000-0001-9472-2589'
- given-names: Václav
family-names: Bazgier
orcid: 'https://orcid.org/0000-0003-3393-3010'
- given-names: Sameer
family-names: Velankar
orcid: 'https://orcid.org/0000-0002-8439-5964'
- given-names: Stephen K
family-names: Burley
orcid: 'https://orcid.org/0000-0002-2487-9713'
- given-names: Jaroslav
family-names: Koča
orcid: 'https://orcid.org/0000-0002-2780-4901'
- given-names: Alexander S
family-names: Rose
orcid: 'https://orcid.org/0000-0002-0893-5551'
title: >-
Mol* Viewer: modern web app for 3D visualization
and analysis of large biomolecular structures
type: article
doi: 10.1093/nar/gkab314
journal: "Nucleic Acids Research"
issue: W1
volume: 49
year: 2021
month: 7
pages: "W431W437"

View File

@@ -1,6 +1,6 @@
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](./LICENSE)
[![npm version](https://badge.fury.io/js/molstar.svg)](https://www.npmjs.com/package/molstar)
[![Build Status](https://travis-ci.org/molstar/molstar.svg?branch=master)](https://travis-ci.org/molstar/molstar)
[![Build](https://github.com/molstar/molstar/actions/workflows/node.yml/badge.svg)](https://github.com/molstar/molstar/actions/workflows/node.yml)
[![Gitter](https://badges.gitter.im/molstar/Lobby.svg)](https://gitter.im/molstar/Lobby)
# Mol*
@@ -11,6 +11,13 @@ When using Mol*, please cite:
David Sehnal, Sebastian Bittrich, Mandar Deshpande, Radka Svobodová, Karel Berka, Václav Bazgier, Sameer Velankar, Stephen K Burley, Jaroslav Koča, Alexander S Rose: [Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures](https://doi.org/10.1093/nar/gkab314), *Nucleic Acids Research*, 2021; https://doi.org/10.1093/nar/gkab314.
### Protein Data Bank Integrations
- The [pdbe-molstar](https://github.com/molstar/pdbe-molstar) library is the Mol* implementation used by EMBL-EBI data resources such as [PDBe](https://pdbe.org/), [PDBe-KB](https://pdbe-kb.org/) and [AlphaFold DB](https://alphafold.ebi.ac.uk/). This implementation can be used as a JS plugin and a Web component and supports property/attribute-based easy customisation. It provides helper methods to facilitate programmatic interactions between the web application and the 3D viewer. It also provides a superposition view for overlaying all the observed ligand molecules on representative protein conformations.
- [rcsb-molstar](https://github.com/molstar/rcsb-molstar) is the Mol* plugin used by [RCSB PDB](https://www.rcsb.org). The project provides additional presets for the visualization of structure alignments and structure motifs such as ligand binding sites. Furthermore, [rcsb-molstar](https://github.com/molstar/rcsb-molstar) allows to interactively add or hide of (parts of) chains, as seen in the [3D Protein Feature View](https://www.rcsb.org/3d-sequence/4hhb).
## Project Structure Overview
The core of Mol* consists of these modules (see under `src/`):
@@ -68,6 +75,17 @@ If working on just the viewer, ``npm run watch-viewer`` will provide shorter com
Debug/production mode in browsers can be turned on/off during runtime by calling ``setMolStarDebugMode(true/false, true/false)`` from the dev console.
### Cleaning and forcing a full rebuild
npm run clean
Wipes the `build` and `lib` directories and `.tsbuildinfo` files.
npm run rebuild
Runs the cleanup script prior to building the project, forcing a full rebuild of the project.
Use these commands to resolve occassional build failures which may arise after some dependency updates. Once done, `npm run build` should work again. Note that full rebuilds take more time to complete.
### Build for production:
NODE_ENV=production npm run build
@@ -102,10 +120,9 @@ and navigate to `build/viewer`
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-ions.js src/mol-model/structure/model/types/ions.ts
**Saccharide names**
**GraphQL schemas**
node node_modules//@graphql-codegen/cli/bin -c src/extensions/rcsb/graphql/codegen.yml
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-saccharides.js src/mol-model/structure/model/types/saccharides.ts
### Other scripts
**Create chem comp bond table**
@@ -120,16 +137,21 @@ and navigate to `build/viewer`
export NODE_PATH="lib"; node build/state-docs
**Convert any CIF to BinaryCIF**
**Convert any CIF to BinaryCIF (or vice versa)**
node lib/servers/model/preprocess -i file.cif -ob file.bcif
node lib/commonjs/servers/model/preprocess -i file.cif -ob file.bcif
To see all available commands, use ``node lib/servers/model/preprocess -h``.
To see all available commands, use ``node lib/commonjs/servers/model/preprocess -h``.
Or
node lib/commonjs/cli/cif2bcif
E.g.
node lib/commonjs/cli/cif2bcif src.cif out.bcif.gz
node lib/commonjs/cli/cif2bcif src.bcif.gz out.cif
## Development
### Installation
@@ -141,13 +163,12 @@ If node complains about a missing acorn peer dependency, run the following comma
### Editor
To get syntax highlighting for shader and graphql files add the following to Visual Code's settings files and make sure relevant extensions are installed in the editor.
To get syntax highlighting for shader files add the following to Visual Code's settings files and make sure relevant extensions are installed in the editor.
"files.associations": {
"*.glsl.ts": "glsl",
"*.frag.ts": "glsl",
"*.vert.ts": "glsl",
"*.gql.ts": "graphql"
"*.vert.ts": "glsl"
},
## Publish

View File

@@ -24,6 +24,11 @@ atom_site.auth_asym_id
atom_site.auth_seq_id
atom_site.pdbx_PDB_model_num
atom_site.ihm_model_id
atom_site.pdbx_label_index
atom_site.pdbx_sifts_xref_db_name
atom_site.pdbx_sifts_xref_db_acc
atom_site.pdbx_sifts_xref_db_num
atom_site.pdbx_sifts_xref_db_res
atom_site_anisotrop.id
atom_site_anisotrop.U
@@ -246,6 +251,14 @@ citation_author.ordinal
exptl.entry_id
exptl.method
software.classification
software.date
software.description
software.name
software.pdbx_ordinal
software.type
software.version
struct.entry_id
struct.title
struct.pdbx_descriptor
@@ -802,4 +815,58 @@ ihm_multi_state_modeling.population_fraction_sd
ihm_multi_state_modeling.state_type
ihm_multi_state_modeling.state_name
ihm_multi_state_modeling.experiment_type
ihm_multi_state_modeling.details
ihm_multi_state_modeling.details
ma_data.content_type
ma_data.content_type_other_details
ma_data.id
ma_data.name
ma_model_list.data_id
ma_model_list.model_group_id
ma_model_list.model_group_name
ma_model_list.model_id
ma_model_list.model_name
ma_model_list.model_type
ma_model_list.ordinal_id
ma_qa_metric.id
ma_qa_metric.mode
ma_qa_metric.name
ma_qa_metric.software_group_id
ma_qa_metric.type
ma_qa_metric_global.metric_id
ma_qa_metric_global.metric_value
ma_qa_metric_global.model_id
ma_qa_metric_global.ordinal_id
ma_qa_metric_local.label_asym_id
ma_qa_metric_local.label_comp_id
ma_qa_metric_local.label_seq_id
ma_qa_metric_local.metric_id
ma_qa_metric_local.metric_value
ma_qa_metric_local.model_id
ma_qa_metric_local.ordinal_id
ma_software_group.group_id
ma_software_group.ordinal_id
ma_software_group.software_id
ma_target_entity.data_id
ma_target_entity.entity_id
ma_target_entity.origin
ma_target_entity_instance.asym_id
ma_target_entity_instance.details
ma_target_entity_instance.entity_id
ma_target_ref_db_details.db_accession
ma_target_ref_db_details.db_code
ma_target_ref_db_details.db_name
ma_target_ref_db_details.ncbi_taxonomy_id
ma_target_ref_db_details.organism_scientific
ma_target_ref_db_details.seq_db_align_begin
ma_target_ref_db_details.seq_db_align_end
ma_target_ref_db_details.seq_db_isoform
ma_target_ref_db_details.target_entity_id
1 atom_sites.entry_id
24 atom_site.pdbx_PDB_model_num
25 atom_site.ihm_model_id
26 atom_site_anisotrop.id atom_site.pdbx_label_index
27 atom_site.pdbx_sifts_xref_db_name
28 atom_site.pdbx_sifts_xref_db_acc
29 atom_site.pdbx_sifts_xref_db_num
30 atom_site.pdbx_sifts_xref_db_res
31 atom_site_anisotrop.id
32 atom_site_anisotrop.U
33 atom_site_anisotrop.U_esd
34 atom_site_anisotrop.pdbx_PDB_ins_code
251 struct_conn.conn_type_id struct_conf.end_auth_comp_id
252 struct_conn.pdbx_PDB_id struct_conf.end_auth_asym_id
253 struct_conn.ptnr1_label_asym_id struct_conf.end_auth_seq_id
254 struct_conf.pdbx_PDB_helix_class
255 struct_conf.details
256 struct_conf.pdbx_PDB_helix_length
257 struct_conn.id
258 struct_conn.conn_type_id
259 struct_conn.pdbx_PDB_id
260 struct_conn.ptnr1_label_asym_id
261 struct_conn.ptnr1_label_comp_id
262 struct_conn.ptnr1_label_comp_id struct_conn.ptnr1_label_seq_id
263 struct_conn.ptnr1_label_seq_id struct_conn.ptnr1_label_atom_id
264 struct_conn.ptnr1_label_atom_id struct_conn.pdbx_ptnr1_label_alt_id
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872

11
docs/README.md Normal file
View File

@@ -0,0 +1,11 @@
# Mol* Developer Documentation
Contributions to the documentations are highly welcome! Please make a pull request with your changes.
Requires Python 3.x to build. From this directory:
```
pip install mkdocs-material
mkdocs serve
```

View File

@@ -0,0 +1,41 @@
# Convert CIF to BinaryCIF
BinaryCIF is an efficient, binary flavor of the CIF format. See [specification](https://github.com/molstar/BinaryCIF) and [publication](https://doi.org/10.1371/journal.pcbi.1008247) for further details.
This script reads data in CIF format and converts it lossless to a BinaryCIF file that can be read by Mol* or other
applications.
## Example
```sh
node lib/commonjs/cli/cif2bcif/index.js file.cif file.bcif
```
## Usage
| Argument | Description |
| --- | --- |
| `src` | Source CIF to convert (can be gzipped) |
| `out` | Generated BinaryCIF output path |
| `-c` | Path to optional config file |
| `-f` | Path to optional filter file |
```sh
index.js [-h] [-c CONFIG] [-f FILTER] src out
```
### Config file
Controls how certain columns will be encoded. This is a JSON array of instructions:
```ts
interface EncodingStrategyHint {
categoryName: string,
columnName: string,
encoding: 'pack' | 'rle' | 'delta' | 'delta-rle',
precision?: number
}
```
Identify a particular CIF columns by its name and override the encoding by Integer Packing, Run-Length Encoding, Delta
Encoding, or Delta & Run-Length Encoding. You can optionally control the precision if dealing with float values.
### Filter file
Specifies which categories and columns will be written. This is a plain text file, each line represents one entry.
You can specify explicitly which categories or columns to include by adding `category_name` or
`category_name.field_name`. You can also choose to ignore some categories or columns by adding `!category_name` or
`!category_name.field_name`.

View File

@@ -0,0 +1,25 @@
# Create Table from CCD
The [Chemical Component Dictionary (CCD)](https://www.wwpdb.org/data/ccd) is as an external reference file describing
all residue and small molecule components found in PDB entries. The
[Protonation Variants Companion Dictionary (PVCD)](https://www.wwpdb.org/data/ccd) enumerates protonation variants of
canonical amino acids.
This script bundles all `chem_comp_bond` information from the CCD and the PVCD into a single file for later use.
Optionally, it can also generate a second output file that contains all `chem_comp_atom` information.
## Example
```sh
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-table.js build/data/ccb.bcif -b
```
## Usage
| Argument | Description |
| --- | --- |
| `out` | Generated file output path |
| `--forceDownload`, `-f` | Force download of CCD and PVCD |
| `--binary`, `-b` | Output as BinaryCIF |
| `--ccaOut`, `-a` | File output path of optionally generated chem_comp_atom |
```sh
create-table.js [-h] [--forceDownload] [--binary] [--ccaOut CCAOUT] out
```

View File

@@ -0,0 +1,20 @@
# Extract Ions from CCD
The [Chemical Component Dictionary (CCD)](https://www.wwpdb.org/data/ccd) is as an external reference file describing
all residue and small molecule components found in PDB entries.
This script extracts all ions from the CCD and provides their names as TypeScript set.
## Example
```sh
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-ions.js src/mol-model/structure/model/types/ions.ts
```
## Usage
| Argument | Description |
| --- | --- |
| `out` | Generated file output path |
| `--forceDownload`, `-f` | Force download of CCD |
```sh
create-ions.js [-h] [--forceDownload] out
```

View File

@@ -0,0 +1,119 @@
# Model Server
Provides access to molecular 1D, 2D, and 3D (sub-)structure models of molecules. Substructures are described by the
mol-script (MolQL) language. It has the ability to include additional data to mmCIF “on the fly”, e.g. integrate
primary PDB archival data from [Chemical Component Dictionary (CCD)](https://www.wwpdb.org/data/ccd),
[Protonation Variants Companion Dictionary (PVCD)](https://www.wwpdb.org/data/ccd) and
[Biologically Interesting moleculeReference Dictionary (BIRD)](https://www.wwpdb.org/data/bird).
## Example
```sh
node lib/commonjs/servers/model/server --sourceMap pdb-bcif '/opt/data/bcif/${id}.bcif'
```
## Usage
| Argument | Description |
| --- | --- |
| `--version`, `-v` | Show program's version number and exit. |
| `--cfg` | JSON config file path. If a property is not specified, cmd line param/OS variable/default value are used. |
| `--printCfg` | Print current config for validation and exit. |
| `--cfgTemplate` | Prints default JSON config template to be modified and exit. |
| `--apiPrefix` | Specify the prefix of the API, i.e. &lt;host&gt;/&lt;apiPrefix&gt;/&lt;API queries&gt; |
| `--defaultPort` | Specify the port the server is running on |
| `--cacheMaxSizeInBytes` | Read structures are cached, this specifies the cache size, 0 for off. |
| `--cacheEntryTimeoutMs` | Specify in ms how long to keep entries in cache. |
| `--requestTimeoutMs` | The maximum number of ms the server spends on a request. |
| `--queryTimeoutMs` | The maximum time the server dedicates to executing a query in ms. Does not include the time it takes to read and export the data. |
| `--shutdownTimeoutMinutes` | Server will shut down after this amount of minutes, 0 for off. |
| `--shutdownTimeoutVarianceMinutes` | Modifies the shutdown timer by +/- `timeoutVarianceMinutes` (to avoid multiple instances shutting at the same time) |
| `--maxQueryManyQueries` | Maximum number of queries allowed by the query-many at a time |
| `--defaultSource` | modifies which 'sourceMap' source to use by default |
| `--sourceMap` | Map `id`s for a `source` to a file path. Example: `pdb-bcif '../../data/bcif/${id}.bcif'` - JS expressions can be used inside `${}`, e.g. `${id.substr(1, 2)}/${id}.mdb` Can be specified multiple times. The `SOURCE` variable (e.g. `pdb-bcif`) is arbitrary and depends on how you plan to use the server. Supported formats: cif, bcif, cif.gz, bcif.gz |
| `--sourceMapUrl` | Same as `--sourceMap` but for URL. `--sourceMapUrl src url format` Example: `pdb-cif "https://www.ebi.ac.uk/pdbe/entry-files/download/${id}_updated.cif" cif` Supported formats: cif, bcif, cif.gz, bcif.gz |
```sh
node lib/commonjs/servers/model/server [-h] [-v]
[--cfg CFG]
[--printCfg]
[--cfgTemplate]
[--apiPrefix PREFIX]
[--defaultPort PORT]
[--cacheMaxSizeInBytes CACHE_SIZE]
[--cacheEntryTimeoutMs CACHE_TIMEOUT]
[--requestTimeoutMs REQUEST_TIMEOUT]
[--queryTimeoutMs QUERY_TIMEOUT]
[--shutdownTimeoutMinutes TIME]
[--shutdownTimeoutVarianceMinutes VARIANCE]
[--maxQueryManyQueries QUERY_MANY_LIMIT]
[--defaultSource DEFAULT_SOURCE]
[--sourceMap SOURCE PATH]
[--sourceMapUrl SOURCE PATH SOURCE_MAP_FORMAT]
```
### Production Use
In production, it is required to use a service that will keep the server running, such as [forever.js](https://github.com/foreverjs/forever).
### Memory Issues
Sometimes nodejs might run into problems with memory. This is usually resolved by adding the ``--max-old-space-size=8192`` parameter.
### Preprocessor Example
The preprocessor application allows addiing custom data to CIF files and/or
[convert CIF to BinaryCIF](./convert-to-bcif.md).
```sh
node lib/commonjs/servers/model/preprocess
```
### Preprocessor Usage
| Argument | Description |
| --- | --- |
| `--input`, `-i` | Input filename |
| `--outCIF`, `-oc` | Output CIF filename |
| `--outBCIF`, `-ob` | Output BinaryCIF filename |
| `--cfg`, `-c` | Config file path |
| `--folderIn`, `-fin` | Convert folder |
| `--folderOutCIF`, `-foc` | Convert folder text output |
| `--folderOutBCIF`, `-fob` | Convert folder binary output |
| `--folderNumProcesses`, `-fp` | Convert folder number processes |
Example cfg.json:
```ts
{
"numProcesses": 1,
"customProperties": {
"sources": [ "wwpdb" ],
"params": {
"wwPDB": {
"chemCompBondTablePath": "./build/data/ccb.bcif"
}
}
}
}
```
### Local Mode
The server can be run in local/file based mode using
```sh
node lib/commonjs/servers/model/query
```
### Custom Properties
This feature is still in development.
It is possible to provide property descriptors that transform data to internal representation and define how it should
be exported into one or mode CIF categories. Examples of this are located in the ``mol-model-props`` module and are
linked to the server in the config and ``servers/model/properties``.
## From NPM
```
npm install --production molstar
cd ./model-server
```
(or ``node node_modules\.bin\model-server`` in Windows).
The NPM package contains all the tools mentioned in the previous sections as "binaries":
- ``model-server``
- ``model-server-query``
- ``model-server-preprocess``

View File

@@ -0,0 +1,22 @@
# Plugin State Server
Provides a simple backend for online storing and sharing of Mol* sessions used by
[``mol-plugin``](https://github.com/molstar/molstar/tree/master/src/mol-plugin) and
[``mol-state``](https://github.com/molstar/molstar/tree/master/src/mol-state) modules.
## Example
```sh
node lib/commonjs/servers/plugin-state --workding-folder ~
```
## Usage
| Argument | Description |
| --- | --- |
| `--working-folder` | Working folder path |
| `--port` | Server port. Alternatively, use ENV variable PORT. |
| `--api-prefix` | Server API prefix |
| `--max-states` | Maximum number of states to save |
```sh
node lib/commonjs/servers/plugin-state [-h] --working-folder WORKING_FOLDER [--port PORT] [--api-prefix API_PREFIX] [--max-states MAX_STATES]
```

View File

@@ -1,9 +1,9 @@
Zika Virus
==========
# VolumeServer Examples
## Zika Virus
![Zika Virus](img/zika_downsampled.png)
1TQN
====
## 1TQN
![1tqn](img/1tqn_downsampled.png)

View File

@@ -1,5 +1,4 @@
How it works
============
## VolumeServer: How it works
This document provides a high level overview of how the DensityServer works.

View File

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 292 KiB

View File

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 310 KiB

View File

@@ -0,0 +1,126 @@
# VolumeServer
## What is VolumeServer
Provides near-instantaneous access to volumetric data including density maps (for instance, from X-ray crystallography
or cryo-electron microscopy experiments), spatial distribution data, output from electrostatic calculations. It works by
utilizing adaptive downsampling (similar to how Google Earth works).
It uses the text based CIF and BinaryCIF formats to deliver the data to the client.
For quick info about the benefits of using the server, check out the [examples](examples.md).
## Installing and Running
Requires nodejs 8+.
### From GitHub
```
git clone https://github.com/molstar/molstar
npm install
```
Afterwards, build the project source:
```
npm run build-tsc
```
and run the server by
```
node lib/commonjs/servers/volume/server
```
### From NPM
```
npm install --production molstar
./volume-server
```
(or ``node node_modules\.bin\volume-server`` in Windows).
The NPM package contains all the tools mentioned here as "binaries":
- ``volume-server``
- ``volume-server-pack``
- ``volume-server-query``
#### Production use
In production it is required to use a service that will keep the server running, such as [forever.js](https://github.com/foreverjs/forever).
#### Memory issues
Sometimes nodejs might run into problems with memory. This is usually resolved by adding the ``--max-old-space-size=8192`` parameter.
### Preparing the Data
For the server to work, CCP4/MAP (models 0, 1, 2 are supported) input data need to be converted into a custom block format.
To achieve this, use the ``pack`` application (``node lib/commonjs/servers/volume/pack`` or ``volume-server-pack`` binary from the NPM package).
### Local Mode
The program ``lib/commonjs/servers/volume/pack`` (``volume-server-query`` in NPM package) can be used to query the data without running a http server.
### Navigating the Source Code
The source code is split into 2 mains parts: ``pack`` and ``server``:
- The ``pack`` part provides the means of converting CCP4 files into the internal block format.
- The ``server`` includes
- ``query``: the main part of the server that handles a query. ``execute.ts`` is the "entry point".
- ``algebra``: linear, "coordinate", and "box" algebra provides the means for calculations necessary to concent a user query into a menaningful response.
- API wrapper that handles the requests.
## Consuming the Data
The data can be consumed in any (modern) browser using the [ciftools library](https://github.com/molstar/ciftools) (or any other piece of code that can read text or binary CIF).
The [Data Format](./response-data-format.md) document gives a detailed description of the server response format.
As a reference/example of the server usage is available in Mol* ``mol-plugin`` module.
## Hosting the server
### Example
```sh
node lib/commonjs/servers/volume/server --idMap x-ray '/opt/data/xray/${id}.mdb'
```
### Usage
| Argument= | Description |
| --- | --- |
| `--cfg` | JSON config file path. If a property is not specified, cmd line param/OS variable/default value are used. |
| `--printCfg` | Print current config for validation and exit. |
| `--cfgTemplate` | Prints default JSON config template to be modified and exit. |
| `--apiPrefix` | Specify the prefix of the API, i.e. &lt;host&gt;/&lt;apiPrefix&gt;/&lt;API queries&gt; |
| `--defaultPort` | Specify the port the server is running on |
| `--shutdownTimeoutMinutes` | Server will shut down after this amount of minutes, 0 for off. |
| `--shutdownTimeoutVarianceMinutes` | Modifies the shutdown timer by +/- `timeoutVarianceMinutes` (to avoid multiple instances shutting at the same time) |
| `--idMap` | Map `id`s for a `type` to a file path. Example: `x-ray '../../data/mdb/xray/${id}-ccp4.mdb'` - JS expressions can be used inside `${}`, e.g. `${id.substr(1, 2)}/${id}.mdb` - Can be specified multiple times. - The `TYPE` variable (e.g. `x-ray`) is arbitrary and depends on how you plan to use the server. By default, Mol* Viewer uses `x-ray` and `em`, but any particular use case may vary. |
| `--maxRequestBlockCount` | Maximum number of blocks that could be read in 1 query. This is somewhat tied to the ``maxOutputSizeInVoxelCountByPrecisionLevel`` in that the `&lt;maximum number of voxel&gt; = maxRequestBlockCount * &lt;block size&gt;^3`. The default block size is 96 which corresponds to 28,311,552 voxels with 32 max blocks. |
| `--maxFractionalBoxVolume` | The maximum fractional volume of the query box (to prevent queries that are too big). |
| `--maxOutputSizeInVoxelCountByPrecisionLevel` | What is the (approximate) maximum desired size in voxel count by precision level - Rule of thumb: `&lt;response gzipped size&gt;` in `[&lt;voxel count&gt; / 8, &lt;voxel count&gt; / 4]`. The maximum number of voxels is tied to maxRequestBlockCount. |
```sh
node lib/commonjs/servers/volume/server [-h] [-v]
[--cfg CFG]
[--printCfg]
[--cfgTemplate]
[--apiPrefix PREFIX]
[--defaultPort PORT]
[--shutdownTimeoutMinutes TIME]
[--shutdownTimeoutVarianceMinutes VARIANCE]
[--idMap TYPE PATH]
[--maxRequestBlockCount COUNT]
[--maxFractionalBoxVolume VOLUME]
[--maxOutputSizeInVoxelCountByPrecisionLevel LEVEL [LEVEL ...]]
```

View File

@@ -1,10 +1,8 @@
Data Format
===========
# VolumeServer: Response Data Format
This document describes the CIF categories and fields generated by the server.
Query info
----------
## Query info
The reponse always contains a data block called ``SERVER`` with this format:
@@ -28,8 +26,7 @@ _density_server_result.query_box_b[1] 35.737
_density_server_result.query_box_b[2] 32.037001
```
Query data
----------
## Query data
If the query completed successfully with a non-empty result the response will contain one or more data blocks that correpond to the
"channels" present in the data (e.g. for x-ray data there will be ``2Fo-Fc`` and ``Fo-Fc``) channels.
@@ -41,6 +38,7 @@ data_2FO-FC
#
_volume_data_3d_info.name 2Fo-Fc
```
### Axis order
Axis order determines the order of axes of ``origin``, ``dimensions`` and ``sample_count`` fields. It also specifies

View File

@@ -0,0 +1,3 @@
# MolViewSpec
Please see the [standalone MolViewSpec documentation](https://molstar.org/mol-view-spec-docs/).

View File

@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Replace "latest" by the specific version you want to use, e.g. "4.0.0" -->
<script src="https://cdn.jsdelivr.net/npm/molstar@latest/build/viewer/molstar.js"></script>
<!-- Replace "latest" by the specific version you want to use, e.g. "4.0.0" -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/molstar@latest/build/viewer/molstar.css" />
</head>
<body>
<h1>Integration of Mol* with MolViewSpec Extension</h1>
<p>
This page demonstrates several methods to integrate Mol* Viewer in a web page and use MolViewSpec functionality.
See the source HTML to see the actual code.
</p>
<h2>Method 1: Get MVS view from a server and pass to the viewer</h2>
<p>
The recommended method is to serve the MVS view files by your server (either as static files or generated by the
server on-demand) and call the <code>loadMvsFromUrl</code> method to retrieve and load them.
This example uses a MVS view file from the address specified in the <code>sourceUrl</code> variable.
If the MVS view file contains relative references, they will be resolved as relative to <code>sourceUrl</code>.
</p>
<div id="viewer1" style="position: relative; width: 500px; height: 500px;"></div>
<script>
const sourceUrl = 'https://raw.githubusercontent.com/molstar/molstar/master/examples/mvs/1h9t_domain_labels.mvsj';
molstar.Viewer.create('viewer1', { layoutIsExpanded: false, layoutShowControls: false })
.then(viewer => viewer.loadMvsFromUrl(sourceUrl, 'mvsj'));
</script>
<p>
A variation of this method uses <code>molstar.PluginExtensions.mvs.loadMVS</code> instead of
<code>loadMvsFromUrl</code> and allows replacing the MVS view after it has been loaded.
</p>
<div id="viewer1b" style="position: relative; width: 500px; height: 500px;"></div>
<button onclick="loadView1();">View 1</button>
<button onclick="loadView2();">View 2</button>
<script>
let theViewer;
function load(viewer, url, replace) {
fetch(url)
.then(response => response.text())
.then(text => molstar.PluginExtensions.mvs.MVSData.fromMVSJ(text))
.then(mvsData => molstar.PluginExtensions.mvs.loadMVS(viewer.plugin, mvsData, { sourceUrl: url, sanityChecks: true, replaceExisting: replace }));
}
function loadView1() {
load(theViewer, 'https://raw.githubusercontent.com/molstar/molstar/master/examples/mvs/1cbs.mvsj', true);
}
function loadView2() {
load(theViewer, 'https://raw.githubusercontent.com/molstar/molstar/master/examples/mvs/1cbs-focus.mvsj', true);
}
molstar.Viewer.create('viewer1b', { layoutIsExpanded: false, layoutShowControls: false })
.then(viewer => {
theViewer = viewer;
loadView1();
});
</script>
<h2>Method 2: Construct MVS view on frontend and pass to the viewer</h2>
<p>
Another option is to utilize the MVS builder provided by the extension to build the view on frontend and then
pass it to the viewer. This example builds the view in plain JavaScript, directly in a &lt;script&gt; tag in
HTML. However, for a better developer experience consider writing the code in TypeScript.
If the built MVS view contains relative references, they will be resolved as relative to the URL of this HTML
page.
</p>
<div id="viewer2" style="position: relative; width: 500px; height: 500px;"></div>
<script>
// Build an ad-hoc MVS view
const builder = molstar.PluginExtensions.mvs.MVSData.createBuilder();
const structure = builder
.download({ url: 'https://www.ebi.ac.uk/pdbe/entry-files/1cbs.bcif' })
.parse({ format: 'bcif' })
.modelStructure({});
structure
.component({ selector: 'polymer' })
.representation({ type: 'cartoon' })
.color({ color: 'green' });
structure
.component({ selector: 'ligand' })
.label({ text: 'Retinoic acid' })
.focus({})
.representation({ type: 'ball_and_stick' })
.color({ color: '#cc3399' });
const mvsData = builder.getState();
// Initialize viewer and load MVSJ
const mvsj = molstar.PluginExtensions.mvs.MVSData.toMVSJ(mvsData);
molstar.Viewer.create('viewer2', { layoutIsExpanded: false, layoutShowControls: false })
.then(viewer => viewer.loadMvsData(mvsj, 'mvsj'));
// // Alternative initialization and loading (avoids encoding and again decoding the data, allows changing the view by using `replaceExisting: true`):
// molstar.Viewer.create('viewer2', { layoutIsExpanded: false, layoutShowControls: false })
// .then(viewer => molstar.PluginExtensions.mvs.loadMVS(viewer.plugin, mvsData, { sourceUrl: undefined, sanityChecks: true, replaceExisting: false }));
</script>
<p>
Again, there is variation with using <code>molstar.PluginExtensions.mvs.loadMVS</code> instead of
<code>loadMvsData</code>.
</p>
</body>
</html>

View File

@@ -0,0 +1,118 @@
# wwPDB StructConn extension
The STRUCT_CONN category in the mmCIF file format contains details about the connections between portions of the structure. These can be hydrogen bonds, salt bridges, disulfide bridges and so on (see more at <https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v40.dic/Categories/struct_conn.html>).
**wwPDB StructConn extension** in Mol* provides functionality to retrieve and visualize these connections.
The extension exposes three functions, located in `src/extensions/wwpdb/struct-conn/index.ts`.
- `getStructConns` - to retrieve struct_conn records from a loaded structure
- `inspectStructConn` - to visualize a struct_conn
- `clearStructConnInspections` - to remove visulizations created by `inspectStructConn`
## Example 1
The following example is a minimal HTML using this functionality:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<title>Mol* Viewer</title>
<link rel="stylesheet" type="text/css" href="molstar.css" />
</head>
<body style="margin: 0px;">
<div style="position: absolute; width: 100%; height: 10%; padding-block: 10px;">
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'disulf1');">disulf1</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'disulf2');">disulf2</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'covale1');">covale1</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'covale2');">covale2</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'covale3');">covale3</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'covale4');">covale4</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'metalc1');">metalc1</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'metalc2');">metalc2</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'metalc3');">metalc3</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, '5elb', 'metalc4');">metalc4</button>
<button onclick="molstar.PluginExtensions.wwPDBStructConn.clearStructConnInspections(molstarViewer.plugin, '5elb');">CLEAR</button>
</div>
<div id="app" style="position: absolute; top: 10%; width: 100%; height: 90%;"></div>
<script type="text/javascript" src="./molstar.js"></script>
<script type="text/javascript">
var molstarViewer;
molstar.Viewer.create('app', { layoutIsExpanded: false }).then(viewer => {
molstarViewer = viewer;
viewer.loadPdb('5elb');
});
</script>
</body>
</html>
```
The PDB ID (`'5elb'`) can be replaced be `undefined`, in which case the functions will apply to the first loaded structure.
## Example 2
This is a more elaborated example, which automatically loads `5elb` (or any PDB entry given in the URL after `?pdb=`), retrieves the list of struct_conns, and creates a button for each struct_conn.
Be aware that some of the struct_conns may be present in the deposited model but not in the preferred assembly (default view). The presented example will raise a dialog window with error message in such cases, e.g. `disulf6` in entry `5elb`.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<title>Mol* Viewer - StructConn Extension Demo</title>
<link rel="stylesheet" type="text/css" href="molstar.css" />
</head>
<style>
body { margin: 0px; }
#app { position: absolute; width: 85%; height: 100%; }
#controls { position: absolute; right: 0; width: 15%; height: 100%; display: flex; flex-direction: column; overflow-y: scroll; }
h1 { text-align: center; margin: 12px; font-weight: bold; font-size: 120%; }
button { margin: 4px; margin-top: 0px; }
</style>
<body>
<div id="app"></div>
<div id="controls">
<h1 id="pdb-id">Loading...</h1>
<button onclick="clearInspections();">CLEAR</button>
</div>
<script type="text/javascript" src="./molstar.js"></script>
<script type="text/javascript">
var pdbId = window.location.search.match(/[?&]pdb=(\w+)/i)?.[1]?.toLowerCase() ?? '5elb';
var molstarViewer;
function inspect(structConnId) {
if (molstarViewer?.plugin) {
molstar.PluginExtensions.wwPDBStructConn.inspectStructConn(molstarViewer.plugin, pdbId, structConnId).then(nSelectedAtoms => {
if (nSelectedAtoms < 2) alert('Some of the interacting atoms were not found :(\n(maybe not present in the viewed assembly)');
});
}
}
function clearInspections() {
if (molstarViewer?.plugin) {
molstar.PluginExtensions.wwPDBStructConn.clearStructConnInspections(molstarViewer.plugin, pdbId);
}
}
molstar.Viewer.create('app', { layoutIsExpanded: false }).then(viewer => {
molstarViewer = viewer;
return viewer.loadPdb(pdbId);
}).then(() => {
const structConns = molstar.PluginExtensions.wwPDBStructConn.getStructConns(molstarViewer.plugin, pdbId);
const controls = document.getElementById('controls');
for (const structConnId in structConns) {
const button = document.createElement('button');
button.innerText = structConnId;
button.addEventListener('click', () => inspect(structConnId));
controls.appendChild(button);
};
document.getElementById('pdb-id').innerHTML = pdbId;
});
</script>
</body>
</html>
```

43
docs/docs/index.md Normal file
View File

@@ -0,0 +1,43 @@
# Installation
## NPM Package
```
yarn add molstar
```
or
```
npm install molstar
```
Mol* code can then be imported from the ``molstar/lib/...`` namespace, e.g.
```ts
import { PluginContext } from 'molstar/lib/mol-plugin/context';
```
## Clone from GitHub
```
git clone https://github.com/molstar/molstar.git
cd molstar
npm install
npm build
```
--------------------
For a watch task to automatically rebuild the source code on changes, run
```
npm run watch
```
or if working just with the Viewer app for better performance
```
npm run watch-viewer
```

View File

@@ -1,3 +1,5 @@
# Interesting PDB Entries
* Cyclic polymers (1sfi, 6dny, 1HVZ)
* B-DNA (1bna)
* Missing carbonyl oxygen (1gfl)
@@ -13,6 +15,7 @@
* DZ has C1 instead of N1 (e.g. 6I4N)
* DP has N5 instead of C5 and C7 instead of N7 (e.g. 6I4N)
* Beta & Gamma peptides (e.g. 1GAC, 6PQF)
* Helices of D-amino acids (e.g. 7QDI)
* Mixed (heterogeneous) all-atom/trace-only RNA model (1JGQ)
* Polymers with residues with missing trace atoms (e.g. 2QFJ)
* Modified RNA bases (1y26, 5L4O)
@@ -25,11 +28,24 @@
* Non-standard residues
* Protein (1BRR, 5Z6Y)
* DNA (5D3G)
* Collagen (6JEC)
* Multiple models with different sets of ligands or missing ligands (1J6T, 1VRC, 2ICY, 1O2F)
* Long linear sugar chain (4HG6)
* Anisotropic B-factors/Ellipsoids (1EJG)
* NOS bridges (LYS-CSO in 7B0L, 6ZWJ, 6ZWH)
Assembly symmetries
* 5M30 (Assembly 1, C3 local and pseudo)
* 1RB8 (Assembly 1, I global)
* Non-polymer components in polymer entities
* PN2 in 1F80
* ACE (many, e.g. 5AGU, 1E1X)
* ACY in 7ABY
* NH2 (many, e.g. 6Y13)
* Ligands with many rings
* STU (e.g. 1U59) - many fused rings
* HT (e.g. 127D) - rings connected by a single bond
* J2C (e.g. 7EFJ) - rings connected by a single atom
* RBF (e.g. 7QF2) - three linearly fused rings
* TA1 (e.g. 1JFF) - many fused rings (incl. a 8-member rings)
* BPA (e.g. 1JDG) - many fused rings
* CLR (e.g. 3GKI) - four fused rings
* Assembly symmetries
* 5M30 (Assembly 1, C3 local and pseudo)
* 1RB8 (Assembly 1, I global)

View File

@@ -23,7 +23,7 @@ interface Snapshot {
When defining the state object, all components are optional, i.e., it is possible to define just the ``data`` component.
Example state is available [here](example-state.json). In the plugin, it is possible to create and load these objects using ``Download JSON``
Example state is available [here](./example-state.json). In the plugin, it is possible to create and load these objects using ``Download JSON``
and ``Open JSON`` buttons in the ``State Snapshots`` section.
# State Tree
@@ -69,7 +69,7 @@ interface Transform.Props {
}
```
"Built-in" data state transforms and description of their parameters are defined in ``mol-plugin/state/transforms``. Behavior transforms are defined in ``mol-plugin/behavior``. Auto-generated documentation for the transforms is also [available](transforms.md).
"Built-in" data state transforms and description of their parameters are defined in ``mol-plugin/state/transforms``. Behavior transforms are defined in ``mol-plugin/behavior``.
# Animation State

View File

@@ -0,0 +1,3 @@
# Plugin Examples
Refer to Mol* [Apps](https://github.com/molstar/molstar/tree/master/src/apps) and [Examples](https://github.com/molstar/molstar/tree/master/src/examples).

View File

@@ -0,0 +1,44 @@
Support file formats and their extensions.
## Structure
- MMCIF and CIFCORE (mmCIF and coreCIF schemas): cif, bcif, mmcif, mcif
- GRO: gro
- MOL: mol
- MOL2: mol2
- PDB/PDBQT: pdb, ent, pdbqt
- SDF: sdf, sd
- XYZ: xyz
## Topology
Need to be loaded together with Coordinates.
- PRMTOP: prmtop, parm7
- PSF: psf
- TOP: top
## Coordinates
Need to be loaded together with a Structure or Topology.
- DCD: dcd
- NCTRAJ: nc, nctraj
- TRR: trr
- XTC: xtc
## Volume
- CCP4/MRC/MAP: ccp4, mrc, map
- CUBE (may include a Structure): cub, cube
- DSN6/BRIX: dsn6, brix
- DX and DXBIN: dx, dxbin
- DSCIF (DensityServer CIF schema): cif, bcif
## Shape
- PLY

View File

@@ -0,0 +1,274 @@
# Creating Plugin Instance
## Intro
What is a plugin? A plugin is a collection of modules that provide functionality to the `Mol*` UI. The plugin is responsible for managing the state of the viewer, internal and user interactions. It has been a previous point of confusion for new users of `Mol*` to associate the __viewer__ part of the library with what is further referred to as the __plugin__. These two are closely connected in the `molstar-plugin-ui` module, which is the user-facing part of the library and ultimately provides the viewer, but they are ultimately distinct.
It is recommended that you inspect the general class structure of [`PluginInitWrapper`](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin-ui/plugin.tsx#L41), [`PluginUIContext`](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin/context.ts#L71) and [`PluginUIComponent`](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin-ui/base.tsx#L16) to better understand the flow of data and events in the plugin.
A passing analogy is that a [ `PluginContext` ](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin/context.ts#L71) is the engine that powers computation, rendering, events and subscriptions inside the molstar UI. All UI components depend on `PluginContext`.
There are 4 basic ways of instantiating the Mol* plugin.
## ``Viewer`` wrapper
- The most basic usage is to use the ``Viewer`` wrapper. This is best suited for use cases that do not require much custom behavior and are mostly about just displaying a structure.
- See ``Viewer`` class is defined in [src/apps/viewer/app.ts](https://github.com/molstar/molstar/blob/master/src/apps/viewer/app.ts) for available methods and options.
Example usage without using WebPack:
```HTML
<style>
#app {
position: absolute;
left: 100px;
top: 100px;
width: 800px;
height: 600px;
}
</style>
<!--
molstar.js and .css are obtained from
- the folder build/viewer after cloning and building the molstar package
- from the build/viewer folder in the Mol* NPM package
-->
<link rel="stylesheet" type="text/css" href="molstar.css" />
<script type="text/javascript" src="./molstar.js"></script>
<div id="app"></div>
<script type="text/javascript">
molstar.Viewer.create('app', {
layoutIsExpanded: false,
layoutShowControls: false,
layoutShowRemoteState: false,
layoutShowSequence: true,
layoutShowLog: false,
layoutShowLeftPanel: true,
viewportShowExpand: true,
viewportShowSelectionMode: false,
viewportShowAnimation: false,
pdbProvider: 'rcsb',
emdbProvider: 'rcsb',
}).then(viewer => {
viewer.loadPdb('7bv2');
viewer.loadEmdb('EMD-30210', { detail: 6 });
});
</script>
```
When using WebPack (or possibly other build tool) with the Mol* NPM package installed, the viewer class can be imported using
```ts
import { Viewer } from 'molstar/build/viewer/molstar'
function initViewer(target: string | HTMLElement) {
return new Viewer(target, { /* options */})
}
```
## ``PluginContext`` with built-in React UI
- For more customization options it is possible to use the [``PluginContext``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/context.ts) directly.
- When creating the plugin instance it is possible to customize the [``PluginSpec``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/spec.ts).
- The default [``PluginSpec``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/spec.ts) is available [here](https://github.com/molstar/molstar/blob/master/src/mol-plugin/spec.ts).
- [``PluginConfig``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/config.ts) object provides additional customization options.
- See the [Viewer State Management](viewer-state.md) section for more information on customizing things like background.
- See the [Data State Management](data-state.md) section for more information on build the state.
```ts
import { DefaultPluginUISpec, PluginUISpec } from 'molstar/lib/mol-plugin-ui/spec';
import { createPluginUI } from 'molstar/lib/mol-plugin-ui';
import { renderReact18 } from 'molstar/lib/mol-plugin-ui/react18';
import { PluginConfig } from 'molstar/lib/mol-plugin/config';
const MySpec: PluginUISpec = {
...DefaultPluginUISpec(),
config: [
[PluginConfig.VolumeStreaming.Enabled, false]
]
}
async function createPlugin(parent: HTMLElement) {
const plugin = await createPluginUI({
target: parent,
spec: MySpec,
render: renderReact18
});
const data = await plugin.builders.data.download({ url: '...' }, { state: { isGhost: true } });
const trajectory = await plugin.builders.structure.parseTrajectory(data, format);
await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
return plugin;
}
createPlugin(document.getElementById('app')!); // app is a <div> element with position: relative
```
To use the plugin (with the React UI) inside another React app:
A single-plugin setup is shown the example below. In order to initialize multiple
plugins, each with its own context and viewport, some extra steps are required (docs section to be added).
```ts
import { useEffect, createRef } from "react";
import { createPluginUI } from "molstar/lib/mol-plugin-ui";
import { renderReact18 } from "molstar/lib/mol-plugin-ui/react18";
import { PluginUIContext } from "molstar/lib/mol-plugin-ui/context";
/* Might require extra configuration,
see https://webpack.js.org/loaders/sass-loader/ for example.
create-react-app should support this natively. */
import "molstar/lib/mol-plugin-ui/skin/light.scss";
declare global {
interface Window {
molstar?: PluginUIContext;
}
}
export function MolStarWrapper() {
const parent = createRef<HTMLDivElement>();
// In debug mode of react's strict mode, this code will
// be called twice in a row, which might result in unexpected behavior.
useEffect(() => {
async function init() {
window.molstar = await createPluginUI({
target: parent.current as HTMLDivElement,
render: renderReact18
});
const data = await window.molstar.builders.data.download(
{ url: "https://files.rcsb.org/download/3PTB.pdb" }, /* replace with your URL */
{ state: { isGhost: true } }
);
const trajectory =
await window.molstar.builders.structure.parseTrajectory(data, "pdb");
await window.molstar.builders.structure.hierarchy.applyPreset(
trajectory,
"default"
);
}
init();
return () => {
window.molstar?.dispose();
window.molstar = undefined;
};
}, []);
return <div ref={parent} style={{ width: 640, height: 480 }}/>;
}
```
Furthermore, if it is desirable in your project to use the `molstar`'s React UI components, but you wish to alter or rearrange the layout, you should take a look at the signatures of [ `PluginUIComponent` ](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin-ui/base.tsx#L16) which every "control" subclasses.
[ `SequenceView` ](https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin-ui/sequence.tsx#L221C4-L221C4), for example, can be used separately from the `PluginUI`. Yet you would need to pass the `PluginUIContext` to it in order for it to observe the changes in the state of the plugin. This can be done via a `PluginContextContainer`:
```typescript
// your_app.plugin: PluginUIContext
...
<div className="your_custom_ui">
<PluginContextContainer plugin={your_app.plugin}>
<SequenceView />
</PluginContextContainer>
</div>
```
## Directly using Mol* React UI
```ts
class MolStarWrapper {
private resolveInit: () => void;
initialized = new Promise<boolean>(res => { this.resolveInit = () => res(true); });
private initCalled = false;
plugin: PluginUIContext;
async init() {
if (this.initCalled) return;
this.initCalled = true;
this.plugin = ...;
await this.plugin.init();
this.resolveInit();
}
}
function MolStar({ model }: { model: MolStarWrapper }) {
const [initialized, setInitialized] = useState(false);
useEffect(() => {
async function init() {
await model.init();
setInitialized(true);
}
init();
}, [model]);
if (!initialized) return <>Loading</>;
return <div style={{ ..., position: 'relative' }}>
<Plugin plugin={model.plugin} />
</div>;
}
```
## ``PluginContext`` without built-in React UI
- The [``PluginContext``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/context.ts) can be instantiated without using the default React UI.
```HTML
<div id='molstar-parent' style='position: absolute; top: 0; left: 0; right: 0; bottom: 0'>
<canvas id='molstar-canvas' style='position: absolute; top: 0; left: 0; right: 0; bottom: 0'></canvas>
</div>
```
```ts
import { DefaultPluginSpec, PluginSpec } from 'molstar/lib/mol-plugin/spec';
import { PluginContext } from 'molstar/lib/mol-plugin/context';
import { PluginConfig } from 'molstar/lib/mol-plugin/config';
const MySpec: PluginSpec = {
...DefaultPluginSpec(),
config: [
[PluginConfig.VolumeStreaming.Enabled, false]
]
}
async function init() {
const plugin = new PluginContext(MySpec);
await plugin.init();
const canvas = <HTMLCanvasElement> document.getElementById('molstar-canvas');
const parent = <HTMLDivElement> document.getElementById('molstar-parent');
if (!plugin.initViewer(canvas, parent)) {
console.error('Failed to init Mol*');
return;
}
// Example url:"https://files.rcsb.org/download/3j7z.pdb"
// Example url:"https://files.rcsb.org/download/5AFI.cif"
const data = await plugin.builders.data.download({ url: '...' }, { state: { isGhost: true } });
const trajectory = await plugin.builders.structure.parseTrajectory(data, format); //format is 'mmcif' or 'pdb' etc.
await plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
}
```
## ``Canvas3D`` without built-in state management
- The ``PluginContext`` object from the above examples can be completely omitted.
- See [Browser Tests](https://github.com/molstar/molstar/tree/master/src/tests/browser) for example usage.
```ts
const canvas = document.getElementById('canvas'); // parent <canvas> element
const canvas3d = Canvas3D.create(Canvas3DContext.fromCanvas(canvas));
canvas3d.animate();
// use the canvas3d object here
```

View File

@@ -0,0 +1,110 @@
# Selections
Assuming you have a model already loaded into the plugin (see [Creating Plugin Instance](./instance.md)), these are some of the following method you can select structural data.
### Selecting directly from the `hierarchy` manager
One can select a subcomponent's data directly from the plugin manager.
```typescript
import { Structure } from '../mol-model/structure';
const ligandData = plugin.managers.structure.hierarchy.selection.structures[0]?.components[0]?.cell.obj?.data;
const ligandLoci = Structure.toStructureElementLoci(ligandData as any);
plugin.managers.camera.focusLoci(ligandLoci);
plugin.managers.interactivity.lociSelects.select({ loci: ligandLoci });
```
## Selection callbacks
If you want to subscribe to selection events (e.g. to change external state in your application based on a user selection), you can use: `plugin.behaviors.interaction.click.subscribe`
Here's an example of passing in a React "set" function to update selected residue positions.
```typescript
import {
Structure,
StructureProperties,
} from "molstar/lib/mol-model/structure"
// setSelected is assumed to be a "set" function returned by useState
// (selected: any[]) => void
plugin.behaviors.interaction.click.subscribe(
(event: InteractivityManager.ClickEvent) => {
const selections = Array.from(
plugin.managers.structure.selection.entries.values()
);
// This bit can be customized to record any piece information you want
const localSelected: any[] = [];
for (const { structure } of selections) {
if (!structure) continue;
Structure.eachAtomicHierarchyElement(structure, {
residue: (loc) => {
const position = StructureProperties.residue.label_seq_id(loc);
localSelected.push({ position });
},
});
}
setSelected(localSelected);
}
)
```
### `Molscript` language
Molscript is a language for addressing crystallographic structures and is a part of the Mol* library found at `https://github.com/molstar/molstar/tree/master/src/mol-script`. It can be used against the Molstar plugin as a query language and transpiled against multiple external molecular visualization libraries(see [here](https://github.com/molstar/molstar/tree/master/src/mol-script/transpilers)).
### Querying a structure for a specific chain and residue range (select residues with 12<res_id<200 of chain with auth_asym_id==A) :
```typescript
import { compileIdListSelection } from 'molstar/lib/mol-script/util/id-list'
const query = compileIdListSelection('A 12-200', 'auth');
window.molstar?.managers.structure.selection.fromCompiledQuery('add',query);
```
## Selection Queries
Another way to create a selection is via a `SelectionQuery` object. This is a more programmatic way to create a selection. The following example shows how to select a chain and a residue range using a `SelectionQuery` object.
This relies on the concept of `Expression` which is basically a intermediate representation between a Molscript statement and a selection query.
### Select residues 10-15 of chains A and F in a structure using a `SelectionQuery` object:
```typescript
import { MolScriptBuilder as MS, MolScriptBuilder } from 'molstar/lib/mol-script/language/builder';
import { Expression } from 'molstar/lib/mol-script/language/expression';
import { StructureSelectionQuery } from 'molstar/lib/mol-plugin-state/helpers/structure-selection-query'
export function select_multiple() {
const args = [['A', 10, 15], ['F', 10, 15]]
const groups: Expression[] = [];
for (var chain of args) {
groups.push(MS.struct.generator.atomGroups({
"chain-test": MS.core.rel.eq([MolScriptBuilder.struct.atomProperty.macromolecular.auth_asym_id(), chain[0]]),
"residue-test": MS.core.rel.inRange([MolScriptBuilder.struct.atomProperty.macromolecular.label_seq_id(), chain[1], chain[2]])
}));
}
var sq = StructureSelectionQuery('residue_range_10_15_in_A_and_F', MS.struct.combinator.merge(groups))
mstar.managers.structure.selection.fromSelectionQuery('set', sq)
}
```
Complex queries can be constructed by combining primitive queries at the level of [`chain-test`, `residue-test`, `entity-test`, etc] (https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-script/language/symbol-table/structure-query.ts#L88C4-L94C112) by combining them via logical connectives provided in the `MolscriptBuilder.core.rel` as above.
Inspect these examples to get a better feeling for this syntax: `https://github.com/molstar/molstar/blob/6edbae80db340134341631f669eec86543a0f1a8/src/mol-plugin-state/helpers/structure-selection-query.ts#L88-L580`
Furthermore, a query made this way can be converted to a `Loci` object which is important in many parts of the libary:
```typescript
// Select residue 124 of chain A and convert to Loci
const Q = MolScriptBuilder;
var sel = Script.getStructureSelection(Q => Q.struct.generator.atomGroups({
'chain-test' : Q.core.rel.eq([Q.struct.atomProperty.macromolecular.auth_asym_id(), A]),
"residue-test": Q.core.rel.eq([Q.struct.atomProperty.macromolecular.label_seq_id(), 124]),
}), objdata)
let loci = StructureSelection.toLociWithSourceUnits(sel);
```

View File

@@ -0,0 +1,72 @@
# Load Trajectory from a Custom Format
This section shows a high level example for loading trajectory from custom data in specialized plugin instances. A more complete solution is available for example in form of the [G3D format extension](https://github.com/molstar/molstar/tree/master/src/extensions/g3d).
## Defining and Using a Custom Transformer
```ts
import { StateTransformer } from 'molstar/lib/mol-state';
const CreateTransformer = StateTransformer.builderFactory('custom-namespace');
export interface CustomTrajectoryData {
// ...
}
export const TrajectoryFromCustomData = CreateTransformer({
name: 'trajectory-from-custom-data',
display: 'Trajectory',
from: PluginStateObject.Root,
to: PluginStateObject.Molecule.Trajectory,
params: {
data: PD.Value<CustomTrajectoryData>(void 0 as any, { isHidden: true }),
},
})({
apply({ params }) {
return Task.create('Trajectory', async (ctx) => {
const models = await customParse(params.data, ctx);
return new PluginStateObject.Molecule.Trajectory(models, {
label: 'Trajectory',
});
});
},
});
```
The ``customParse`` function can usually be implemented
by modifying/extending an [existing parser already available in Mol*](https://github.com/molstar/molstar/tree/master/src/mol-model-formats/structure).
To use the transformer:
```ts
const data: CustomTrajectoryData = await (await fetch(url)).json();
const trajectory = await plugin.build().toRoot().apply(TrajectoryFromCustomData, { data }).commit();
// Create the representation
await plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
```
## Using Mol* to Download the Data
```ts
export const TrajectoryFromCustomData = CreateTransformer({
name: 'trajectory-from-custom-data',
display: 'Trajectory',
from: PluginStateObject.Data.String, // or PluginStateObject.Data.Binary
to: PluginStateObject.Molecule.Trajectory,
})({
apply({ a }) {
return Task.create('Trajectory', async (ctx) => {
const models = await customParse(a.data, ctx);
return new PluginStateObject.Molecule.Trajectory(models, {
label: 'Trajectory',
});
});
},
});
//////////////
const data = await plugin.builders.data.download({ url, isBinary });
const trajectory = await plugin.build().to(data).apply(TrajectoryFromCustomData, { data }).commit();
await plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
```

View File

@@ -0,0 +1,132 @@
# Viewer State Management
## ``Canvas3D`` Properties
Properties of the [``Canvas3D``](https://github.com/molstar/molstar/blob/master/src/mol-canvas3d/canvas3d.ts) can be
changed using [``PluginCommands``](https://github.com/molstar/molstar/blob/master/src/mol-plugin/commands.ts).
### Change background, highlight, or select color
```ts
import { ColorNames } from 'molstar/lib/mol-util/color/names';
import { PluginCommands } from 'molstar/lib/mol-plugin/commands';
const renderer = plugin.canvas3d!.props.renderer;
PluginCommands.Canvas3D.SetSettings(plugin, { settings: { renderer: { ...renderer, backgroundColor: ColorNames.red /* or: 0xff0000 as Color */ } } });
```
Similarly, `highlightColor` and `selectColor` can be updated.
## Interactivity
Interactivity in Mol* is based on the concept of ``Loci``. A ``Loci`` usually references a collection of objects and can be created by a [``Selection``](selections.md). For example, the
``Loci`` captures all atoms in the chain with label_asym_id B of a protein:
```ts
import { Script } from 'molstar/lib/mol-script/script';
import { StructureSelection } from 'molstar/lib/mol-model/structure/query';
const data = plugin.managers.structure.hierarchy.current.structures[0]?.cell.obj?.data;
if (!data) return;
const selection = Script.getStructureSelection(Q => Q.struct.generator.atomGroups({
'chain-test': Q.core.rel.eq(['B', Q.ammp('label_asym_id')])
}), data);
const loci = StructureSelection.toLociWithSourceUnits(selection);
```
A ``Loci`` can be used to trigger custom [``Behaviors``](#behaviors).
### Log message to Mol* console
The built-in console in the bottom center of the plugin shows log entries.
```ts
plugin.log.message('This message will appear in the Mol* console');
```
Other log levels are: `info`, `warn`, and `error`.
### Show toast message
Toast messages will appear in the bottom right of the plugin and will linger for a limited time before disappearing.
```ts
import { PluginCommands } from 'molstar/lib/mol-plugin/commands';
PluginCommands.Toast.Show(plugin, {
title: 'Custom Message',
message: 'A custom toast message that will disappear after 2 seconds.',
key: 'toast-custom',
timeoutMs: 2000
});
```
## Behaviors
The state of the Mol* plugin is usually governed by dynamic behaviors which can be set up in initial plugin specification or updated during the plugin runtime. This allows for high modularity and customizability of individual plugin instances.
### Highlight ``Loci``
Highlighting adds a transient overpaint to a representation that will linger until the mouse enters hovers over another
object. Highlights can be applied to a previously defined ``Loci`` by:
```ts
plugin.managers.interactivity.lociHighlights.highlightOnly({ loci }); // loci: Loci
```
Reset all highlights by:
```ts
plugin.managers.interactivity.clearHighlights();
```
### Select ``Loci``
Selected elements will appear with distinct visuals and, if applicable, the corresponding sequence positions will be
shown in the Sequence Viewer panel. Selections persist until removed, for example by clicking the background. A ``Loci``
is selected by:
```ts
plugin.managers.interactivity.lociSelects.select({ loci }); // loci: Loci
```
Deselect a specific ``Loci`` by:
```ts
plugin.managers.interactivity.lociSelects.deselect({ loci }); // loci: Loci
```
To deselect everything:
```ts
plugin.managers.interactivity.lociSelects.deselectAll();
```
### Focus ``Loci``
The focus representation shows a ``Loci`` in ball-and-stick representation and, additionally, visualizes non-covalent
interactions between atoms of the ``Loci`` as well as interactions with surrounding residues (default: 5 Å).
```ts
plugin.managers.structure.focus.setFromLoci(loci);
```
Extend an existing focus representation by:
```ts
plugin.managers.structure.focus.addFromLoci(loci); // loci: Loci
```
Reset by:
```ts
plugin.managers.structure.focus.clear();
```
### Zoom ``Loci``
A ``Loci`` can also be used to manipulate the camera. Zoom in by:
```ts
plugin.managers.camera.focusLoci(loci); // loci: Loci
```
Restore the default camera position by:
```ts
plugin.managers.camera.reset();
```
### Turn off view resetting on new representations
A new representation via something like
```ts
.apply(StateTransforms.Representation.VolumeRepresentation3D, ...)
```
can reset the view to make the whole representation visible.
When one wants to keep the view the same instead of having the rep reset the view,
keep the view constant by:
```ts
plugin.canvas3d?.setProps({ camera: { manualReset: true } });
```

58
docs/mkdocs.yml Normal file
View File

@@ -0,0 +1,58 @@
site_name: Mol* Developer Documentation
theme:
name: material
# 404 page
static_templates:
- 404.html
# Necessary for search to work properly
include_search_page: false
search_index_only: true
# Default values, taken from mkdocs_theme.yml
language: en
font:
text: Roboto
code: Roboto Mono
favicon: assets/favicon.png
icon:
logo: logo
markdown_extensions:
- pymdownx.highlight
- pymdownx.superfences
- pymdownx.arithmatex:
generic: true
# Scripts for rendering Latex equations (in addition to pymdownx.arithmatex):
extra_javascript:
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
nav:
- 'index.md'
- Plugin:
- Creating Instance: 'plugin/instance.md'
- Examples: plugin/examples.md
- Selections: 'plugin/selections.md'
- Viewer State: 'plugin/viewer-state.md'
- Data State: 'plugin/data-state.md'
- File Formats: 'plugin/file-formats.md'
- CIF Schemas: 'plugin/cif-schemas.md'
- State Transforms:
- Custom Trajectory: 'plugin/transforms/custom-trajectory.md'
- Data Access Tools:
- 'data-access-tools/model-server.md'
- Volume Server:
- Overview: 'data-access-tools/volume-server/index.md'
- Examples: 'data-access-tools/volume-server/examples.md'
- How it Works: 'data-access-tools/volume-server/how-it-works.md'
- Data Format: 'data-access-tools/volume-server/response-data-format.md'
- 'data-access-tools/plugin-state-server.md'
- 'data-access-tools/convert-to-bcif.md'
- 'data-access-tools/create-ccd-table.md'
- 'data-access-tools/extract-ccd-ions.md'
- Extensions:
- MolViewSpec: 'extensions/mvs/index.md'
- wwPDB StructConn: 'extensions/struct-conn.md'
- Misc:
- Interesting PDB entries: misc/interesting-pdb-entries.md
repo_url: https://github.com/molstar/docs

View File

@@ -1,69 +0,0 @@
Model Server
============
Model Server is a tool for preprocessing and querying macromolecular structure data.
Installing and Running
=====================
Requires nodejs 8+.
## From GitHub
```
git clone https://github.com/molstar/molstar
npm install
```
Afterwards, build the project source:
```
npm run build-tsc
```
and run the server by
```
node lib/commonjs/servers/model/server/server
```
## From NPM
```
npm install --production molstar
./model-server
```
(or ``node node_modules\.bin\model-server`` in Windows).
The NPM package contains all the tools mentioned here as "binaries":
- ``model-server``
- ``model-server-query``
- ``model-server-preprocess``
### Production use
In production it is required to use a service that will keep the server running, such as [forever.js](https://github.com/foreverjs/forever).
### Memory issues
Sometimes nodejs might run into problems with memory. This is usually resolved by adding the ``--max-old-space-size=8192`` parameter.
## Preprocessor
The preprocessor application allows to add custom data to CIF files and/or convert CIF to BinaryCIF. ``node lib/commonjs/servers/model/preprocess`` or ``model-server-preprocess`` binary from the NPM package.
## Local Mode
The server can be run in local/file based mode using ``node lib/commonjs/servers/model/query`` (``model-server-query`` binary from the NPM package).
Custom Properties
=================
This feature is still in development.
It is possible to provide property descriptors that transform data to internal representation and define how it should be exported into one or mode CIF categories. Examples of this are located in the ``mol-model-props`` module and are linked to the server in the config and ``servers/model/properties``.

View File

@@ -1,738 +0,0 @@
# Mol* Plugin State Transformer Reference
* [build-in.root](#build-in-root)
* [ms-plugin.download](#ms-plugin-download)
* [ms-plugin.read-file](#ms-plugin-read-file)
* [ms-plugin.parse-cif](#ms-plugin-parse-cif)
* [ms-plugin.parse-ccp4](#ms-plugin-parse-ccp4)
* [ms-plugin.parse-dsn6](#ms-plugin-parse-dsn6)
* [ms-plugin.trajectory-from-mmcif](#ms-plugin-trajectory-from-mmcif)
* [ms-plugin.trajectory-from-pdb](#ms-plugin-trajectory-from-pdb)
* [ms-plugin.model-from-trajectory](#ms-plugin-model-from-trajectory)
* [ms-plugin.structure-from-model](#ms-plugin-structure-from-model)
* [ms-plugin.structure-assembly-from-model](#ms-plugin-structure-assembly-from-model)
* [ms-plugin.structure-symmetry-from-model](#ms-plugin-structure-symmetry-from-model)
* [ms-plugin.structure-selection](#ms-plugin-structure-selection)
* [ms-plugin.structure-complex-element](#ms-plugin-structure-complex-element)
* [ms-plugin.custom-model-properties](#ms-plugin-custom-model-properties)
* [ms-plugin.volume-from-ccp4](#ms-plugin-volume-from-ccp4)
* [ms-plugin.volume-from-dsn6](#ms-plugin-volume-from-dsn6)
* [ms-plugin.representation-highlight-loci](#ms-plugin-representation-highlight-loci)
* [ms-plugin.representation-select-loci](#ms-plugin-representation-select-loci)
* [ms-plugin.default-loci-label-provider](#ms-plugin-default-loci-label-provider)
* [ms-plugin.structure-representation-3d](#ms-plugin-structure-representation-3d)
* [ms-plugin.explode-structure-representation-3d](#ms-plugin-explode-structure-representation-3d)
* [ms-plugin.volume-representation-3d](#ms-plugin-volume-representation-3d)
* [ms-plugin.focus-loci-on-select](#ms-plugin-focus-loci-on-select)
* [ms-plugin.pdbe-structure-quality-report-prop](#ms-plugin-pdbe-structure-quality-report-prop)
* [ms-plugin.rcsb-assembly-symmetry-prop](#ms-plugin-rcsb-assembly-symmetry-prop)
* [ms-plugin.structure-animation](#ms-plugin-structure-animation)
* [ms-plugin.scene-labels](#ms-plugin-scene-labels)
----------------------------
## <a name="build-in-root"></a>build-in.root :: () -> ()
*For internal use.*
----------------------------
## <a name="ms-plugin-download"></a>ms-plugin.download :: Root -> String | Binary
*Download string or binary data from the specified URL*
### Parameters
- **url**: String *(Resource URL. Must be the same domain or support CORS.)*
- **label**?: String
- **isBinary**?: true/false *(If true, download data as binary (string otherwise))*
### Default Parameters
```js
{
"url": "https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif"
}
```
----------------------------
## <a name="ms-plugin-read-file"></a>ms-plugin.read-file :: Root -> String | Binary
*Read string or binary data from the specified file*
### Parameters
- **file**: JavaScript File Handle
- **label**?: String
- **isBinary**?: true/false *(If true, open file as as binary (string otherwise))*
### Default Parameters
```js
{}
```
----------------------------
## <a name="ms-plugin-parse-cif"></a>ms-plugin.parse-cif :: String | Binary -> Cif
*Parse CIF from String or Binary data*
----------------------------
## <a name="ms-plugin-parse-ccp4"></a>ms-plugin.parse-ccp4 :: Binary -> Ccp4
*Parse CCP4/MRC/MAP from Binary data*
----------------------------
## <a name="ms-plugin-parse-dsn6"></a>ms-plugin.parse-dsn6 :: Binary -> Dsn6
*Parse CCP4/BRIX from Binary data*
----------------------------
## <a name="ms-plugin-trajectory-from-mmcif"></a>ms-plugin.trajectory-from-mmcif :: Cif -> Trajectory
*Identify and create all separate models in the specified CIF data block*
### Parameters
- **blockHeader**?: String *(Header of the block to parse. If none is specifed, the 1st data block in the file is used.)*
### Default Parameters
```js
{}
```
----------------------------
## <a name="ms-plugin-trajectory-from-pdb"></a>ms-plugin.trajectory-from-pdb :: String -> Trajectory
----------------------------
## <a name="ms-plugin-model-from-trajectory"></a>ms-plugin.model-from-trajectory :: Trajectory -> Model
*Create a molecular structure from the specified model.*
### Parameters
- **modelIndex**: Numeric value *(Zero-based index of the model)*
### Default Parameters
```js
{
"modelIndex": 0
}
```
----------------------------
## <a name="ms-plugin-structure-from-model"></a>ms-plugin.structure-from-model :: Model -> Structure
*Create a molecular structure from the specified model.*
----------------------------
## <a name="ms-plugin-structure-assembly-from-model"></a>ms-plugin.structure-assembly-from-model :: Model -> Structure
*Create a molecular structure assembly.*
### Parameters
- **id**?: String *(Assembly Id. Value 'deposited' can be used to specify deposited asymmetric unit.)*
### Default Parameters
```js
{}
```
----------------------------
## <a name="ms-plugin-structure-symmetry-from-model"></a>ms-plugin.structure-symmetry-from-model :: Model -> Structure
*Create a molecular structure symmetry.*
### Parameters
- **ijkMin**: 3D vector [x, y, z]
- **ijkMax**: 3D vector [x, y, z]
### Default Parameters
```js
{
"ijkMin": [
-1,
-1,
-1
],
"ijkMax": [
1,
1,
1
]
}
```
----------------------------
## <a name="ms-plugin-structure-selection"></a>ms-plugin.structure-selection :: Structure -> Structure
*Create a molecular structure from the specified query expression.*
### Parameters
- **query**: Value
- **label**?: String
### Default Parameters
```js
{}
```
----------------------------
## <a name="ms-plugin-structure-complex-element"></a>ms-plugin.structure-complex-element :: Structure -> Structure
*Create a molecular structure from the specified model.*
### Parameters
- **type**: One of 'atomic-sequence', 'water', 'atomic-het', 'spheres'
### Default Parameters
```js
{
"type": "atomic-sequence"
}
```
----------------------------
## <a name="ms-plugin-custom-model-properties"></a>ms-plugin.custom-model-properties :: Model -> Model
### Parameters
- **properties**: Array of *(A list of property descriptor ids.)*
### Default Parameters
```js
{
"properties": []
}
```
----------------------------
## <a name="ms-plugin-volume-from-ccp4"></a>ms-plugin.volume-from-ccp4 :: Ccp4 -> Data
*Create Volume from CCP4/MRC/MAP data*
### Parameters
- **voxelSize**: 3D vector [x, y, z]
### Default Parameters
```js
{
"voxelSize": [
1,
1,
1
]
}
```
----------------------------
## <a name="ms-plugin-volume-from-dsn6"></a>ms-plugin.volume-from-dsn6 :: Dsn6 -> Data
*Create Volume from DSN6/BRIX data*
### Parameters
- **voxelSize**: 3D vector [x, y, z]
### Default Parameters
```js
{
"voxelSize": [
1,
1,
1
]
}
```
----------------------------
## <a name="ms-plugin-representation-highlight-loci"></a>ms-plugin.representation-highlight-loci :: Root -> Behavior
----------------------------
## <a name="ms-plugin-representation-select-loci"></a>ms-plugin.representation-select-loci :: Root -> Behavior
----------------------------
## <a name="ms-plugin-default-loci-label-provider"></a>ms-plugin.default-loci-label-provider :: Root -> Behavior
----------------------------
## <a name="ms-plugin-structure-representation-3d"></a>ms-plugin.structure-representation-3d :: Structure -> Representation3D
### Parameters
- **type**: Object { name: string, params: object } where name+params are:
- **cartoon**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **sizeFactor**: Numeric value
- **linearSegments**: Numeric value
- **radialSegments**: Numeric value
- **aspectRatio**: Numeric value
- **arrowFactor**: Numeric value
- **visuals**: Array of 'polymer-trace', 'polymer-gap', 'nucleotide-block', 'direction-wedge'
- **ball-and-stick**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **sizeFactor**: Numeric value
- **detail**: Numeric value
- **linkScale**: Numeric value
- **linkSpacing**: Numeric value
- **radialSegments**: Numeric value
- **sizeAspectRatio**: Numeric value
- **visuals**: Array of 'element-sphere', 'intra-link', 'inter-link'
- **carbohydrate**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **detail**: Numeric value
- **sizeFactor**: Numeric value
- **linkScale**: Numeric value
- **linkSpacing**: Numeric value
- **radialSegments**: Numeric value
- **linkSizeFactor**: Numeric value
- **visuals**: Array of 'carbohydrate-symbol', 'carbohydrate-link', 'carbohydrate-terminal-link'
- **distance-restraint**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **linkScale**: Numeric value
- **linkSpacing**: Numeric value
- **radialSegments**: Numeric value
- **sizeFactor**: Numeric value
- **molecular-surface**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **resolution**: Numeric value
- **radiusOffset**: Numeric value
- **smoothness**: Numeric value
- **useGpu**: true/false
- **ignoreCache**: true/false
- **sizeFactor**: Numeric value
- **lineSizeAttenuation**: true/false
- **visuals**: Array of 'gaussian-surface', 'gaussian-wireframe'
- **molecular-volume**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **isoValueNorm**: Numeric value *(Normalized Isolevel Value)*
- **renderMode**: One of 'isosurface', 'volume'
- **controlPoints**: A list of 2d vectors [xi, yi][]
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **resolution**: Numeric value
- **radiusOffset**: Numeric value
- **smoothness**: Numeric value
- **point**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **sizeFactor**: Numeric value
- **pointSizeAttenuation**: true/false
- **pointFilledCircle**: true/false
- **pointEdgeBleach**: Numeric value
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **spacefill**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **unitKinds**: Array of 'atomic', 'spheres', 'gaussians'
- **sizeFactor**: Numeric value
- **detail**: Numeric value
- **colorTheme**: Object { name: string, params: object } where name+params are:
- **carbohydrate-symbol**:
Object with:
- **chain-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **cross-link**:
Object with:
- **domain**: Interval [min, max]
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **element-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **element-symbol**:
Object with:
- **molecule-type**:
Object with:
- **polymer-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **polymer-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **residue-name**:
Object with:
- **secondary-structure**:
Object with:
- **sequence-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **shape-group**:
Object with:
- **unit-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **uniform**:
Object with:
- **value**: Color as 0xrrggbb
- **sizeTheme**: Object { name: string, params: object } where name+params are:
- **physical**:
Object with:
- **shape-group**:
Object with:
- **uniform**:
Object with:
- **value**: Numeric value
### Default Parameters
```js
{
"type": {
"name": "cartoon",
"params": {
"alpha": 1,
"useFog": true,
"highlightColor": 16737945,
"selectColor": 3407641,
"quality": "auto",
"doubleSided": false,
"flipSided": false,
"flatShaded": false,
"unitKinds": [
"atomic",
"spheres"
],
"sizeFactor": 0.2,
"linearSegments": 8,
"radialSegments": 16,
"aspectRatio": 5,
"arrowFactor": 1.5,
"visuals": [
"polymer-trace"
]
}
},
"colorTheme": {
"name": "polymer-id",
"params": {
"list": "RedYellowBlue"
}
},
"sizeTheme": {
"name": "uniform",
"params": {
"value": 1
}
}
}
```
----------------------------
## <a name="ms-plugin-explode-structure-representation-3d"></a>ms-plugin.explode-structure-representation-3d :: Representation3D -> Obj
### Parameters
- **t**: Numeric value
### Default Parameters
```js
{
"t": 0
}
```
----------------------------
## <a name="ms-plugin-volume-representation-3d"></a>ms-plugin.volume-representation-3d :: Data -> Representation3D
### Parameters
- **type**: Object { name: string, params: object } where name+params are:
- **isosurface**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **doubleSided**: true/false
- **flipSided**: true/false
- **flatShaded**: true/false
- **isoValue**: - **absolute**: Numeric value
- **relative**: Numeric value
- **sizeFactor**: Numeric value
- **lineSizeAttenuation**: true/false
- **visuals**: Array of 'solid', 'wireframe'
- **direct-volume**:
Object with:
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **isoValueNorm**: Numeric value *(Normalized Isolevel Value)*
- **renderMode**: One of 'isosurface', 'volume'
- **controlPoints**: A list of 2d vectors [xi, yi][]
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **colorTheme**: Object { name: string, params: object } where name+params are:
- **carbohydrate-symbol**:
Object with:
- **chain-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **cross-link**:
Object with:
- **domain**: Interval [min, max]
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **element-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **element-symbol**:
Object with:
- **molecule-type**:
Object with:
- **polymer-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **polymer-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **residue-name**:
Object with:
- **secondary-structure**:
Object with:
- **sequence-id**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **shape-group**:
Object with:
- **unit-index**:
Object with:
- **list**: One of 'OrangeRed', 'PurpleBlue', 'BluePurple', 'Oranges', 'BlueGreen', 'YellowOrangeBrown', 'YellowGreen', 'Reds', 'RedPurple', 'Greens', 'YellowGreenBlue', 'Purples', 'GreenBlue', 'Greys', 'YellowOrangeRed', 'PurpleRed', 'Blues', 'PurpleBlueGreen', 'Spectral', 'RedYellowGreen', 'RedBlue', 'PinkYellowGreen', 'PurpleGreen', 'RedYellowBlue', 'BrownWhiteGreen', 'RedGrey', 'PurpleOrange', 'Set2', 'Accent', 'Set1', 'Set3', 'Dark2', 'Paired', 'Pastel2', 'Pastel1', 'Magma', 'Inferno', 'Plasma', 'Viridis', 'Cividis', 'Twilight', 'Rainbow', 'RedWhiteBlue'
- **uniform**:
Object with:
- **value**: Color as 0xrrggbb
- **sizeTheme**: Object { name: string, params: object } where name+params are:
- **physical**:
Object with:
- **shape-group**:
Object with:
- **uniform**:
Object with:
- **value**: Numeric value
### Default Parameters
```js
{
"type": {
"name": "isosurface",
"params": {
"alpha": 1,
"useFog": true,
"highlightColor": 16737945,
"selectColor": 3407641,
"quality": "auto",
"doubleSided": false,
"flipSided": false,
"flatShaded": false,
"isoValue": {
"kind": "relative",
"stats": {
"min": 0,
"max": 0,
"mean": 0,
"sigma": 0
},
"relativeValue": 2
},
"sizeFactor": 1,
"lineSizeAttenuation": false,
"visuals": [
"solid"
]
}
},
"colorTheme": {
"name": "uniform",
"params": {
"value": 13421772
}
},
"sizeTheme": {
"name": "uniform",
"params": {
"value": 1
}
}
}
```
----------------------------
## <a name="ms-plugin-focus-loci-on-select"></a>ms-plugin.focus-loci-on-select :: Root -> Behavior
### Parameters
- **minRadius**: Numeric value
- **extraRadius**: Numeric value *(Value added to the boundning sphere radius of the Loci.)*
### Default Parameters
```js
{
"minRadius": 10,
"extraRadius": 4
}
```
----------------------------
## <a name="ms-plugin-pdbe-structure-quality-report-prop"></a>ms-plugin.pdbe-structure-quality-report-prop :: Root -> Behavior
### Parameters
- **autoAttach**: true/false
### Default Parameters
```js
{
"autoAttach": false
}
```
----------------------------
## <a name="ms-plugin-rcsb-assembly-symmetry-prop"></a>ms-plugin.rcsb-assembly-symmetry-prop :: Root -> Behavior
### Parameters
- **autoAttach**: true/false
### Default Parameters
```js
{
"autoAttach": false
}
```
----------------------------
## <a name="ms-plugin-structure-animation"></a>ms-plugin.structure-animation :: Root -> Behavior
### Parameters
- **rotate**: true/false
- **rotateValue**: Numeric value
- **explode**: true/false
- **explodeValue**: Numeric value
### Default Parameters
```js
{
"rotate": false,
"rotateValue": 0,
"explode": false,
"explodeValue": 0
}
```
----------------------------
## <a name="ms-plugin-scene-labels"></a>ms-plugin.scene-labels :: Root -> Behavior
### Parameters
- **alpha**: Numeric value
- **useFog**: true/false
- **highlightColor**: Color as 0xrrggbb
- **selectColor**: Color as 0xrrggbb
- **quality**: One of 'custom', 'auto', 'highest', 'higher', 'high', 'medium', 'low', 'lower', 'lowest'
- **fontFamily**: One of 'sans-serif', 'monospace', 'serif', 'cursive'
- **fontQuality**: One of '0', '1', '2', '3', '4'
- **fontStyle**: One of 'normal', 'italic', 'oblique'
- **fontVariant**: One of 'normal', 'small-caps'
- **fontWeight**: One of 'normal', 'bold'
- **sizeFactor**: Numeric value
- **borderWidth**: Numeric value
- **borderColor**: Color as 0xrrggbb
- **offsetX**: Numeric value
- **offsetY**: Numeric value
- **offsetZ**: Numeric value
- **background**: true/false
- **backgroundMargin**: Numeric value
- **backgroundColor**: Color as 0xrrggbb
- **backgroundOpacity**: Numeric value
- **attachment**: One of 'bottom-left', 'bottom-center', 'bottom-right', 'middle-left', 'middle-center', 'middle-right', 'top-left', 'top-center', 'top-right'
- **levels**: Array of 'structure', 'polymer', 'ligand'
### Default Parameters
```js
{
"alpha": 1,
"useFog": true,
"highlightColor": 16737945,
"selectColor": 3407641,
"quality": "auto",
"fontFamily": "sans-serif",
"fontQuality": 3,
"fontStyle": "normal",
"fontVariant": "normal",
"fontWeight": "normal",
"sizeFactor": 1,
"borderWidth": 0,
"borderColor": 8421504,
"offsetX": 0,
"offsetY": 0,
"offsetZ": 0,
"background": true,
"backgroundMargin": 0.2,
"backgroundColor": 16775930,
"backgroundOpacity": 0.9,
"attachment": "middle-center",
"levels": []
}
```
----------------------------

View File

@@ -1,86 +0,0 @@
What is VolumeServer
=====================
VolumeServer is a service for accessing subsets of volumetric density data. It automatically downsamples the data depending on the volume of the requested region to reduce the bandwidth requirements and provide near-instant access to even the largest data sets.
It uses the text based CIF and BinaryCIF formats to deliver the data to the client.
For quick info about the benefits of using the server, check out the [examples](examples.md).
Installing and Running
=====================
Requires nodejs 8+.
## From GitHub
```
git clone https://github.com/molstar/molstar
npm install
```
Afterwards, build the project source:
```
npm run build-tsc
```
and run the server by
```
node lib/commonjs/servers/volume/server
```
## From NPM
```
npm install --production molstar
./volume-server
```
(or ``node node_modules\.bin\volume-server`` in Windows).
The NPM package contains all the tools mentioned here as "binaries":
- ``volume-server``
- ``volume-server-pack``
- ``volume-server-query``
### Production use
In production it is required to use a service that will keep the server running, such as [forever.js](https://github.com/foreverjs/forever).
### Memory issues
Sometimes nodejs might run into problems with memory. This is usually resolved by adding the ``--max-old-space-size=8192`` parameter.
## Preparing the Data
For the server to work, CCP4/MAP (models 0, 1, 2 are supported) input data need to be converted into a custom block format.
To achieve this, use the ``pack`` application (``node lib/commonjs/servers/volume/pack`` or ``volume-server-pack`` binary from the NPM package).
## Local Mode
The program ``lib/commonjs/servers/volume/pack`` (``volume-server-query`` in NPM package) can be used to query the data without running a http server.
## Navigating the Source Code
The source code is split into 2 mains parts: ``pack`` and ``server``:
- The ``pack`` part provides the means of converting CCP4 files into the internal block format.
- The ``server`` includes
- ``query``: the main part of the server that handles a query. ``execute.ts`` is the "entry point".
- ``algebra``: linear, "coordinate", and "box" algebra provides the means for calculations necessary to concent a user query into a menaningful response.
- API wrapper that handles the requests.
Consuming the Data
==================
The data can be consumed in any (modern) browser using the [ciftools library](https://github.com/molstar/ciftools) (or any other piece of code that can read text or binary CIF).
The [Data Format](DataFormat.md) document gives a detailed description of the server response format.
As a reference/example of the server usage is available in Mol* ``mol-plugin`` module.

File diff suppressed because it is too large Load Diff

75130
examples/7qpd.fw2.cif Normal file

File diff suppressed because it is too large Load Diff

86
examples/ace2-hit.mol2 Normal file
View File

@@ -0,0 +1,86 @@
@<TRIPOS>MOLECULE
ace2_r_r2.top2000.poses.plain/3_Z1137565832_1_T2.pdb
37 41 0 0 0
SMALL
GASTEIGER
@<TRIPOS>ATOM
1 C 64.7720 85.9180 38.1090 C.3 1 LIG1 0.0799
2 C 64.6440 84.6900 37.1570 C.3 1 LIG1 0.0306
3 C 65.2660 83.4260 37.8080 C.3 1 LIG1 0.0927
4 N 66.6560 83.6710 38.1790 N.pl3 1 LIG1 -0.2919
5 C 67.7080 82.9280 37.6260 C.ar 1 LIG1 0.1520
6 C 69.0970 83.1860 37.8250 C.ar 1 LIG1 0.0393
7 C 70.0830 82.4100 37.1810 C.ar 1 LIG1 0.0436
8 C 69.6450 81.3740 36.3510 C.ar 1 LIG1 0.1867
9 N 70.3370 80.5030 35.6050 N.ar 1 LIG1 -0.1270
10 N 69.4700 79.7480 35.0040 N.ar 1 LIG1 -0.1228
11 C 68.2200 80.1120 35.3570 C.ar 1 LIG1 0.2583
12 N 68.3350 81.1470 36.2040 N.ar 1 LIG1 -0.1866
13 N 67.4230 81.8700 36.8030 N.ar 1 LIG1 -0.1473
14 C 66.8190 84.7600 39.1350 C.3 1 LIG1 0.0927
15 C 66.2560 86.0870 38.5570 C.3 1 LIG1 0.0306
16 N 64.4520 87.4670 36.2150 N.am 1 LIG1 -0.2979
17 H 64.9740 86.7650 35.7110 H 1 LIG1 0.1498
18 C 64.2290 87.1720 37.5220 C.2 1 LIG1 0.2224
19 O 63.5690 87.9550 38.2480 O.2 1 LIG1 -0.2751
20 C 64.0160 88.6470 35.5420 C.3 1 LIG1 0.1559
21 C 65.9650 88.2170 32.5700 C.ar 1 LIG1 0.1629
22 N 65.8040 88.0390 33.8860 N.ar 1 LIG1 -0.3232
23 H 66.4190 87.5270 34.5040 H 1 LIG1 0.1686
24 C 64.6770 88.6690 34.2330 C.ar 1 LIG1 0.1601
25 N 64.1890 89.2810 33.1430 N.ar 1 LIG1 -0.1318
26 N 64.9640 89.0070 32.1450 N.ar 1 LIG1 -0.1293
27 F 69.9260 86.0280 29.3520 F 1 LIG1 -0.2042
28 C 68.9880 86.5420 30.0990 C.ar 1 LIG1 0.1401
29 C 67.6590 86.0900 29.9830 C.ar 1 LIG1 0.0297
30 C 66.6500 86.6450 30.7950 C.ar 1 LIG1 0.0053
31 C 66.9590 87.6470 31.7450 C.ar 1 LIG1 0.0359
32 C 68.2970 88.0990 31.8400 C.ar 1 LIG1 0.0053
33 C 69.3030 87.5560 31.0230 C.ar 1 LIG1 0.0297
34 C 66.9850 79.4910 34.8440 C.3 1 LIG1 0.4541
35 F 67.3150 78.4110 34.0640 F 1 LIG1 -0.1631
36 F 66.2460 80.3690 34.0910 F 1 LIG1 -0.1631
37 F 66.1920 79.0650 35.8800 F 1 LIG1 -0.1631
@<TRIPOS>BOND
1 1 2 1
2 1 18 1
3 1 15 1
4 2 3 1
5 3 4 1
6 4 5 1
7 4 14 1
8 5 13 ar
9 5 6 ar
10 6 7 ar
11 7 8 ar
12 8 9 ar
13 8 12 ar
14 9 10 ar
15 10 11 ar
16 11 34 1
17 11 12 ar
18 12 13 ar
19 14 15 1
20 16 20 1
21 16 17 1
22 16 18 am
23 18 19 2
24 20 24 1
25 21 31 1
26 21 26 ar
27 21 22 ar
28 22 24 ar
29 22 23 1
30 24 25 ar
31 25 26 ar
32 27 28 1
33 28 29 ar
34 28 33 ar
35 29 30 ar
36 30 31 ar
37 31 32 ar
38 32 33 ar
39 34 35 1
40 34 36 1
41 34 37 1

7628
examples/ace2.pdbqt Normal file

File diff suppressed because it is too large Load Diff

28000
examples/long_animation.sdf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,115 @@
{
"metadata": {
"title": "Example MolViewSpec - 1cbs with labelled and zoomed ligand",
"version": "1",
"timestamp": "2023-11-24T10:45:49.873Z"
},
"root": {
"kind": "root",
"children": [
{
"kind": "download",
"params": {
"url": "https://www.ebi.ac.uk/pdbe/entry-files/1cbs.bcif"
},
"children": [
{
"kind": "parse",
"params": {
"format": "bcif"
},
"children": [
{
"kind": "structure",
"params": {
"type": "model"
},
"children": [
{
"kind": "component",
"params": {
"selector": "polymer"
},
"children": [
{
"kind": "representation",
"params": {
"type": "cartoon"
},
"children": [
{
"kind": "color",
"params": {
"color": "green"
}
},
{
"kind": "color",
"params": {
"selector": {
"label_asym_id": "A",
"end_label_seq_id": 50
},
"color": "#6688ff"
}
}
]
},
{
"kind": "label",
"params": {
"text": "Protein"
}
}
]
},
{
"kind": "component",
"params": {
"selector": "ligand"
},
"children": [
{
"kind": "focus",
"params": {
"direction": [0.5, 0, -1],
"up": [0.365, 0.913, 0.183]
}
},
{
"kind": "representation",
"params": {
"type": "ball_and_stick"
},
"children": [
{
"kind": "color",
"params": {
"color": "#cc3399"
}
}
]
},
{
"kind": "label",
"params": {
"text": "Retinoic Acid"
}
}
]
}
]
}
]
}
]
},
{
"kind": "canvas",
"params": {
"background_color": "#ffffee"
}
}
]
}
}

117
examples/mvs/1cbs.mvsj Normal file
View File

@@ -0,0 +1,117 @@
{
"metadata": {
"title": "Example MolViewSpec - 1cbs with labelled protein and ligand",
"version": "1",
"timestamp": "2023-11-24T10:38:17.483Z"
},
"root": {
"kind": "root",
"children": [
{
"kind": "download",
"params": {
"url": "https://www.ebi.ac.uk/pdbe/entry-files/1cbs.bcif"
},
"children": [
{
"kind": "parse",
"params": {
"format": "bcif"
},
"children": [
{
"kind": "structure",
"params": {
"type": "model"
},
"children": [
{
"kind": "component",
"params": {
"selector": "polymer"
},
"children": [
{
"kind": "representation",
"params": {
"type": "cartoon"
},
"children": [
{
"kind": "color",
"params": {
"color": "green"
}
},
{
"kind": "color",
"params": {
"selector": {
"label_asym_id": "A",
"beg_label_seq_id": 1,
"end_label_seq_id": 50
},
"color": "#6688ff"
}
}
]
},
{
"kind": "label",
"params": {
"text": "Protein"
}
}
]
},
{
"kind": "component",
"params": {
"selector": "ligand"
},
"children": [
{
"kind": "representation",
"params": {
"type": "ball_and_stick"
},
"children": [
{
"kind": "color",
"params": {
"color": "#cc3399"
}
}
]
},
{
"kind": "label",
"params": {
"text": "Retinoic Acid"
}
}
]
}
]
}
]
}
]
},
{
"kind": "canvas",
"params": {
"background_color": "#ffffee"
}
},
{
"kind": "camera",
"params": {
"target": [17, 21, 27],
"position": [41, 34, 69],
"up": [-0.129,0.966,-0.224]
}
}
]
}
}

BIN
examples/mvs/1h9t.mvsx Normal file

Binary file not shown.

View File

@@ -0,0 +1,67 @@
{
"metadata": {
"title": "Example MolViewSpec - 1h9t colored by external annotation",
"version": "1",
"timestamp": "2023-11-24T10:47:33.182Z"
},
"root": {
"kind": "root",
"children": [
{
"kind": "download",
"params": {
"url": "https://www.ebi.ac.uk/pdbe/entry-files/1h9t.bcif"
},
"children": [
{
"kind": "parse",
"params": {
"format": "bcif"
},
"children": [
{
"kind": "structure",
"params": {
"type": "model"
},
"children": [
{
"kind": "component",
"params": {
"selector": "polymer"
},
"children": [
{
"kind": "representation",
"params": {
"type": "cartoon"
},
"children": [
{
"kind": "color",
"params": {
"selector": "all",
"color": "white"
}
},
{
"kind": "color_from_uri",
"params": {
"uri": "./1h9t_domains.json",
"format": "json",
"schema": "all_atomic"
}
}
]
}
]
}
]
}
]
}
]
}
]
}
}

View File

@@ -0,0 +1,583 @@
{
"metadata": {
"title": "Example MolViewSpec - 1h9t colored and labelled by external annotation",
"version": "1",
"timestamp": "2023-11-24T10:48:28.677Z"
},
"root": {
"kind": "root",
"children": [
{
"kind": "download",
"params": {
"url": "https://www.ebi.ac.uk/pdbe/entry-files/1h9t.bcif"
},
"children": [
{
"kind": "parse",
"params": {
"format": "bcif"
},
"children": [
{
"kind": "structure",
"params": {
"type": "model"
},
"children": [
{
"kind": "component",
"params": {
"selector": "protein"
},
"children": [
{
"kind": "representation",
"params": {
"type": "cartoon"
},
"children": [
{
"kind": "color",
"params": {
"selector": "all",
"color": "white"
}
},
{
"kind": "color_from_uri",
"params": {
"uri": "./1h9t_domains.json",
"format": "json",
"schema": "all_atomic"
}
}
]
}
]
},
{
"kind": "component",
"params": {
"selector": "nucleic"
},
"children": [
{
"kind": "representation",
"params": {
"type": "ball_and_stick"
},
"children": [
{
"kind": "color",
"params": {
"selector": "all",
"color": "white"
}
},
{
"kind": "color_from_uri",
"params": {
"uri": "./1h9t_domains.json",
"format": "json",
"schema": "all_atomic"
}
}
]
}
]
},
{
"kind": "component",
"params": {
"selector": "ion"
},
"children": [
{
"kind": "representation",
"params": {
"type": "surface"
},
"children": [
{
"kind": "color_from_uri",
"params": {
"uri": "./1h9t_domains.json",
"format": "json",
"schema": "all_atomic"
}
}
]
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"beg_label_seq_id": 9,
"end_label_seq_id": 83
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA-binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"beg_label_seq_id": 9,
"end_label_seq_id": 83
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA-binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"beg_label_seq_id": 84,
"end_label_seq_id": 231
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Acyl-CoA\nbinding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"beg_label_seq_id": 84,
"end_label_seq_id": 231
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Acyl-CoA binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "C"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA X"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "D"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA Y"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "D",
"atom_id": 4016
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA Y O5'"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "D",
"atom_id": 4391
}
},
"children": [
{
"kind": "label",
"params": {
"text": "DNA Y O3'"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "E"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Gold"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "H"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Gold"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "F"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Chloride"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "G"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Chloride"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "I"
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Chloride"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 57
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 67
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 121
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 125
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 129
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"label_seq_id": 178
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "A",
"beg_label_seq_id": 203,
"end_label_seq_id": 205
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"label_seq_id": 67
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"label_seq_id": 121
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"label_seq_id": 125
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"label_seq_id": 129
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"label_seq_id": 178
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": {
"label_asym_id": "B",
"beg_label_seq_id": 203,
"end_label_seq_id": 205
}
},
"children": [
{
"kind": "label",
"params": {
"text": "Ligand binding"
}
}
]
},
{
"kind": "component",
"params": {
"selector": "all"
},
"children": [
{
"kind": "focus",
"params": {
"direction": [-0.3, -0.1, -1]
}
}
]
}
]
}
]
}
]
},
{
"kind": "canvas",
"params": {
"background_color": "#eeffee"
}
}
]
}
}

View File

@@ -0,0 +1,155 @@
[
{
"label_asym_id": "A",
"beg_label_seq_id": 9,
"end_label_seq_id": 83,
"color": "#dd6600",
"tooltip": "DNA-binding"
},
{
"label_asym_id": "A",
"beg_label_seq_id": 84,
"end_label_seq_id": 231,
"color": "#008800",
"tooltip": "Acyl-CoA binding"
},
{
"label_asym_id": "B",
"beg_label_seq_id": 9,
"end_label_seq_id": 83,
"color": "#cc8800",
"tooltip": "DNA-binding"
},
{
"label_asym_id": "B",
"beg_label_seq_id": 84,
"end_label_seq_id": 231,
"color": "#008888",
"tooltip": "Acyl-CoA binding"
},
{
"label_asym_id": "C",
"color": "#1100aa",
"tooltip": "DNA X"
},
{
"label_asym_id": "D",
"color": "#dddddd",
"tooltip": "DNA Y"
},
{
"label_asym_id": "D",
"atom_id": 4016,
"color": "#ff0044",
"tooltip": "DNA Y - O5'"
},
{
"label_asym_id": "D",
"atom_id": 4391,
"color": "#4400ff",
"tooltip": "DNA Y - O3'"
},
{
"label_asym_id": "E",
"color": "#ffff00",
"tooltip": "Gold"
},
{
"label_asym_id": "H",
"color": "#ffff00",
"tooltip": "Gold"
},
{
"label_asym_id": "F",
"color": "#00dd00",
"tooltip": "Chloride"
},
{
"label_asym_id": "G",
"color": "#00dd00",
"tooltip": "Chloride"
},
{
"label_asym_id": "I",
"color": "#00dd00",
"tooltip": "Chloride"
},
{
"label_asym_id": "A",
"label_seq_id": 57,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"label_seq_id": 67,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"label_seq_id": 121,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"label_seq_id": 125,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"label_seq_id": 129,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"label_seq_id": 178,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "A",
"beg_label_seq_id": 203,
"end_label_seq_id": 205,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "B",
"label_seq_id": 67,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "B",
"label_seq_id": 121,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "B",
"label_seq_id": 125,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "B",
"label_seq_id": 129,
"color": "#ff0000",
"tooltip": "Ligand binding site"
},
{
"label_asym_id": "B",
"beg_label_seq_id": 203,
"end_label_seq_id": 205,
"color": "#ff0000",
"tooltip": "Ligand binding site"
}
]

32690
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "molstar",
"version": "2.3.4",
"version": "4.2.0",
"description": "A comprehensive macromolecular library.",
"homepage": "https://github.com/molstar/molstar#readme",
"repository": {
@@ -13,12 +13,14 @@
"scripts": {
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"test": "npm run lint && jest",
"test": "npm install --no-save \"gl@^6.0.2\" && npm run lint && jest",
"jest": "jest",
"build": "npm run build-tsc && npm run build-extra && npm run build-webpack",
"clean": "node ./scripts/clean.js",
"rebuild": "npm run clean && npm run build",
"build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer",
"build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"",
"build-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/",
"build-extra": "cpx \"src/**/*.{scss,html,ico,jpg}\" lib/",
"build-webpack": "webpack --mode production --config ./webpack.config.production.js",
"build-webpack-viewer": "webpack --mode production --config ./webpack.config.viewer.js",
"watch": "concurrently -c \"green,green,gray,gray\" --names \"tsc,srv,ext,wpc\" --kill-others \"npm:watch-tsc\" \"npm:watch-servers\" \"npm:watch-extra\" \"npm:watch-webpack\"",
@@ -26,7 +28,7 @@
"watch-viewer-debug": "concurrently -c \"green,gray,gray\" --names \"tsc,ext,wpc\" --kill-others \"npm:watch-tsc\" \"npm:watch-extra\" \"npm:watch-webpack-viewer-debug\"",
"watch-tsc": "tsc --watch --incremental",
"watch-servers": "tsc --build tsconfig.commonjs.json --watch --incremental",
"watch-extra": "cpx \"src/**/*.{scss,html,ico}\" lib/ --watch",
"watch-extra": "cpx \"src/**/*.{scss,html,ico,jpg}\" lib/ --watch",
"watch-webpack": "webpack -w --mode development --stats minimal",
"watch-webpack-viewer": "webpack -w --mode development --stats minimal --config ./webpack.config.viewer.js",
"watch-webpack-viewer-debug": "webpack -w --mode development --stats minimal --config ./webpack.config.viewer.debug.js",
@@ -36,7 +38,7 @@
"volume-server-test": "node lib/commonjs/servers/volume/server.js --idMap em 'test/${id}.mdb' --defaultPort 1336",
"plugin-state": "node lib/commonjs/servers/plugin-state/index.js --working-folder ./build/state --port 1339",
"preversion": "npm run test",
"version": "npm run build",
"version": "npm run rebuild && cpx .npmignore lib/",
"postversion": "git push && git push --tags"
},
"files": [
@@ -46,6 +48,9 @@
"bin": {
"cif2bcif": "lib/commonjs/cli/cif2bcif/index.js",
"cifschema": "lib/commonjs/cli/cifschema/index.js",
"mvs-validate": "lib/commonjs/cli/mvs/mvs-validate.js",
"mvs-render": "lib/commonjs/cli/mvs/mvs-render.js",
"mvs-print-schema": "lib/commonjs/cli/mvs/mvs-print-schema.js",
"model-server": "lib/commonjs/servers/model/server.js",
"model-server-query": "lib/commonjs/servers/model/query.js",
"model-server-preprocess": "lib/commonjs/servers/model/preprocess.js",
@@ -73,7 +78,9 @@
"node_modules",
"lib"
],
"testURL": "http://localhost/",
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"testRegex": "\\.spec\\.ts$"
},
"author": "Mol* Contributors",
@@ -84,72 +91,105 @@
"Áron Samuel Kovács <aron.kovacs@mail.muni.cz>",
"Ludovic Autin <autin@scripps.edu>",
"Michal Malý <michal.maly@ibt.cas.cz>",
"Jiří Černý <jiri.cerny@ibt.cas.cz>"
"Jiří Černý <jiri.cerny@ibt.cas.cz>",
"Panagiotis Tourlas <panagiot_tourlov@hotmail.com>",
"Adam Midlik <midlik@gmail.com>",
"Koya Sakuma <koya.sakuma.work@gmail.com>",
"Gianluca Tomasello <giagitom@gmail.com>",
"Ke Ma <mark.ma@rcsb.org>",
"Jason Pattle <jpattle@exscientia.co.uk>",
"David Williams <dwilliams@nobiastx.com>",
"Zhenyu Zhang <jump2cn@gmail.com>",
"Russell Parker <russell@benchling.com>",
"Dominik Tichy <tichydominik451@gmail.com>",
"Yana Rose <yana.v.rose@gmail.com>",
"Yakov Pechersky <ffxen158@gmail.com>",
"Christian Dominguez <christian.99dominguez@gmail.com>",
"Cai Huiyu <szmun.caihy@gmail.com>",
"Ryan DiRisio <rjdiris@gmail.com>"
],
"license": "MIT",
"devDependencies": {
"@graphql-codegen/add": "^3.1.0",
"@graphql-codegen/cli": "^2.2.0",
"@graphql-codegen/time": "^3.1.0",
"@graphql-codegen/typescript": "^2.2.2",
"@graphql-codegen/typescript-graphql-files-modules": "^2.1.0",
"@graphql-codegen/typescript-graphql-request": "^4.1.4",
"@graphql-codegen/typescript-operations": "^2.1.6",
"@types/cors": "^2.8.12",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"@types/cors": "^2.8.17",
"@types/gl": "^6.0.5",
"@types/pngjs": "^6.0.5",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"benchmark": "^2.1.4",
"concurrently": "^6.3.0",
"cpx2": "^4.0.0",
"concurrently": "^8.2.2",
"cpx2": "^7.0.1",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.3.0",
"eslint": "^7.32.0",
"css-loader": "^7.1.1",
"eslint": "^8.57.0",
"extra-watch-webpack-plugin": "^1.0.3",
"file-loader": "^6.2.0",
"fs-extra": "^10.0.0",
"graphql": "^15.6.0",
"http-server": "^13.0.2",
"jest": "^27.2.4",
"mini-css-extract-plugin": "^2.3.0",
"node-sass": "^6.0.1",
"fs-extra": "^11.2.0",
"http-server": "^14.1.1",
"jest": "^29.7.0",
"jpeg-js": "^0.4.4",
"mini-css-extract-plugin": "^2.9.0",
"path-browserify": "^1.0.1",
"raw-loader": "^4.0.2",
"sass-loader": "^12.1.0",
"simple-git": "^2.46.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sass": "^1.76.0",
"sass-loader": "^14.2.1",
"simple-git": "^3.24.0",
"stream-browserify": "^3.0.0",
"style-loader": "^3.3.0",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3",
"webpack": "^5.56.0",
"webpack-cli": "^4.8.0",
"webpack-version-file-plugin": "^0.4.0"
"style-loader": "^4.0.0",
"ts-jest": "^29.1.2",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@types/argparse": "^2.0.10",
"@types/benchmark": "^2.1.1",
"@types/compression": "1.7.2",
"@types/express": "^4.17.13",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.2",
"@types/node-fetch": "^2.5.12",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"@types/swagger-ui-dist": "3.30.1",
"@types/argparse": "^2.0.16",
"@types/benchmark": "^2.1.5",
"@types/compression": "1.7.5",
"@types/express": "^4.17.21",
"@types/node": "^18.19.31",
"@types/node-fetch": "^2.6.11",
"@types/swagger-ui-dist": "3.30.4",
"argparse": "^2.0.1",
"body-parser": "^1.19.0",
"body-parser": "^1.20.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
"express": "^4.17.1",
"express": "^4.19.2",
"h264-mp4-encoder": "^1.0.12",
"immer": "^9.0.6",
"immutable": "^3.8.2",
"node-fetch": "^2.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rxjs": "^7.3.1",
"swagger-ui-dist": "^3.52.3",
"tslib": "^2.3.1",
"util.promisify": "^1.1.1",
"immer": "^10.1.1",
"immutable": "^4.3.5",
"io-ts": "^2.2.21",
"node-fetch": "^2.7.0",
"react-markdown": "^9.0.1",
"rxjs": "^7.8.1",
"swagger-ui-dist": "^5.17.2",
"tslib": "^2.6.2",
"util.promisify": "^1.1.2",
"xhr2": "^0.2.1"
},
"peerDependencies": {
"canvas": "^2.11.2",
"gl": "^6.0.2",
"jpeg-js": "^0.4.4",
"pngjs": "^6.0.0",
"react": "^18.1.0 || ^17.0.2 || ^16.14.0",
"react-dom": "^18.1.0 || ^17.0.2 || ^16.14.0"
},
"peerDependenciesMeta": {
"canvas": {
"optional": true
},
"gl": {
"optional": true
},
"jpeg-js": {
"optional": true
},
"pngjs": {
"optional": true
}
}
}

41
scripts/clean.js Normal file
View File

@@ -0,0 +1,41 @@
/**
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Michal Malý <malym@ibt.cas.cz>
*/
const fs = require('fs');
const path = require('path');
function removeDir(dirPath) {
for (const ent of fs.readdirSync(dirPath)) {
const entryPath = path.join(dirPath, ent);
remove(entryPath);
}
fs.rmdirSync(dirPath);
}
function remove(entryPath) {
const st = fs.statSync(entryPath);
if (st.isDirectory())
removeDir(entryPath);
else
fs.unlinkSync(entryPath);
}
const toClean = [
path.resolve(__dirname, '../build'),
path.resolve(__dirname, '../lib'),
path.resolve(__dirname, '../tsconfig.tsbuildinfo'),
];
toClean.forEach(ph => {
if (fs.existsSync(ph)) {
try {
remove(ph);
} catch (err) {
console.warn(`Cleanup failed: ${err}`);
}
}
});

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2019-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -14,6 +14,9 @@ const buildDir = path.resolve(__dirname, '../build/');
const deployDir = path.resolve(buildDir, 'deploy/');
const localPath = path.resolve(deployDir, 'molstar.github.io/');
const analyticsTag = /<!-- __MOLSTAR_ANALYTICS__ -->/g;
const analyticsCode = `<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "c414cbae2d284ea995171a81e4a3e721"}'></script><!-- End Cloudflare Web Analytics --><iframe src="https://web3dsurvey.com/collector-iframe.html" style="width: 1px; height: 1px;"></iframe>`;
function log(command, stdout, stderr) {
if (command) {
console.log('\n###', command);
@@ -22,11 +25,45 @@ function log(command, stdout, stderr) {
}
}
function addAnalytics(path) {
const data = fs.readFileSync(path, 'utf8');
const result = data.replace(analyticsTag, analyticsCode);
fs.writeFileSync(path, result, 'utf8');
}
function copyViewer() {
console.log('\n###', 'copy viewer files');
const viewerBuildPath = path.resolve(buildDir, '../build/viewer/');
const viewerDeployPath = path.resolve(localPath, 'viewer/');
fse.copySync(viewerBuildPath, viewerDeployPath, { overwrite: true });
addAnalytics(path.resolve(viewerDeployPath, 'index.html'));
}
function copyMe() {
console.log('\n###', 'copy me files');
const meBuildPath = path.resolve(buildDir, '../build/mesoscale-explorer/');
const meDeployPath = path.resolve(localPath, 'me/');
fse.copySync(meBuildPath, meDeployPath, { overwrite: true });
addAnalytics(path.resolve(meDeployPath, 'index.html'));
}
function copyDemos() {
console.log('\n###', 'copy demos files');
const lightingBuildPath = path.resolve(buildDir, '../build/examples/lighting/');
const lightingDeployPath = path.resolve(localPath, 'demos/lighting/');
fse.copySync(lightingBuildPath, lightingDeployPath, { overwrite: true });
addAnalytics(path.resolve(lightingDeployPath, 'index.html'));
const orbitalsBuildPath = path.resolve(buildDir, '../build/examples/alpha-orbitals/');
const orbitalsDeployPath = path.resolve(localPath, 'demos/alpha-orbitals/');
fse.copySync(orbitalsBuildPath, orbitalsDeployPath, { overwrite: true });
addAnalytics(path.resolve(orbitalsDeployPath, 'index.html'));
}
function copyFiles() {
copyViewer();
copyMe();
copyDemos();
}
if (!fs.existsSync(localPath)) {
@@ -42,9 +79,9 @@ if (!fs.existsSync(path.resolve(localPath, '.git/'))) {
.outputHandler(log)
.clone(remoteUrl, localPath)
.fetch(['--all'])
.exec(copyViewer)
.exec(copyFiles)
.add(['-A'])
.commit('updated viewer')
.commit('updated viewer & demos')
.push();
} else {
console.log('\n###', 'update repository');
@@ -52,8 +89,8 @@ if (!fs.existsSync(path.resolve(localPath, '.git/'))) {
.outputHandler(log)
.fetch(['--all'])
.reset(['--hard', 'origin/master'])
.exec(copyViewer)
.exec(copyFiles)
.add(['-A'])
.commit('updated viewer')
.commit('updated viewer & demos')
.push();
}

View File

@@ -19,19 +19,19 @@
<div id="app"></div>
<script type="text/javascript" src="./molstar.js"></script>
<script type="text/javascript">
var viewer = new DockingViewer('app', [0x33DD22, 0x1133EE], true);
function getParam(name, regex) {
var r = new RegExp(name + '=' + '(' + regex + ')[&]?', 'i');
return decodeURIComponent(((window.location.search || '').match(r) || [])[1] || '');
}
var pdbqt = getParam('pdbqt', '[^&]+').trim();
var mol2 = getParam('mol2', '[^&]+').trim();
var pdbqt = getParam('pdbqt', '[^&]+').trim() || '../../examples/ace2.pdbqt';
var mol2 = getParam('mol2', '[^&]+').trim() || '../../examples/ace2-hit.mol2';
viewer.loadStructuresFromUrlsAndMerge([
{ url: pdbqt, format: 'pdbqt' },
{ url: mol2, format: 'mol2' }
]);
DockingViewer.create('app', [0x33DD22, 0x1133EE], true).then(viewer => {
viewer.loadStructuresFromUrlsAndMerge([
{ url: pdbqt, format: 'pdbqt' },
{ url: mol2, format: 'mol2' }
]);
});
</script>
</body>
</html>

View File

@@ -8,7 +8,8 @@
import { Structure } from '../../mol-model/structure';
import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory';
import { PluginStateObject as PSO, PluginStateTransform } from '../../mol-plugin-state/objects';
import { createPlugin } from '../../mol-plugin-ui';
import { createPluginUI } from '../../mol-plugin-ui';
import { renderReact18 } from '../../mol-plugin-ui/react18';
import { PluginUIContext } from '../../mol-plugin-ui/context';
import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
import { DefaultPluginUISpec, PluginUISpec } from '../../mol-plugin-ui/spec';
@@ -54,23 +55,26 @@ const DefaultViewerOptions = {
};
class Viewer {
plugin: PluginUIContext
constructor(public plugin: PluginUIContext) {
}
constructor(elementOrId: string | HTMLElement, colors = [Color(0x992211), Color(0xDDDDDD)], showButtons = true) {
const o = { ...DefaultViewerOptions, ...{
layoutIsExpanded: false,
layoutShowControls: false,
layoutShowRemoteState: false,
layoutShowSequence: true,
layoutShowLog: false,
layoutShowLeftPanel: true,
static async create(elementOrId: string | HTMLElement, colors = [Color(0x992211), Color(0xDDDDDD)], showButtons = true) {
const o = {
...DefaultViewerOptions, ...{
layoutIsExpanded: false,
layoutShowControls: false,
layoutShowRemoteState: false,
layoutShowSequence: true,
layoutShowLog: false,
layoutShowLeftPanel: true,
viewportShowExpand: true,
viewportShowControls: false,
viewportShowSettings: false,
viewportShowSelectionMode: false,
viewportShowAnimation: false,
} };
viewportShowExpand: true,
viewportShowControls: false,
viewportShowSettings: false,
viewportShowSelectionMode: false,
viewportShowAnimation: false,
}
};
const defaultSpec = DefaultPluginUISpec();
const spec: PluginUISpec = {
@@ -125,29 +129,29 @@ class Viewer {
? document.getElementById(elementOrId)
: elementOrId;
if (!element) throw new Error(`Could not get element with id '${elementOrId}'`);
this.plugin = createPlugin(element, spec);
const plugin = await createPluginUI({ target: element, spec, render: renderReact18 });
(this.plugin.customState as any) = {
(plugin.customState as any) = {
colorPalette: {
name: 'colors',
params: { list: { colors } }
}
};
this.plugin.behaviors.canvas3d.initialized.subscribe(v => {
if (v) {
PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: {
renderer: {
...this.plugin.canvas3d!.props.renderer,
backgroundColor: ColorNames.white,
},
camera: {
...this.plugin.canvas3d!.props.camera,
helper: { axes: { name: 'off', params: {} } }
}
} });
PluginCommands.Canvas3D.SetSettings(plugin, {
settings: {
renderer: {
...plugin.canvas3d!.props.renderer,
backgroundColor: ColorNames.white,
},
camera: {
...plugin.canvas3d!.props.camera,
helper: { axes: { name: 'off', params: {} } }
}
}
});
return new Viewer(plugin);
}
async loadStructuresFromUrlsAndMerge(sources: { url: string, format: BuiltInTrajectoryFormat, isBinary?: boolean }[]) {
@@ -163,7 +167,7 @@ class Viewer {
structures.push({ ref: structureProperties?.ref || structure.ref });
}
// remove current structuresfrom hierarchy as they will be merged
// remove current structures from hierarchy as they will be merged
// TODO only works with using loadStructuresFromUrlsAndMerge once
// need some more API metho to work with the hierarchy
this.plugin.managers.structure.hierarchy.updateCurrent(this.plugin.managers.structure.hierarchy.current.structures, 'remove');

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2020-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -21,17 +21,18 @@ import { PluginContext } from '../../mol-plugin/context';
import { MolScriptBuilder as MS } from '../../mol-script/language/builder';
import { StateObjectRef } from '../../mol-state';
import { Color } from '../../mol-util/color';
import { Material } from '../../mol-util/material';
function shinyStyle(plugin: PluginContext) {
return PluginCommands.Canvas3D.SetSettings(plugin, { settings: {
renderer: {
...plugin.canvas3d!.props.renderer,
style: { name: 'plastic', params: {} },
},
postprocessing: {
...plugin.canvas3d!.props.postprocessing,
occlusion: { name: 'off', params: {} },
outline: { name: 'off', params: {} }
shadow: { name: 'off', params: {} },
outline: { name: 'off', params: {} },
}
} });
}
@@ -40,20 +41,25 @@ function occlusionStyle(plugin: PluginContext) {
return PluginCommands.Canvas3D.SetSettings(plugin, { settings: {
renderer: {
...plugin.canvas3d!.props.renderer,
style: { name: 'flat', params: {} }
},
postprocessing: {
...plugin.canvas3d!.props.postprocessing,
occlusion: { name: 'on', params: {
samples: 64,
radius: 8,
bias: 1.0,
blurKernelSize: 13
blurKernelSize: 15,
multiScale: { name: 'off', params: {} },
radius: 5,
bias: 0.8,
samples: 32,
resolutionScale: 1,
color: Color(0x000000),
} },
outline: { name: 'on', params: {
scale: 1.0,
threshold: 0.33
} }
threshold: 0.33,
color: Color(0x0000),
includeTransparent: true,
} },
shadow: { name: 'off', params: {} },
}
} });
}
@@ -77,7 +83,7 @@ const PresetParams = {
...StructureRepresentationPresetProvider.CommonParams,
};
const CustomMaterial = Material({ roughness: 0.2, metalness: 0 });
export const StructurePreset = StructureRepresentationPresetProvider({
id: 'preset-structure',
@@ -94,8 +100,8 @@ export const StructurePreset = StructureRepresentationPresetProvider({
const { update, builder, typeParams } = StructureRepresentationPresetProvider.reprBuilder(plugin, params);
const representations = {
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, sizeFactor: 0.35 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'cartoon', typeParams: { ...typeParams }, color: 'chain-id', colorParams: { palette: (plugin.customState as any).colorPalette } }, { tag: 'polymer' }),
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, material: CustomMaterial, sizeFactor: 0.35 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'cartoon', typeParams: { ...typeParams, material: CustomMaterial }, color: 'chain-id', colorParams: { palette: (plugin.customState as any).colorPalette } }, { tag: 'polymer' }),
};
await update.commit({ revertOnError: true });
@@ -121,8 +127,8 @@ export const IllustrativePreset = StructureRepresentationPresetProvider({
const { update, builder, typeParams } = StructureRepresentationPresetProvider.reprBuilder(plugin, params);
const representations = {
ligand: builder.buildRepresentation(update, components.ligand, { type: 'spacefill', typeParams: { ...typeParams }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'spacefill', typeParams: { ...typeParams }, color: 'illustrative', colorParams: { palette: (plugin.customState as any).colorPalette } }, { tag: 'polymer' }),
ligand: builder.buildRepresentation(update, components.ligand, { type: 'spacefill', typeParams: { ...typeParams, ignoreLight: true }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'spacefill', typeParams: { ...typeParams, ignoreLight: true }, color: 'illustrative', colorParams: { palette: (plugin.customState as any).colorPalette } }, { tag: 'polymer' }),
};
await update.commit({ revertOnError: true });
@@ -149,8 +155,8 @@ const SurfacePreset = StructureRepresentationPresetProvider({
const { update, builder, typeParams } = StructureRepresentationPresetProvider.reprBuilder(plugin, params);
const representations = {
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, sizeFactor: 0.26 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'molecular-surface', typeParams: { ...typeParams, quality: 'custom', resolution: 0.5, doubleSided: true }, color: 'partial-charge' }, { tag: 'polymer' }),
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, material: CustomMaterial, sizeFactor: 0.26 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
polymer: builder.buildRepresentation(update, components.polymer, { type: 'molecular-surface', typeParams: { ...typeParams, material: CustomMaterial, quality: 'custom', resolution: 0.5, doubleSided: true }, color: 'partial-charge' }, { tag: 'polymer' }),
};
await update.commit({ revertOnError: true });
@@ -177,8 +183,8 @@ const PocketPreset = StructureRepresentationPresetProvider({
const { update, builder, typeParams } = StructureRepresentationPresetProvider.reprBuilder(plugin, params);
const representations = {
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, sizeFactor: 0.26 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
surroundings: builder.buildRepresentation(update, components.surroundings, { type: 'molecular-surface', typeParams: { ...typeParams, includeParent: true, quality: 'custom', resolution: 0.2, doubleSided: true }, color: 'partial-charge' }, { tag: 'surroundings' }),
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, material: CustomMaterial, sizeFactor: 0.26 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
surroundings: builder.buildRepresentation(update, components.surroundings, { type: 'molecular-surface', typeParams: { ...typeParams, material: CustomMaterial, includeParent: true, quality: 'custom', resolution: 0.2, doubleSided: true }, color: 'partial-charge' }, { tag: 'surroundings' }),
};
await update.commit({ revertOnError: true });
@@ -201,15 +207,15 @@ const InteractionsPreset = StructureRepresentationPresetProvider({
const components = {
ligand: await presetStaticComponent(plugin, structureCell, 'ligand'),
surroundings: await plugin.builders.structure.tryCreateComponentFromSelection(structureCell, ligandSurroundings, `surroundings`),
interactions: await plugin.builders.structure.tryCreateComponentFromSelection(structureCell, ligandPlusSurroundings, `interactions`)
interactions: await presetStaticComponent(plugin, structureCell, 'ligand'),
};
const { update, builder, typeParams } = StructureRepresentationPresetProvider.reprBuilder(plugin, params);
const representations = {
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, sizeFactor: 0.3 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
ballAndStick: builder.buildRepresentation(update, components.surroundings, { type: 'ball-and-stick', typeParams: { ...typeParams, sizeFactor: 0.1, sizeAspectRatio: 1 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ball-and-stick' }),
interactions: builder.buildRepresentation(update, components.interactions, { type: InteractionsRepresentationProvider, typeParams: { ...typeParams }, color: InteractionTypeColorThemeProvider }, { tag: 'interactions' }),
label: builder.buildRepresentation(update, components.surroundings, { type: 'label', typeParams: { ...typeParams, background: false, borderWidth: 0.1 }, color: 'uniform', colorParams: { value: Color(0x000000) } }, { tag: 'label' }),
ligand: builder.buildRepresentation(update, components.ligand, { type: 'ball-and-stick', typeParams: { ...typeParams, material: CustomMaterial, sizeFactor: 0.3 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ligand' }),
ballAndStick: builder.buildRepresentation(update, components.surroundings, { type: 'ball-and-stick', typeParams: { ...typeParams, material: CustomMaterial, sizeFactor: 0.1, sizeAspectRatio: 1 }, color: 'element-symbol', colorParams: { carbonColor: { name: 'element-symbol', params: {} } } }, { tag: 'ball-and-stick' }),
interactions: builder.buildRepresentation(update, components.interactions, { type: InteractionsRepresentationProvider, typeParams: { ...typeParams, material: CustomMaterial, includeParent: true, parentDisplay: 'between' }, color: InteractionTypeColorThemeProvider }, { tag: 'interactions' }),
label: builder.buildRepresentation(update, components.surroundings, { type: 'label', typeParams: { ...typeParams, material: CustomMaterial, background: false, borderWidth: 0.1 }, color: 'uniform', colorParams: { value: Color(0x000000) } }, { tag: 'label' }),
};
await update.commit({ revertOnError: true });
@@ -230,7 +236,7 @@ export class ViewportComponent extends PluginUIComponent {
set = async (preset: StructureRepresentationPresetProvider) => {
await this._set(this.plugin.managers.structure.hierarchy.selection.structures, preset);
}
};
structurePreset = () => this.set(StructurePreset);
illustrativePreset = () => this.set(IllustrativePreset);

View File

@@ -0,0 +1,280 @@
/**
* Copyright (c) 2022-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Mp4Export } from '../../extensions/mp4-export';
import { DataFormatProvider } from '../../mol-plugin-state/formats/provider';
import { createPluginUI } from '../../mol-plugin-ui';
import { renderReact18 } from '../../mol-plugin-ui/react18';
import { PluginUIContext } from '../../mol-plugin-ui/context';
import { DefaultPluginUISpec, PluginUISpec } from '../../mol-plugin-ui/spec';
import { PluginConfig } from '../../mol-plugin/config';
import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
import { PluginSpec } from '../../mol-plugin/spec';
import '../../mol-util/polyfill';
import { ObjectKeys } from '../../mol-util/type-helpers';
import { SaccharideCompIdMapType } from '../../mol-model/structure/structure/carbohydrates/constants';
import { Backgrounds } from '../../extensions/backgrounds';
import { LeftPanel, RightPanel } from './ui/panels';
import { Color } from '../../mol-util/color';
import { SpacefillRepresentationProvider } from '../../mol-repr/structure/representation/spacefill';
import { PluginBehaviors } from '../../mol-plugin/behavior';
import { MesoFocusLoci } from './behavior/camera';
import { GraphicsMode, MesoscaleState } from './data/state';
import { MesoSelectLoci } from './behavior/select';
import { Transparency } from '../../mol-gl/webgl/render-item';
import { LoadModel, loadExampleEntry, loadPdb, loadPdbDev, loadUrl, openState } from './ui/states';
import { Asset } from '../../mol-util/assets';
import { AnimateCameraSpin } from '../../mol-plugin-state/animation/built-in/camera-spin';
import { AnimateCameraRock } from '../../mol-plugin-state/animation/built-in/camera-rock';
import { AnimateStateSnapshots } from '../../mol-plugin-state/animation/built-in/state-snapshots';
export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
export { setDebugMode, setProductionMode, setTimingMode, consoleStats } from '../../mol-util/debug';
export type ExampleEntry = {
id: string,
label: string,
url: string,
type: 'molx' | 'molj' | 'cif' | 'bcif',
description?: string,
link?: string,
}
export type MesoscaleExplorerState = {
examples?: ExampleEntry[],
graphicsMode: GraphicsMode,
stateRef?: string,
stateCache: { [k: string]: any },
}
//
const Extensions = {
'backgrounds': PluginSpec.Behavior(Backgrounds),
'mp4-export': PluginSpec.Behavior(Mp4Export),
};
const DefaultMesoscaleExplorerOptions = {
customFormats: [] as [string, DataFormatProvider][],
extensions: ObjectKeys(Extensions),
layoutIsExpanded: true,
layoutShowControls: true,
layoutShowRemoteState: true,
layoutControlsDisplay: 'reactive' as PluginLayoutControlsDisplay,
layoutShowSequence: true,
layoutShowLog: true,
layoutShowLeftPanel: true,
collapseLeftPanel: false,
collapseRightPanel: false,
disableAntialiasing: PluginConfig.General.DisableAntialiasing.defaultValue,
pixelScale: PluginConfig.General.PixelScale.defaultValue,
pickScale: PluginConfig.General.PickScale.defaultValue,
transparency: 'blended' as Transparency,
preferWebgl1: PluginConfig.General.PreferWebGl1.defaultValue,
allowMajorPerformanceCaveat: PluginConfig.General.AllowMajorPerformanceCaveat.defaultValue,
powerPreference: PluginConfig.General.PowerPreference.defaultValue,
viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue,
viewportShowControls: PluginConfig.Viewport.ShowControls.defaultValue,
viewportShowSettings: PluginConfig.Viewport.ShowSettings.defaultValue,
viewportShowSelectionMode: false,
viewportShowAnimation: false,
viewportShowTrajectoryControls: false,
pluginStateServer: PluginConfig.State.DefaultServer.defaultValue,
volumeStreamingServer: PluginConfig.VolumeStreaming.DefaultServer.defaultValue,
volumeStreamingDisabled: !PluginConfig.VolumeStreaming.Enabled.defaultValue,
pdbProvider: PluginConfig.Download.DefaultPdbProvider.defaultValue,
emdbProvider: PluginConfig.Download.DefaultEmdbProvider.defaultValue,
saccharideCompIdMapType: 'default' as SaccharideCompIdMapType,
graphicsMode: 'quality' as GraphicsMode
};
type MesoscaleExplorerOptions = typeof DefaultMesoscaleExplorerOptions;
export class MesoscaleExplorer {
constructor(public plugin: PluginUIContext) {
}
async loadExample(id: string) {
const entries = (this.plugin.customState as MesoscaleExplorerState).examples || [];
const entry = entries.find(e => e.id === id);
if (entry !== undefined) {
await loadExampleEntry(this.plugin, entry);
}
}
async loadUrl(url: string, type: 'molx' | 'molj' | 'cif' | 'bcif') {
await loadUrl(this.plugin, url, type);
}
async loadPdb(id: string) {
await loadPdb(this.plugin, id);
}
async loadPdbDev(id: string) {
await loadPdbDev(this.plugin, id);
}
static async create(elementOrId: string | HTMLElement, options: Partial<MesoscaleExplorerOptions> = {}) {
const definedOptions = {} as any;
// filter for defined properies only so the default values
// are property applied
for (const p of Object.keys(options) as (keyof MesoscaleExplorerOptions)[]) {
if (options[p] !== void 0) definedOptions[p] = options[p];
}
const o: MesoscaleExplorerOptions = { ...DefaultMesoscaleExplorerOptions, ...definedOptions };
const defaultSpec = DefaultPluginUISpec();
const spec: PluginUISpec = {
actions: defaultSpec.actions,
behaviors: [
PluginSpec.Behavior(PluginBehaviors.Camera.CameraAxisHelper),
PluginSpec.Behavior(PluginBehaviors.Camera.CameraControls),
PluginSpec.Behavior(MesoFocusLoci),
PluginSpec.Behavior(MesoSelectLoci),
...o.extensions.map(e => Extensions[e]),
],
animations: [
AnimateCameraSpin,
AnimateCameraRock,
AnimateStateSnapshots,
],
customParamEditors: defaultSpec.customParamEditors,
customFormats: o?.customFormats,
layout: {
initial: {
isExpanded: o.layoutIsExpanded,
showControls: o.layoutShowControls,
controlsDisplay: o.layoutControlsDisplay,
regionState: {
bottom: 'full',
left: o.collapseLeftPanel ? 'collapsed' : 'full',
right: o.collapseRightPanel ? 'hidden' : 'full',
top: 'full',
}
},
},
components: {
...defaultSpec.components,
controls: {
...defaultSpec.components?.controls,
top: 'none',
bottom: 'none',
left: LeftPanel,
right: RightPanel,
},
remoteState: 'none',
},
config: [
[PluginConfig.General.DisableAntialiasing, o.disableAntialiasing],
[PluginConfig.General.PixelScale, o.pixelScale],
[PluginConfig.General.PickScale, o.pickScale],
[PluginConfig.General.Transparency, o.transparency],
[PluginConfig.General.PreferWebGl1, o.preferWebgl1],
[PluginConfig.General.AllowMajorPerformanceCaveat, o.allowMajorPerformanceCaveat],
[PluginConfig.General.PowerPreference, o.powerPreference],
[PluginConfig.Viewport.ShowExpand, o.viewportShowExpand],
[PluginConfig.Viewport.ShowControls, o.viewportShowControls],
[PluginConfig.Viewport.ShowSettings, o.viewportShowSettings],
[PluginConfig.Viewport.ShowSelectionMode, o.viewportShowSelectionMode],
[PluginConfig.Viewport.ShowAnimation, o.viewportShowAnimation],
[PluginConfig.Viewport.ShowTrajectoryControls, o.viewportShowTrajectoryControls],
[PluginConfig.State.DefaultServer, o.pluginStateServer],
[PluginConfig.State.CurrentServer, o.pluginStateServer],
[PluginConfig.VolumeStreaming.DefaultServer, o.volumeStreamingServer],
[PluginConfig.VolumeStreaming.Enabled, !o.volumeStreamingDisabled],
[PluginConfig.Download.DefaultPdbProvider, o.pdbProvider],
[PluginConfig.Download.DefaultEmdbProvider, o.emdbProvider],
[PluginConfig.Structure.SaccharideCompIdMapType, o.saccharideCompIdMapType],
]
};
const element = typeof elementOrId === 'string'
? document.getElementById(elementOrId)
: elementOrId;
if (!element) throw new Error(`Could not get element with id '${elementOrId}'`);
const plugin = await createPluginUI({
target: element,
spec,
render: renderReact18,
onBeforeUIRender: async plugin => {
let examples: MesoscaleExplorerState['examples'] = undefined;
try {
examples = await plugin.fetch({ url: './examples/list.json', type: 'json' }).run();
} catch (e) {
console.log(e);
}
(plugin.customState as MesoscaleExplorerState) = {
examples,
graphicsMode: o.graphicsMode,
stateCache: {},
};
await MesoscaleState.init(plugin);
}
});
plugin.canvas3d?.setProps({
renderer: {
backgroundColor: Color(0x101010),
},
cameraFog: { name: 'off', params: {} },
hiZ: { enabled: true },
});
plugin.representation.structure.registry.clear();
plugin.representation.structure.registry.add(SpacefillRepresentationProvider);
plugin.state.setSnapshotParams({
image: true,
componentManager: false,
structureSelection: true,
behavior: true,
});
plugin.managers.lociLabels.clearProviders();
plugin.managers.dragAndDrop.addHandler('mesoscale-explorer', (files) => {
const sessions = files.filter(f => {
const fn = f.name.toLowerCase();
return fn.endsWith('.molx') || fn.endsWith('.molj');
});
if (sessions.length > 0) {
openState(plugin, sessions[0]);
} else {
plugin.runTask(plugin.state.data.applyAction(LoadModel, {
files: files.map(f => Asset.File(f)),
}));
}
return true;
});
plugin.state.events.object.created.subscribe(e => {
(plugin.customState as MesoscaleExplorerState).stateCache = {};
});
plugin.state.events.object.removed.subscribe(e => {
(plugin.customState as MesoscaleExplorerState).stateCache = {};
});
return new MesoscaleExplorer(plugin);
}
handleResize() {
this.plugin.layout.events.updated.next(void 0);
}
dispose() {
this.plugin.dispose();
}
}

View File

@@ -0,0 +1,75 @@
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Loci } from '../../../mol-model/loci';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { PluginBehavior } from '../../../mol-plugin/behavior';
import { ButtonsType, ModifiersKeys } from '../../../mol-util/input/input-observer';
import { Binding } from '../../../mol-util/binding';
import { PluginCommands } from '../../../mol-plugin/commands';
import { Sphere3D } from '../../../mol-math/geometry';
const B = ButtonsType;
const M = ModifiersKeys;
const Trigger = Binding.Trigger;
const DefaultMesoFocusLociBindings = {
clickCenter: Binding([
Trigger(B.Flag.Primary, M.create()),
], 'Camera center', 'Click element using ${triggers}'),
clickCenterFocus: Binding([
Trigger(B.Flag.Secondary, M.create()),
], 'Camera center and focus', 'Click element using ${triggers}'),
};
const MesoFocusLociParams = {
minRadius: PD.Numeric(8, { min: 1, max: 50, step: 1 }),
extraRadius: PD.Numeric(4, { min: 1, max: 50, step: 1 }, { description: 'Value added to the bounding-sphere radius of the Loci' }),
durationMs: PD.Numeric(250, { min: 0, max: 1000, step: 1 }, { description: 'Camera transition duration' }),
centerOnly: PD.Boolean(true, { description: 'Keep current camera distance' }),
bindings: PD.Value(DefaultMesoFocusLociBindings, { isHidden: true }),
};
type MesoFocusLociProps = PD.Values<typeof MesoFocusLociParams>
export const MesoFocusLoci = PluginBehavior.create<MesoFocusLociProps>({
name: 'camera-meso-focus-loci',
category: 'interaction',
ctor: class extends PluginBehavior.Handler<MesoFocusLociProps> {
register(): void {
this.subscribeObservable(this.ctx.behaviors.interaction.click, ({ current, button, modifiers }) => {
const { canvas3d } = this.ctx;
if (!canvas3d) return;
const loci = Loci.normalize(current.loci, this.ctx.managers.interactivity.props.granularity);
const sphere = Loci.getBoundingSphere(loci) || Sphere3D();
const { clickCenter, clickCenterFocus } = this.params.bindings;
const { durationMs, extraRadius, minRadius } = this.params;
const radius = Math.max(sphere.radius + extraRadius, minRadius);
if (Binding.match(clickCenter, button, modifiers)) {
if (Loci.isEmpty(current.loci)) {
PluginCommands.Camera.Reset(this.ctx, { });
return;
}
const snapshot = canvas3d.camera.getCenter(sphere.center);
canvas3d.requestCameraReset({ durationMs, snapshot });
} else if (Binding.match(clickCenterFocus, button, modifiers)) {
if (Loci.isEmpty(current.loci)) {
PluginCommands.Camera.Reset(this.ctx, { });
return;
}
const snapshot = canvas3d.camera.getCenter(sphere.center, radius);
canvas3d.requestCameraReset({ durationMs, snapshot });
}
});
}
},
params: () => MesoFocusLociParams,
display: { name: 'Camera Meso Focus Loci on Canvas' }
});

View File

@@ -0,0 +1,164 @@
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { EveryLoci, Loci } from '../../../mol-model/loci';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { PluginBehavior } from '../../../mol-plugin/behavior';
import { ButtonsType, ModifiersKeys } from '../../../mol-util/input/input-observer';
import { Binding } from '../../../mol-util/binding';
import { PluginStateObject as SO } from '../../../mol-plugin-state/objects';
import { Structure, StructureElement } from '../../../mol-model/structure';
import { StateSelection } from '../../../mol-state';
import { StateTreeSpine } from '../../../mol-state/tree/spine';
import { Representation } from '../../../mol-repr/representation';
import { MarkerAction } from '../../../mol-util/marker-action';
import { PluginContext } from '../../../mol-plugin/context';
const B = ButtonsType;
const M = ModifiersKeys;
const Trigger = Binding.Trigger;
const DefaultMesoSelectLociBindings = {
clickToggleSelect: Binding([
Trigger(B.Flag.Primary, M.create({ shift: true })),
Trigger(B.Flag.Primary, M.create({ control: true })),
], 'Toggle select', 'Click element using ${triggers}'),
hoverHighlightOnly: Binding([
Trigger(B.Flag.None, M.create({ shift: true })),
Trigger(B.Flag.None, M.create({ control: true })),
], 'Highlight', 'Hover element using ${triggers}'),
};
const MesoSelectLociParams = {
bindings: PD.Value(DefaultMesoSelectLociBindings, { isHidden: true }),
};
type MesoSelectLociProps = PD.Values<typeof MesoSelectLociParams>
export const MesoSelectLoci = PluginBehavior.create<MesoSelectLociProps>({
name: 'camera-meso-select-loci',
category: 'interaction',
ctor: class extends PluginBehavior.Handler<MesoSelectLociProps> {
private spine: StateTreeSpine.Impl;
private lociMarkProvider = (interactionLoci: Representation.Loci, action: MarkerAction) => {
if (!this.ctx.canvas3d) return;
this.ctx.canvas3d.mark(interactionLoci, action);
};
private applySelectMark(ref: string, clear?: boolean) {
const cell = this.ctx.state.data.cells.get(ref);
if (cell && SO.isRepresentation3D(cell.obj)) {
this.spine.current = cell;
const so = this.spine.getRootOfType(SO.Molecule.Structure);
if (so) {
if (clear) {
this.lociMarkProvider({ loci: Structure.Loci(so.data) }, MarkerAction.Deselect);
}
const loci = this.ctx.managers.structure.selection.getLoci(so.data);
this.lociMarkProvider({ loci }, MarkerAction.Select);
}
}
}
register(): void {
this.subscribeObservable(this.ctx.behaviors.interaction.click, ({ current, button, modifiers }) => {
if (!this.ctx.canvas3d || this.ctx.isBusy) return;
const { clickToggleSelect } = this.params.bindings;
if (Binding.match(clickToggleSelect, button, modifiers)) {
if (Loci.isEmpty(current.loci)) {
this.ctx.managers.interactivity.lociSelects.deselectAll();
return;
}
const loci = Loci.normalize(current.loci, modifiers.control ? 'entity' : 'chain');
this.ctx.managers.interactivity.lociSelects.toggle({ loci }, false);
}
});
this.ctx.managers.interactivity.lociSelects.addProvider(this.lociMarkProvider);
this.subscribeObservable(this.ctx.behaviors.interaction.hover, ({ current, button, modifiers }) => {
if (!this.ctx.canvas3d || this.ctx.isBusy) return;
const pointerLock = !!this.ctx.canvas3dContext?.input.pointerLock;
const { hoverHighlightOnly } = this.params.bindings;
if (!pointerLock && Binding.match(hoverHighlightOnly, button, modifiers)) {
if (Loci.isEmpty(current.loci)) {
this.ctx.managers.interactivity.lociHighlights.clearHighlights();
return;
}
if (modifiers.control) {
this.ctx.managers.interactivity.lociHighlights.highlightOnly({ repr: current.repr, loci: EveryLoci }, false);
} else {
const loci = Loci.normalize(current.loci, 'chain');
this.ctx.managers.interactivity.lociHighlights.highlightOnly({ repr: current.repr, loci }, false);
}
}
if (Loci.isEmpty(current.loci)) {
this.ctx.behaviors.labels.highlight.next({ labels: [] });
} else {
const labels: string[] = [];
if (StructureElement.Loci.is(current.loci)) {
const cell = this.ctx.helpers.substructureParent.get(current.loci.structure);
labels.push(cell?.obj?.label || 'Unknown');
}
this.ctx.behaviors.labels.highlight.next({ labels });
}
});
this.ctx.managers.interactivity.lociHighlights.addProvider(this.lociMarkProvider);
let dimDisabled = false;
this.subscribeObservable(this.ctx.behaviors.interaction.keyReleased, ({ code, modifiers }) => {
if (!this.ctx.canvas3d) return;
if ((code.startsWith('Shift') && !modifiers.control) || (code.startsWith('Control') && !modifiers.shift)) {
if (dimDisabled) {
dimDisabled = false;
this.ctx.canvas3d?.setProps({ renderer: { dimStrength: 1 } }, true);
}
this.ctx.managers.interactivity.lociHighlights.clearHighlights();
}
});
this.subscribeObservable(this.ctx.behaviors.interaction.key, ({ modifiers }) => {
if (!this.ctx.canvas3d) return;
if (!dimDisabled && modifiers.control && modifiers.shift) {
dimDisabled = true;
this.ctx.canvas3d?.setProps({ renderer: { dimStrength: 0 } });
}
});
this.subscribeObservable(this.ctx.state.events.object.created, ({ ref }) => this.applySelectMark(ref));
// re-apply select-mark to all representation of an updated structure
this.subscribeObservable(this.ctx.state.events.object.updated, ({ ref, obj, oldObj, oldData, action }) => {
const cell = this.ctx.state.data.cells.get(ref);
if (cell && SO.Molecule.Structure.is(cell.obj)) {
const structure: Structure = obj.data;
const oldStructure: Structure | undefined = action === 'recreate' ? oldObj?.data :
action === 'in-place' ? oldData : undefined;
if (oldStructure &&
Structure.areEquivalent(structure, oldStructure) &&
Structure.areHierarchiesEqual(structure, oldStructure)) return;
const reprs = this.ctx.state.data.select(StateSelection.children(ref).ofType(SO.Molecule.Structure.Representation3D));
for (const repr of reprs) this.applySelectMark(repr.transform.ref, true);
}
});
}
unregister() {
this.ctx.managers.interactivity.lociSelects.removeProvider(this.lociMarkProvider);
this.ctx.managers.interactivity.lociHighlights.removeProvider(this.lociMarkProvider);
}
constructor(ctx: PluginContext, params: MesoSelectLociProps) {
super(ctx, params);
this.spine = new StateTreeSpine.Impl(ctx.state.data.cells);
}
},
params: () => MesoSelectLociParams,
display: { name: 'Camera Meso Select Loci on Canvas' }
});

View File

@@ -0,0 +1,178 @@
/**
* Copyright (c) 2019-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author Ludovic Autin <ludovic.autin@gmail.com>
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { SortedArray } from '../../../../mol-data/int';
import { SymmetryOperator } from '../../../../mol-math/geometry';
import { Mat4 } from '../../../../mol-math/linear-algebra';
import { ModelSymmetry } from '../../../../mol-model-formats/structure/property/symmetry';
import { CustomStructureProperty } from '../../../../mol-model-props/common/custom-structure-property';
import { ElementIndex, EntityIndex, Model, Structure, Unit } from '../../../../mol-model/structure';
import { Assembly, Symmetry } from '../../../../mol-model/structure/model/properties/symmetry';
import { PluginStateObject as PSO, PluginStateTransform } from '../../../../mol-plugin-state/objects';
import { PluginContext } from '../../../../mol-plugin/context';
import { Task } from '../../../../mol-task';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
function createModelChainMap(model: Model) {
const builder = new Structure.StructureBuilder();
const units = new Map<string, Unit>();
const { label_asym_id, _rowCount } = model.atomicHierarchy.chains;
const { offsets } = model.atomicHierarchy.chainAtomSegments;
for (let i = 0; i < _rowCount; i++) {
const elements = SortedArray.ofBounds(offsets[i] as ElementIndex, offsets[i + 1] as ElementIndex);
const unit = builder.addUnit(Unit.Kind.Atomic, model, SymmetryOperator.Default, elements, Unit.Trait.FastBoundary);
units.set(label_asym_id.value(i), unit);
}
return units;
}
function buildCellpackAssembly(model: Model, assembly: Assembly) {
const coordinateSystem = SymmetryOperator.create(assembly.id, Mat4.identity(), { assembly: { id: assembly.id, operId: 0, operList: [] } });
const assembler = Structure.Builder({
coordinateSystem,
label: model.label,
});
const units = createModelChainMap(model);
for (const g of assembly.operatorGroups) {
for (const oper of g.operators) {
for (const id of g.asymIds!) {
const u = units.get(id);
if (u) {
assembler.addWithOperator(u, oper);
} else {
console.log(`missing asymId '${id}'`);
}
}
}
}
return assembler.getStructure();
}
export { CellpackAssembly };
type CellpackAssembly = typeof CellpackAssembly
const CellpackAssembly = PluginStateTransform.BuiltIn({
name: 'cellpack-assembly',
display: { name: 'Cellpack Assembly' },
from: PSO.Molecule.Model,
to: PSO.Molecule.Structure,
params: {
id: PD.Text('', { label: 'Asm Id', description: 'Assembly Id (use empty for the 1st assembly)' }),
}
})({
canAutoUpdate({ newParams }) {
return true;
},
apply({ a, params }, plugin: PluginContext) {
return Task.create('Build Structure', async ctx => {
const model = a.data;
let id = params.id;
let asm: Assembly | undefined = void 0;
const symmetry = ModelSymmetry.Provider.get(model);
// if no id is specified, use the 1st assembly.
if (!id && symmetry && symmetry.assemblies.length !== 0) {
id = symmetry.assemblies[0].id;
}
if (!symmetry || symmetry.assemblies.length === 0) {
plugin.log.warn(`Model '${model.entryId}' has no assembly, returning model structure.`);
} else {
asm = Symmetry.findAssembly(model, id || '');
if (!asm) {
plugin.log.warn(`Model '${model.entryId}' has no assembly called '${id}', returning model structure.`);
}
}
const base = Structure.ofModel(model);
if (!asm) {
const label = { label: 'Model', description: Structure.elementDescription(base) };
return new PSO.Molecule.Structure(base, label);
}
const s = buildCellpackAssembly(model, asm);
const objProps = { label: `Assembly ${id}`, description: Structure.elementDescription(s) };
return new PSO.Molecule.Structure(s, objProps);
});
},
dispose({ b }) {
b?.data.customPropertyDescriptors.dispose();
}
});
type UnitsByEntity = Map<EntityIndex, Unit[]>;
const UnitsByEntity = CustomStructureProperty.createSimple<UnitsByEntity>('units_by_entity', 'root');
function getUnitsByEntity(structure: Structure): UnitsByEntity {
if (UnitsByEntity.get(structure).value) {
return UnitsByEntity.get(structure).value!;
}
const atomicIndex = structure.model.atomicHierarchy.index;
const map: UnitsByEntity = new Map();
for (const ug of structure.unitSymmetryGroups) {
const u = ug.units[0] as Unit.Atomic;
const e = atomicIndex.getEntityFromChain(u.chainIndex[u.elements[0]]);
if (!map.has(e)) map.set(e, []);
const entityUnits = map.get(e)!;
for (let i = 0, il = ug.units.length; i < il; ++i) {
entityUnits.push(ug.units[i]);
}
}
UnitsByEntity.set(structure, { value: map }, map);
return map;
}
export { CellpackStructure };
type CellpackStructure = typeof CellpackStructure
const CellpackStructure = PluginStateTransform.BuiltIn({
name: 'cellpack-structure',
display: { name: 'Cellpack Structure' },
from: PSO.Root,
to: PSO.Molecule.Structure,
params: {
structureRef: PD.Text(''),
entityId: PD.Text('')
}
})({
canAutoUpdate({ newParams }) {
return true;
},
apply({ a, params, dependencies }) {
return Task.create('Build Structure', async ctx => {
const parent = dependencies![params.structureRef].data as Structure;
const { entities } = parent.model;
const idx = entities.getEntityIndex(params.entityId);
const unitsByEntity = getUnitsByEntity(parent);
const units = unitsByEntity.get(idx) || [];
// if (!unitsByEntity.get(idx)) {
// console.log(entities.data.pdbx_description.value(idx));
// }
const structure = Structure.create(units);
const description = entities.data.pdbx_description.value(idx)[0] || 'model';
const label = description.split('.').at(-1) || a.label;
return new PSO.Molecule.Structure(structure, { label, description: `${a.description}` });
});
},
dispose({ b }) {
b?.data.customPropertyDescriptors.dispose();
}
});

View File

@@ -0,0 +1,227 @@
/**
* Copyright (c) 2019-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author Ludovic Autin <ludovic.autin@gmail.com>
*/
import { PluginStateObject } from '../../../../mol-plugin-state/objects';
import { StructureRepresentation3D } from '../../../../mol-plugin-state/transforms/representation';
import { PluginContext } from '../../../../mol-plugin/context';
import { SpacefillRepresentationProvider } from '../../../../mol-repr/structure/representation/spacefill';
import { StateObjectRef, StateObjectSelector, StateBuilder } from '../../../../mol-state';
import { Color } from '../../../../mol-util/color';
import { ColorNames } from '../../../../mol-util/color/names';
import { GraphicsMode, MesoscaleGroup, MesoscaleState, getDistinctBaseColors, getDistinctGroupColors, getGraphicsModeProps, getMesoscaleGroupParams } from '../state';
import { CellpackAssembly, CellpackStructure } from './model';
function getSpacefillParams(color: Color, sizeFactor: number, graphics: GraphicsMode, merge?: boolean) {
const gmp = getGraphicsModeProps(graphics === 'custom' ? 'quality' : graphics);
return {
type: {
name: 'spacefill',
params: {
...SpacefillRepresentationProvider.defaultValues,
ignoreHydrogens: false,
instanceGranularity: true,
ignoreLight: true,
lodLevels: gmp.lodLevels,
quality: 'lowest', // avoid 'auto', triggers boundary calc
sizeFactor,
clip: {
variant: merge ? 'pixel' : 'instance',
objects: [],
},
clipPrimitive: true,
approximate: gmp.approximate,
alphaThickness: gmp.alphaThickness,
visuals: [merge ? 'structure-element-sphere' : 'element-sphere'],
},
},
colorTheme: {
name: 'uniform',
params: {
value: color,
saturation: 0,
lightness: 0,
}
},
sizeTheme: {
name: 'physical',
params: {
value: 1,
}
},
};
}
function getSizeFactor(name: string): number {
switch (name) {
case 'dLDL':
return 2.5;
case 'iLDL':
return 5;
case 'NP_CA':
case 'POL_CA':
case 'FactorH1':
case 'iIgM_Antibody_5mer':
// case 'MG_271_272_273_274_192MER': // has a coarse and an atomic part
return 2;
default: return 1;
}
}
export async function createCellpackHierarchy(plugin: PluginContext, trajectory: StateObjectRef<PluginStateObject.Molecule.Trajectory>) {
const builder = plugin.builders.structure;
const state = plugin.state.data;
const model = await builder.createModel(trajectory, { modelIndex: 0 });
const entities = model.data!.entities.data;
const compGroups = new Map<string, StateObjectSelector>();
const compIds = new Map<string, { idx: number, members: Map<string, number> }>();
const compColors = new Map<string, Color[]>();
const funcGroups = new Map<string, StateObjectSelector>();
const funcIds = new Map<string, { idx: number, size: number }>();
const funcColors = new Map<string, Color[]>();
const graphicsMode = MesoscaleState.get(plugin).graphics;
const groupParams = getMesoscaleGroupParams(graphicsMode);
const base = await state.build()
.to(model)
.apply(CellpackAssembly, { id: '' })
.commit();
const compRoot = await state.build()
.toRoot()
.applyOrUpdateTagged('group:comp:', MesoscaleGroup, { ...groupParams, root: true, index: -1, tag: `comp:`, label: 'compartment', color: { type: 'custom', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: 'group:comp:', state: { isCollapsed: false, isHidden: groupParams.hidden } })
.commit();
const funcRoot = await state.build()
.toRoot()
.applyOrUpdateTagged('group:func:', MesoscaleGroup, { ...groupParams, root: true, index: -1, tag: `func:`, label: 'function', color: { type: 'custom', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: 'group:func:', state: { isCollapsed: false, isHidden: groupParams.hidden } })
.commit();
if (entities._rowCount > 1) {
for (let i = 0; i < entities._rowCount; i++) {
const description = entities.pdbx_description.value(i)[0] || 'unknown compartment';
const d = description.split('.');
const n = d.slice(0, -1).join('.');
const l = d.at(-1)!;
if (!compIds.has(n)) {
compIds.set(n, { idx: compIds.size, members: new Map() });
}
const cm = compIds.get(n)!;
cm.members.set(l, cm.members.size);
const f = entities.details.value(i) || 'unknown function';
if (!funcIds.has(f)) {
funcIds.set(f, { idx: funcIds.size, size: 0 });
}
funcIds.get(f)!.size += 1;
}
//
const baseCompColors = getDistinctBaseColors(compIds.size, 0);
const compIdEntries = Array.from(compIds.entries());
for (let i = 0; i < compIdEntries.length; ++i) {
const [n, m] = compIdEntries[i];
const groupColors = getDistinctGroupColors(m.members.size, baseCompColors[i], 20, 0);
compColors.set(n, groupColors);
}
//
const baseFuncColors = getDistinctBaseColors(funcIds.size, 0);
const funcIdEntries = Array.from(funcIds.entries());
for (let i = 0; i < funcIdEntries.length; ++i) {
const [n, m] = funcIdEntries[i];
const groupColors = getDistinctGroupColors(m.size, baseFuncColors[i], 20, 0);
funcColors.set(n, groupColors);
}
//
for (let i = 0; i < entities._rowCount; i++) {
const description = entities.pdbx_description.value(i)[0] || 'unknown compartment';
const nodes = description.split('.');
for (let j = 0, jl = nodes.length - 1; j < jl; ++j) {
const n = nodes.slice(0, j + 1).join('.');
const p = nodes.slice(0, j).join('.');
if (!compGroups.has(n)) {
const colorIdx = compIds.get(n)?.idx;
const color = colorIdx !== undefined ? baseCompColors[colorIdx] : ColorNames.white;
const label = nodes[j];
const parent = compGroups.get(p) ?? compRoot;
parent.cell!.state.isCollapsed = false;
const group = await state.build()
.to(parent)
.applyOrUpdateTagged(`group:comp:${n}`, MesoscaleGroup, { ...groupParams, root: parent === compRoot, index: colorIdx, tag: `comp:${n}`, label, color: { type: 'generate', value: color, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: `comp:${p}`, state: { isCollapsed: true, isHidden: groupParams.hidden } })
.commit({ revertOnError: true });
compGroups.set(n, group);
}
}
const f = entities.details.value(i) || 'unknown function';
if (!funcGroups.has(f)) {
const colorIdx = funcIds.get(f)?.idx;
const color = colorIdx !== undefined ? baseFuncColors[colorIdx] : ColorNames.white;
const group = await state.build()
.to(funcRoot)
.applyOrUpdateTagged(`group:func:${f}`, MesoscaleGroup, { ...groupParams, index: colorIdx, tag: `func:${f}`, label: f, color: { type: 'custom', value: color, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: 'func:', state: { isCollapsed: true, isHidden: groupParams.hidden } })
.commit({ revertOnError: true });
funcGroups.set(f, group);
}
}
//
await state.transaction(async () => {
try {
const dependsOn = [base.ref];
plugin.animationLoop.stop({ noDraw: true });
let build: StateBuilder.Root | StateBuilder.To<any> = state.build();
for (let i = 0; i < entities._rowCount; i++) {
const description = entities.pdbx_description.value(i)[0] || 'model';
const d = description.split('.');
const n = d.slice(0, -1).join('.');
const l = d.at(-1)!;
const f = entities.details.value(i) || 'unknown function';
const color = compColors.get(n)![compIds.get(n)!.members.get(l)!];
const sizeFactor = getSizeFactor(l);
build = build
.toRoot()
.apply(CellpackStructure, { structureRef: base.ref, entityId: entities.id.value(i) }, { dependsOn })
.apply(StructureRepresentation3D, getSpacefillParams(color, sizeFactor, graphicsMode), { tags: [`comp:${n}`, `func:${f}`] });
}
await build.commit();
} catch (e) {
console.error(e);
plugin.log.error(e);
} finally {
plugin.animationLoop.start();
}
}).run();
} else {
const dependsOn = [base.ref];
const merge = (
base.data &&
base.data.model.entities.data._rowCount === 1 &&
base.data.unitSymmetryGroups.length > 100 &&
base.data.unitSymmetryGroups.some(usg => usg.units.length > 1)
);
await state.build()
.toRoot()
.apply(CellpackStructure, { structureRef: base.ref, entityId: entities.id.value(0) }, { dependsOn })
.apply(StructureRepresentation3D, getSpacefillParams(ColorNames.lightgray, 1, graphicsMode, merge), { tags: [`comp:`, `func:`] })
.commit();
}
}

View File

@@ -0,0 +1,139 @@
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Mat4 } from '../../../../mol-math/linear-algebra/3d/mat4';
import { ElementIndex, Model, Structure, Unit } from '../../../../mol-model/structure';
import { PluginStateObject as SO, PluginStateTransform } from '../../../../mol-plugin-state/objects';
import { Task } from '../../../../mol-task';
import { StateObject, StateTransformer } from '../../../../mol-state';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
import { SymmetryOperator } from '../../../../mol-math/geometry';
import { mergeUnits, partitionUnits } from '../util';
import { Assembly, Symmetry } from '../../../../mol-model/structure/model/properties/symmetry';
import { ModelSymmetry } from '../../../../mol-model-formats/structure/property/symmetry';
import { SortedArray } from '../../../../mol-data/int';
import { GenericInstances, getTransforms } from './preset';
import { Asset } from '../../../../mol-util/assets';
import { PluginContext } from '../../../../mol-plugin/context';
import { deepEqual } from '../../../../mol-util';
function createModelChainMap(model: Model) {
const builder = new Structure.StructureBuilder();
const units = new Map<string, Unit>();
const { label_asym_id, _rowCount } = model.atomicHierarchy.chains;
const { offsets } = model.atomicHierarchy.chainAtomSegments;
for (let i = 0; i < _rowCount; i++) {
const elements = SortedArray.ofBounds(offsets[i] as ElementIndex, offsets[i + 1] as ElementIndex);
const unit = builder.addUnit(Unit.Kind.Atomic, model, SymmetryOperator.Default, elements, Unit.Trait.FastBoundary);
units.set(label_asym_id.value(i), unit);
}
return units;
}
function buildAssembly(model: Model, assembly: Assembly) {
const coordinateSystem = SymmetryOperator.create(assembly.id, Mat4.identity(), { assembly: { id: assembly.id, operId: 0, operList: [] } });
const assembler = Structure.Builder({
coordinateSystem,
label: model.label,
});
const units = createModelChainMap(model);
for (const g of assembly.operatorGroups) {
for (const oper of g.operators) {
for (const id of g.asymIds!) {
const u = units.get(id);
if (u) {
assembler.addWithOperator(u, oper);
} else {
console.log(`missing asymId '${id}'`);
}
}
}
}
return assembler.getStructure();
}
const EmptyInstances: GenericInstances<Asset> = {
positions: { data: [] },
rotations: { variant: 'euler', data: [] }
};
export { StructureFromGeneric };
type StructureFromGeneric = typeof StructureFromGeneric
const StructureFromGeneric = PluginStateTransform.BuiltIn({
name: 'structure-from-generic',
display: { name: 'Structure from Generic', description: 'Create a molecular structure from Generic models.' },
from: SO.Molecule.Model,
to: SO.Molecule.Structure,
params: {
instances: PD.Value<GenericInstances<Asset>>(EmptyInstances),
label: PD.Optional(PD.Text('')),
cellSize: PD.Numeric(500, { min: 0, max: 10000, step: 100 }),
}
})({
apply({ a, params }, plugin: PluginContext) {
return Task.create('Build Structure', async ctx => {
const transforms = await getTransforms(plugin, params.instances);
if (transforms.length === 0) return StateObject.Null;
const model = a.data;
const label = params.label || model.label;
const base = Structure.ofModel(a.data);
let structure: Structure;
if (transforms.length === 1 && Mat4.isIdentity(transforms[0])) {
const symmetry = ModelSymmetry.Provider.get(model);
const id = symmetry?.assemblies[0]?.id;
const asm = Symmetry.findAssembly(model, id || '');
if (asm) {
structure = buildAssembly(model, asm);
} else {
const mergedUnits = partitionUnits(base.units, params.cellSize);
structure = Structure.create(mergedUnits, { label });
}
} else {
const assembler = Structure.Builder({ label });
const unit = mergeUnits(base.units, 0);
for (let i = 0, il = transforms.length; i < il; ++i) {
const t = transforms[i];
const op = SymmetryOperator.create(`op-${i}`, t);
assembler.addWithOperator(unit, op);
}
structure = assembler.getStructure();
}
const props = { label, description: Structure.elementDescription(structure) };
return new SO.Molecule.Structure(structure, props);
});
},
update({ newParams, oldParams }, plugin: PluginContext) {
if (deepEqual(newParams, oldParams)) {
return StateTransformer.UpdateResult.Unchanged;
}
if (oldParams.instances) releaseInstances(plugin, oldParams.instances);
return StateTransformer.UpdateResult.Recreate;
},
dispose({ b, params }, plugin: PluginContext) {
b?.data.customPropertyDescriptors.dispose();
if (params?.instances) releaseInstances(plugin, params.instances);
}
});
function releaseInstances(plugin: PluginContext, instances: GenericInstances<Asset>) {
if (!Array.isArray(instances.positions.data)) {
plugin.managers.asset.release(instances.positions.data.file);
}
if (!Array.isArray(instances.rotations.data)) {
plugin.managers.asset.release(instances.rotations.data.file);
}
}

View File

@@ -0,0 +1,581 @@
/**
* Copyright (c) 2023-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Mat4 } from '../../../../mol-math/linear-algebra/3d/mat4';
import { StateBuilder, StateObjectSelector } from '../../../../mol-state';
import { PluginContext } from '../../../../mol-plugin/context';
import { SpacefillRepresentationProvider } from '../../../../mol-repr/structure/representation/spacefill';
import { Color } from '../../../../mol-util/color';
import { utf8Read } from '../../../../mol-io/common/utf8';
import { Mat3, Quat, Vec3 } from '../../../../mol-math/linear-algebra';
import { GraphicsMode, MesoscaleGroup, MesoscaleState, getGraphicsModeProps, getMesoscaleGroupParams, updateColors } from '../state';
import { ColorNames } from '../../../../mol-util/color/names';
import { ShapeRepresentation3D, StructureRepresentation3D } from '../../../../mol-plugin-state/transforms/representation';
import { ParseCif, ParsePly, ReadFile } from '../../../../mol-plugin-state/transforms/data';
import { ModelFromTrajectory, ShapeFromPly, TrajectoryFromGRO, TrajectoryFromMOL, TrajectoryFromMOL2, TrajectoryFromMmCif, TrajectoryFromPDB, TrajectoryFromSDF, TrajectoryFromXYZ } from '../../../../mol-plugin-state/transforms/model';
import { Euler } from '../../../../mol-math/linear-algebra/3d/euler';
import { Asset } from '../../../../mol-util/assets';
import { Clip } from '../../../../mol-util/clip';
import { StructureFromGeneric } from './model';
import { getFileNameInfo } from '../../../../mol-util/file-info';
import { NumberArray } from '../../../../mol-util/type-helpers';
import { BaseGeometry } from '../../../../mol-geo/geometry/base';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
function getSpacefillParams(color: Color, sizeFactor: number, graphics: GraphicsMode, clipVariant: Clip.Variant) {
const gmp = getGraphicsModeProps(graphics === 'custom' ? 'quality' : graphics);
return {
type: {
name: 'spacefill',
params: {
...SpacefillRepresentationProvider.defaultValues,
ignoreHydrogens: true,
instanceGranularity: true,
ignoreLight: true,
lodLevels: gmp.lodLevels.map(l => {
return {
...l,
stride: Math.max(1, Math.round(l.stride / Math.pow(sizeFactor, l.scaleBias)))
};
}),
quality: 'lowest', // avoid 'auto', triggers boundary calc
sizeFactor,
clip: {
variant: clipVariant,
objects: [],
},
clipPrimitive: true,
approximate: gmp.approximate,
alphaThickness: gmp.alphaThickness,
},
},
colorTheme: {
name: 'uniform',
params: {
value: color,
saturation: 0,
lightness: 0,
}
},
sizeTheme: {
name: 'physical',
params: {
scale: 1,
}
},
};
}
function getPlyShapeParams(color: Color, clipVariant: Clip.Variant) {
return {
...PD.getDefaultValues(BaseGeometry.Params),
instanceGranularity: true,
ignoreLight: true,
clip: {
variant: clipVariant,
objects: [],
},
quality: 'custom',
doubleSided: true,
coloring: {
name: 'uniform',
params: { color }
},
grouping: {
name: 'none',
params: {}
},
material: {
metalness: 0.0,
roughness: 1.0,
bumpiness: 1.0,
},
bumpAmplitude: 0.1,
bumpFrequency: 0.1 / 10,
};
}
export async function createGenericHierarchy(plugin: PluginContext, file: Asset.File) {
const asset = await plugin.runTask(plugin.managers.asset.resolve(file, 'zip'));
let manifest: GenericManifest;
// TODO: remove special handling for martini prototype
if (asset.data['instanced_structure.json']) {
const d = asset.data['instanced_structure.json'];
const t = utf8Read(d, 0, d.length);
const martini = JSON.parse(t) as { model: string, positions: Vec3[], rotations: Vec3[], function: string }[];
console.log(martini);
manifest = martiniToGeneric(martini);
} else if (asset.data['manifest.json']) {
const d = asset.data['manifest.json'];
const t = utf8Read(d, 0, d.length);
manifest = JSON.parse(t) as GenericManifest;
} else {
throw new Error('no manifest found');
}
console.log(manifest);
const state = plugin.state.data;
const graphicsMode = MesoscaleState.get(plugin).graphics;
const groupParams = getMesoscaleGroupParams(graphicsMode);
async function addGroup(g: GenericGroup, cell: StateObjectSelector, parent: string) {
const group = await state.build()
.to(cell)
.apply(MesoscaleGroup, { ...groupParams, index: undefined, tag: `${g.root}:${g.id}`, label: g.label || g.id, color: { type: 'custom', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: [`group:${g.root}:${g.id}`, g.root === parent ? `${g.root}:` : `${g.root}:${parent}`], state: { isCollapsed: true, isHidden: groupParams.hidden } })
.commit();
if (g.children) {
for (const c of g.children) {
await addGroup(c, group, g.id);
}
}
}
for (const r of manifest.roots) {
const root = await state.build()
.toRoot()
.apply(MesoscaleGroup, { ...groupParams, root: true, index: -1, tag: `${r.id}:`, label: r.label || r.id, color: { type: 'custom', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: `group:${r.id}:`, state: { isCollapsed: false, isHidden: groupParams.hidden } })
.commit();
if (r.children) {
for (const c of r.children!) {
await addGroup(c, root, r.id);
}
}
}
const transformAssets = new Map<string, Asset>();
const getTransformAsset = (file: string) => {
if (!transformAssets.has(file)) {
const d = asset.data[file];
transformAssets.set(file, Asset.File(new File([d], file)));
}
return transformAssets.get(file)!;
};
const getAssetInstances = (instances: GenericInstances<string>): GenericInstances<Asset> => {
return {
positions: {
data: Array.isArray(instances.positions.data)
? instances.positions.data
: {
file: getTransformAsset(instances.positions.data.file),
view: instances.positions.data.view,
},
type: instances.positions.type,
},
rotations: {
data: Array.isArray(instances.rotations.data)
? instances.rotations.data
: {
file: getTransformAsset(instances.rotations.data.file),
view: instances.rotations.data.view,
},
variant: instances.rotations.variant,
type: instances.rotations.type,
}
};
};
await state.transaction(async () => {
try {
plugin.animationLoop.stop({ noDraw: true });
let build: StateBuilder.Root | StateBuilder.To<any> = state.build();
for (const ent of manifest.entities) {
const d = asset.data[ent.file];
const info = getFileNameInfo(ent.file);
const isBinary = ['bcif'].includes(info.ext);
const t = isBinary ? d : utf8Read(d, 0, d.length);
const file = Asset.File(new File([t], ent.file));
const color = ColorNames.skyblue;
const label = ent.label || ent.file.split('.')[0];
const sizeFactor = ent.sizeFactor || 1;
const tags = ent.groups.map(({ id, root }) => `${root}:${id}`);
const instances = ent.instances && getAssetInstances(ent.instances);
build = build
.toRoot()
.apply(ReadFile, { file, label, isBinary });
if (['gro', 'cif', 'mmcif', 'mcif', 'bcif', 'pdb', 'ent', 'xyz', 'mol', 'sdf', 'sd', 'mol2'].includes(info.ext)) {
if (['gro'].includes(info.ext)) {
build = build.apply(TrajectoryFromGRO);
} else if (['cif', 'mmcif', 'mcif', 'bcif'].includes(info.ext)) {
build = build.apply(ParseCif).apply(TrajectoryFromMmCif);
} else if (['pdb', 'ent'].includes(info.ext)) {
build = build.apply(TrajectoryFromPDB);
} else if (['xyz'].includes(info.ext)) {
build = build.apply(TrajectoryFromXYZ);
} else if (['mol'].includes(info.ext)) {
build = build.apply(TrajectoryFromMOL);
} else if (['sdf', 'sd'].includes(info.ext)) {
build = build.apply(TrajectoryFromSDF);
} else if (['mol2'].includes(info.ext)) {
build = build.apply(TrajectoryFromMOL2);
}
let clipVariant: Clip.Variant = 'pixel';
if (ent.instances) {
if (Array.isArray(ent.instances.positions.data)) {
clipVariant = ent.instances.positions.data.length <= 3 ? 'pixel' : 'instance';
} else {
const byteLength = ent.instances.positions.data.view
? ent.instances.positions.data.view.byteLength
: asset.data[ent.instances.positions.data.file].length;
clipVariant = byteLength <= 3 * 4 ? 'pixel' : 'instance';
}
}
build = build
.apply(ModelFromTrajectory, { modelIndex: 0 })
.apply(StructureFromGeneric, { instances, label })
.apply(StructureRepresentation3D, getSpacefillParams(color, sizeFactor, graphicsMode, clipVariant), { tags });
} else if (['ply'].includes(info.ext)) {
if (['ply'].includes(info.ext)) {
const transforms = await getTransforms(plugin, instances);
const clipVariant = transforms.length === 1 ? 'pixel' : 'instance';
build = build
.apply(ParsePly)
.apply(ShapeFromPly, { label, transforms })
.apply(ShapeRepresentation3D, getPlyShapeParams(color, clipVariant), { tags });
}
} else {
console.warn(`unknown file format '${info.ext}'`);
}
}
await build.commit();
const rootId = `${manifest.roots[0].id}:`;
const values = { type: 'group-generate', value: ColorNames.white, lightness: 0, alpha: 1 };
await updateColors(plugin, values, rootId, '');
} catch (e) {
console.error(e);
plugin.log.error(e);
} finally {
plugin.animationLoop.start();
}
}).run();
asset.dispose();
}
//
type GenericRoot = {
id: string
label?: string
description?: string
children: GenericGroup[]
}
type GenericGroup = {
id: string
/** reference to `${GenericRoot.id}` */
root: string
label?: string
description?: string
children?: GenericGroup[]
}
type GenericEntity = {
/**
* the entity file name
*
* the following extensions/formats are supported
*
* structures
* - gro
* - cif, mmcif, mcif, bcif
* - pdb, ent
* - xyz
* - mol
* - sdf, sd
* - mol2
*
* meshes
* - ply
*/
file: string
label?: string
description?: string
groups: {
/** reference to `${GenericGroup.id}` */
id: string,
/** reference to `${GenericGroup.root}` */
root: string
}[]
/**
* defaults to a single, untransformed instance
*/
instances?: GenericInstances<string>
/**
* defaults to 1 (assuming fully atomic structures)
* for C-alpha only structures set to 2
* for Martini coarse-grained set to 1.5
*/
sizeFactor?: number
}
type BinaryData<T extends string | Asset> = {
file: T,
view?: {
byteOffset: number,
byteLength: number
}
}
export type GenericInstances<T extends string | Asset> = {
/**
* translation vectors in Angstrom
* [x0, y0, z0, ..., xn, yn, zn] with n = count - 1
*/
positions: {
/**
* either the data itself or a pointer to binary data
*/
data: number[] | BinaryData<T>
/**
* how to interpret the data
* defaults to `{ kind: 'Array', type: 'Float32' }`
*/
type?: { kind: 'Array', type: 'Float32' }
// TODO: maybe worthwhile in the future, mirroring encoders from BinaryCIF
// | { kind: 'IntegerPackedFixedPoint', byteCount: number, srcSize: number, factor: number, srcType: 'Float32' }
}
/**
* euler angles in XYZ order
* [x0, y0, z0, ..., xn, yn, zn] with n = count - 1
*
* quaternion rotations in XYZW order
* [x0, y0, z0, w0, ..., xn, yn, zn, wn] with n = count - 1
*
* rotation matrices in row-major order
* [m00_0, m01_0, m02_0, ..., m20_n, m21_n, m22_n] with n = count - 1
*/
rotations: {
variant: 'euler' | 'quaternion' | 'matrix',
/**
* either the data itself or a pointer to binary data
*/
data: number[] | BinaryData<T>
/**
* how to interpret the data
* defaults to `{ kind: 'Array', type: 'Float32' }`
*/
type?: { kind: 'Array', type: 'Float32' }
}
}
type GenericFrame = {
time: number
entities: {
file: string
instances: GenericInstances<string>
}[]
}
type GenericTrajectory = {
label?: string
description?: string
frames: GenericFrame[]
}
type GenericManifest = {
label?: string
description?: string
roots: GenericRoot[]
entities: GenericEntity[]
trajectories?: GenericTrajectory[]
}
//
const p = Vec3();
const q = Quat();
const m = Mat3();
const e = Euler();
async function getPositions(plugin: PluginContext, p: GenericInstances<Asset>['positions']): Promise<NumberArray> {
if (Array.isArray(p.data)) {
return p.data;
} else {
const a = await plugin.runTask(plugin.managers.asset.resolve(p.data.file, 'binary'));
const o = p.data.view?.byteOffset || 0;
const l = p.data.view?.byteLength || a.data.byteLength;
return new Float32Array(a.data.buffer, o + a.data.byteOffset, l / 4);
}
};
async function getRotations(plugin: PluginContext, r: GenericInstances<Asset>['rotations']): Promise<NumberArray> {
if (Array.isArray(r.data)) {
return r.data;
} else {
const a = await plugin.runTask(plugin.managers.asset.resolve(r.data.file, 'binary'));
const o = r.data.view?.byteOffset || 0;
const l = r.data.view?.byteLength || a.data.byteLength;
return new Float32Array(a.data.buffer, o + a.data.byteOffset, l / 4);
}
};
export async function getTransforms(plugin: PluginContext, instances?: GenericInstances<Asset>) {
const transforms: Mat4[] = [];
if (instances) {
const positions = await getPositions(plugin, instances.positions);
const rotations = await getRotations(plugin, instances.rotations);
for (let i = 0, il = positions.length / 3; i < il; ++i) {
Vec3.fromArray(p, positions, i * 3);
if (instances.rotations.variant === 'matrix') {
Mat3.fromArray(m, rotations, i * 9);
const t = Mat4.fromMat3(Mat4(), m);
Mat4.setTranslation(t, p);
transforms.push(t);
} else if (instances.rotations.variant === 'quaternion') {
Quat.fromArray(q, rotations, i * 4);
const t = Mat4.fromQuat(Mat4(), q);
Mat4.setTranslation(t, p);
transforms.push(t);
} else if (instances.rotations.variant === 'euler') {
Euler.fromArray(e, rotations, i * 3);
Quat.fromEuler(q, e, 'XYZ');
const t = Mat4.fromQuat(Mat4(), q);
Mat4.setTranslation(t, p);
transforms.push(t);
}
}
} else {
transforms.push(Mat4.identity());
}
return transforms;
}
//
type MartiniManifest = {
model: string,
positions: Vec3[],
rotations: Vec3[],
function: string
}[]
function martiniToGeneric(martini: MartiniManifest): GenericManifest {
const functionRoot: GenericRoot = {
id: 'function',
label: 'Function',
description: 'Functional classification',
children: [],
};
const entities: GenericEntity[] = [];
const seenGroups = new Set<string>();
const membraneGroup = {
id: 'membane',
root: 'function',
label: 'Membrane',
children: [] as GenericGroup[],
};
functionRoot.children!.push(membraneGroup);
seenGroups.add(membraneGroup.id);
const lipidsGroup = {
id: 'lipid',
root: 'function',
label: 'Lipid',
children: [] as GenericGroup[],
};
membraneGroup.children!.push(lipidsGroup);
seenGroups.add(lipidsGroup.id);
const upperGroup = {
id: 'upper',
root: 'function',
label: 'Upper Leaflet',
};
lipidsGroup.children!.push(upperGroup);
seenGroups.add(upperGroup.id);
const lowerGroup = {
id: 'lower',
root: 'function',
label: 'Lower Leaflet',
};
lipidsGroup.children!.push(lowerGroup);
seenGroups.add(lowerGroup.id);
const memprotGroup = {
id: 'memprot',
root: 'function',
label: 'Transmembrane Protein',
};
membraneGroup.children!.push(memprotGroup);
seenGroups.add(memprotGroup.id);
for (const e of martini) {
const label = e.model.split('.')[0];
const group = e.function || 'Metabolite';
const positions = {
data: e.positions.flat().map(x => Math.round((x * 10) * 100) / 100)
};
const rotations = {
data: e.rotations.flat().map(x => Math.round(x * 100) / 100),
variant: 'euler' as const,
};
if (group.includes('lower leaflet')) {
entities.push({
file: e.model,
label: label.substring(15),
groups: [{ root: 'function', id: 'lower' }],
instances: { positions, rotations },
sizeFactor: 1.5,
});
} else if (group.includes('upper leaflet')) {
entities.push({
file: e.model,
label: label.substring(15),
groups: [{ root: 'function', id: 'upper' }],
instances: { positions, rotations },
sizeFactor: 1.5,
});
} else if (group.length === 4) {
entities.push({
file: e.model,
label: label.substring(17),
groups: [{ root: 'function', id: 'memprot' }],
instances: { positions, rotations },
sizeFactor: 1.5,
});
} else {
if (!seenGroups.has(group)) {
functionRoot.children!.push({
id: group,
root: 'function',
label: group,
});
seenGroups.add(group);
}
entities.push({
file: e.model,
label,
groups: [{ root: 'function', id: group }],
instances: { positions, rotations },
sizeFactor: 1.5,
});
}
}
return {
label: 'Martini',
description: 'Martini coarse-grained model',
roots: [functionRoot],
entities,
};
}

View File

@@ -0,0 +1,202 @@
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { SortedArray } from '../../../../mol-data/int';
import { SymmetryOperator } from '../../../../mol-math/geometry';
import { Mat4 } from '../../../../mol-math/linear-algebra';
import { ModelSymmetry } from '../../../../mol-model-formats/structure/property/symmetry';
import { CustomStructureProperty } from '../../../../mol-model-props/common/custom-structure-property';
import { ElementIndex, EntityIndex, Model, Structure, Unit } from '../../../../mol-model/structure';
import { Assembly, Symmetry } from '../../../../mol-model/structure/model/properties/symmetry';
import { PluginStateObject as PSO, PluginStateTransform } from '../../../../mol-plugin-state/objects';
import { PluginContext } from '../../../../mol-plugin/context';
import { StateTransformer } from '../../../../mol-state/transformer';
import { Task } from '../../../../mol-task';
import { deepEqual } from '../../../../mol-util';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
import { partitionUnits } from '../util';
function createModelChainMap(model: Model) {
const builder = new Structure.StructureBuilder();
const units = new Map<string, Unit>();
const { label_asym_id, _rowCount } = model.atomicHierarchy.chains;
const { offsets } = model.atomicHierarchy.chainAtomSegments;
for (let i = 0; i < _rowCount; i++) {
const elements = SortedArray.ofBounds(offsets[i] as ElementIndex, offsets[i + 1] as ElementIndex);
const unit = builder.addUnit(Unit.Kind.Atomic, model, SymmetryOperator.Default, elements, Unit.Trait.FastBoundary);
units.set(label_asym_id.value(i), unit);
}
return units;
}
function buildAssembly(model: Model, assembly: Assembly) {
const coordinateSystem = SymmetryOperator.create(assembly.id, Mat4.identity(), { assembly: { id: assembly.id, operId: 0, operList: [] } });
const assembler = Structure.Builder({
coordinateSystem,
label: model.label,
});
const units = createModelChainMap(model);
for (const g of assembly.operatorGroups) {
for (const oper of g.operators) {
for (const id of g.asymIds!) {
const u = units.get(id);
if (u) {
assembler.addWithOperator(u, oper);
} else {
console.log(`missing asymId '${id}'`);
}
}
}
}
return assembler.getStructure();
}
export { MmcifAssembly };
type MmcifAssembly = typeof MmcifAssembly
const MmcifAssembly = PluginStateTransform.BuiltIn({
name: 'mmcif-assembly',
display: { name: 'Mmcif Assembly' },
from: PSO.Molecule.Model,
to: PSO.Molecule.Structure,
params: {
id: PD.Text('', { label: 'Asm Id', description: 'Assembly Id (use empty for the 1st assembly)' }),
}
})({
canAutoUpdate({ newParams }) {
return true;
},
apply({ a, params }, plugin: PluginContext) {
return Task.create('Build Structure', async ctx => {
const model = a.data;
let id = params.id;
let asm: Assembly | undefined = void 0;
const symmetry = ModelSymmetry.Provider.get(model);
// if no id is specified, use the 1st assembly.
if (!id && symmetry && symmetry.assemblies.length !== 0) {
id = symmetry.assemblies[0].id;
}
if (!symmetry || symmetry.assemblies.length === 0) {
plugin.log.warn(`Model '${model.entryId}' has no assembly, returning model structure.`);
} else {
asm = Symmetry.findAssembly(model, id || '');
if (!asm) {
plugin.log.warn(`Model '${model.entryId}' has no assembly called '${id}', returning model structure.`);
}
}
const base = Structure.ofModel(model);
if (!asm) {
const label = { label: 'Model', description: Structure.elementDescription(base) };
return new PSO.Molecule.Structure(base, label);
}
const s = buildAssembly(model, asm);
const objProps = { label: `Assembly ${id}`, description: Structure.elementDescription(s) };
return new PSO.Molecule.Structure(s, objProps);
});
},
update({ newParams, oldParams }) {
return deepEqual(newParams, oldParams)
? StateTransformer.UpdateResult.Unchanged
: StateTransformer.UpdateResult.Recreate;
},
dispose({ b }) {
b?.data.customPropertyDescriptors.dispose();
}
});
type UnitsByEntity = Map<EntityIndex, Unit[]>;
const UnitsByEntity = CustomStructureProperty.createSimple<UnitsByEntity>('units_by_entity', 'root');
function getUnitsByEntity(structure: Structure): UnitsByEntity {
if (UnitsByEntity.get(structure).value) {
return UnitsByEntity.get(structure).value!;
}
const atomicIndex = structure.model.atomicHierarchy.index;
const spheresIndex = structure.model.coarseHierarchy.spheres;
const map: UnitsByEntity = new Map();
for (const ug of structure.unitSymmetryGroups) {
const u = ug.units[0];
let e: EntityIndex;
if (Unit.isAtomic(u)) {
e = atomicIndex.getEntityFromChain(u.chainIndex[u.elements[0]]);
} else if (Unit.isSpheres(u)) {
e = spheresIndex.getEntityFromChain(u.coarseElements.chainElementSegments.index[u.elements[0]]);
} else {
continue;
}
if (!map.has(e)) map.set(e, []);
const entityUnits = map.get(e)!;
for (let i = 0, il = ug.units.length; i < il; ++i) {
entityUnits.push(ug.units[i]);
}
}
UnitsByEntity.set(structure, { value: map }, map);
return map;
}
export { MmcifStructure };
type MmcifStructure = typeof MmcifStructure
const MmcifStructure = PluginStateTransform.BuiltIn({
name: 'mmcif-structure',
display: { name: 'Mmcif Structure' },
from: PSO.Root,
to: PSO.Molecule.Structure,
params: {
structureRef: PD.Text(''),
entityId: PD.Text(''),
cellSize: PD.Numeric(500, { min: 0, max: 10000, step: 100 }),
}
})({
canAutoUpdate({ newParams }) {
return true;
},
apply({ a, params, dependencies }) {
return Task.create('Build Structure', async ctx => {
const parent = dependencies![params.structureRef].data as Structure;
const { entities } = parent.model;
const idx = entities.getEntityIndex(params.entityId);
const unitsByEntity = getUnitsByEntity(parent);
const units = unitsByEntity.get(idx) || [];
const unitCount = units.length;
let structure: Structure;
if (unitCount > 1 && units.every(u => u.conformation.operator.isIdentity)) {
const mergedUnits = partitionUnits(units, params.cellSize);
structure = Structure.create(mergedUnits);
} else {
structure = Structure.create(units);
}
const label = entities.data.pdbx_description.value(idx).join(', ') || 'model';
return new PSO.Molecule.Structure(structure, { label, description: `${a.description}` });
});
},
update({ newParams, oldParams }) {
return deepEqual(newParams, oldParams)
? StateTransformer.UpdateResult.Unchanged
: StateTransformer.UpdateResult.Recreate;
},
dispose({ b }) {
b?.data.customPropertyDescriptors.dispose();
}
});

View File

@@ -0,0 +1,182 @@
/**
* Copyright (c) 2023-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { MmcifFormat } from '../../../../mol-model-formats/structure/mmcif';
import { PluginStateObject } from '../../../../mol-plugin-state/objects';
import { StructureRepresentation3D } from '../../../../mol-plugin-state/transforms/representation';
import { PluginContext } from '../../../../mol-plugin/context';
import { SpacefillRepresentationProvider } from '../../../../mol-repr/structure/representation/spacefill';
import { StateObjectRef, StateObjectSelector, StateBuilder } from '../../../../mol-state';
import { Clip } from '../../../../mol-util/clip';
import { Color } from '../../../../mol-util/color';
import { ColorNames } from '../../../../mol-util/color/names';
import { GraphicsMode, MesoscaleGroup, MesoscaleState, getDistinctBaseColors, getDistinctGroupColors, getGraphicsModeProps, getMesoscaleGroupParams } from '../state';
import { MmcifAssembly, MmcifStructure } from './model';
function getSpacefillParams(color: Color, scaleFactor: number, graphics: GraphicsMode, clipVariant: Clip.Variant) {
const gmp = getGraphicsModeProps(graphics === 'custom' ? 'quality' : graphics);
return {
type: {
name: 'spacefill',
params: {
...SpacefillRepresentationProvider.defaultValues,
ignoreHydrogens: false,
instanceGranularity: false,
ignoreLight: true,
lodLevels: gmp.lodLevels.map(l => {
return {
...l,
stride: Math.max(1, Math.round(l.stride / Math.pow(scaleFactor, l.scaleBias)))
};
}),
quality: 'lowest', // avoid 'auto', triggers boundary calc
clip: {
variant: clipVariant,
objects: [],
},
clipPrimitive: true,
approximate: gmp.approximate,
alphaThickness: gmp.alphaThickness,
},
},
colorTheme: {
name: 'uniform',
params: {
value: color,
saturation: 0,
lightness: 0,
}
},
sizeTheme: {
name: 'physical',
params: {
value: 1,
}
},
};
}
export async function createMmcifHierarchy(plugin: PluginContext, trajectory: StateObjectRef<PluginStateObject.Molecule.Trajectory>) {
const builder = plugin.builders.structure;
const state = plugin.state.data;
const model = await builder.createModel(trajectory, { modelIndex: 0 });
const { data: entities, subtype } = model.data!.entities;
const sd = model.data?.sourceData;
if (MmcifFormat.is(sd)) {
const pdbId = sd.data.db.struct.entry_id.value(0);
MesoscaleState.set(plugin, {
description: sd.data.db.struct.title.value(0),
link: pdbId ? `https://www.rcsb.org/structure/${pdbId}` : ''
});
}
const spheresAvgRadius = new Map<string, number>();
if (model.data!.coarseHierarchy.isDefined) {
const spheresCount = new Map<string, number>();
const spheresEntity_id = model.data!.coarseHierarchy.spheres.entity_id;
const spheresRadius = model.data!.coarseConformation.spheres.radius;
for (let i = 0, il = spheresEntity_id.rowCount; i < il; ++i) {
const entitiId = spheresEntity_id.value(i);
const radius = spheresRadius[i];
if (!spheresCount.has(entitiId)) {
spheresCount.set(entitiId, 1);
spheresAvgRadius.set(entitiId, radius);
} else {
spheresCount.set(entitiId, spheresCount.get(entitiId)! + 1);
spheresAvgRadius.set(entitiId, spheresAvgRadius.get(entitiId)! + radius);
}
}
spheresAvgRadius.forEach((v, k) => {
spheresAvgRadius.set(k, v / spheresCount.get(k)!);
});
}
const entGroups = new Map<string, StateObjectSelector>();
const entIds = new Map<string, { idx: number, members: Map<number, number> }>();
const entColors = new Map<string, Color[]>();
const graphicsMode = MesoscaleState.get(plugin).graphics;
const groupParams = getMesoscaleGroupParams(graphicsMode);
const base = await state.build()
.to(model)
.apply(MmcifAssembly, { id: '' })
.commit();
const units = base.data!.units;
const willBeMerged = units.length > 1 && units.every(u => u.conformation.operator.isIdentity);
const clipVariant = willBeMerged ? 'pixel' : 'instance';
const entRoot = await state.build()
.toRoot()
.applyOrUpdateTagged('group:ent:', MesoscaleGroup, { ...groupParams, root: true, index: -1, tag: `ent:`, label: 'entity', color: { type: 'custom', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: 'group:ent:', state: { isCollapsed: false, isHidden: groupParams.hidden } })
.commit();
const getEntityType = (i: number) => {
if (entities.type.value(i) === 'water') return 'water' as const;
return subtype.value(i) || 'unknown type';
};
for (let i = 0; i < entities._rowCount; i++) {
const t = getEntityType(i);
if (!entIds.has(t)) {
entIds.set(t, { idx: entIds.size, members: new Map() });
}
const cm = entIds.get(t)!;
cm.members.set(i, cm.members.size);
}
//
const baseEntColors = getDistinctBaseColors(entIds.size, 0);
const entIdEntries = Array.from(entIds.entries());
for (let i = 0; i < entIdEntries.length; ++i) {
const [t, m] = entIdEntries[i];
const groupColors = getDistinctGroupColors(m.members.size, baseEntColors[i], 20, 0);
entColors.set(t, groupColors);
}
for (let i = 0; i < entities._rowCount; i++) {
const t = getEntityType(i);
if (!entGroups.has(t)) {
const colorIdx = entIds.get(t)?.idx;
const color = colorIdx !== undefined ? baseEntColors[colorIdx] : ColorNames.white;
const group = await state.build()
.to(entRoot)
.applyOrUpdateTagged(`group:ent:${t}`, MesoscaleGroup, { ...groupParams, index: colorIdx, tag: `ent:${t}`, label: t, color: { type: 'generate', value: color, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: `ent:`, state: { isCollapsed: true, isHidden: groupParams.hidden } })
.commit({ revertOnError: true });
entGroups.set(t, group);
}
}
//
await state.transaction(async () => {
try {
const dependsOn = [base.ref];
plugin.animationLoop.stop({ noDraw: true });
let build: StateBuilder.Root | StateBuilder.To<any> = state.build();
for (let i = 0; i < entities._rowCount; i++) {
const t = getEntityType(i);
const color = entColors.get(t)![entIds.get(t)!.members.get(i)!];
const scaleFactor = spheresAvgRadius.get(entities.id.value(i)) || 1;
build = build
.toRoot()
.apply(MmcifStructure, { structureRef: base.ref, entityId: entities.id.value(i) }, { dependsOn })
.apply(StructureRepresentation3D, getSpacefillParams(color, scaleFactor, graphicsMode, clipVariant), { tags: [`ent:${t}`] });
}
await build.commit();
} catch (e) {
console.error(e);
plugin.log.error(e);
} finally {
plugin.animationLoop.start();
}
}).run();
}

View File

@@ -0,0 +1,138 @@
/**
* Copyright (c) 2022-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Mat4 } from '../../../../mol-math/linear-algebra/3d/mat4';
import { getMatrices, operatorGroupsProvider } from '../../../../mol-model-formats/structure/property/assembly';
import { Structure, StructureElement, StructureProperties, Trajectory, Unit } from '../../../../mol-model/structure';
import { Assembly } from '../../../../mol-model/structure/model/properties/symmetry';
import { PluginStateObject as SO, PluginStateTransform } from '../../../../mol-plugin-state/objects';
import { Task } from '../../../../mol-task';
import { Table } from '../../../../mol-data/db';
import { mmCIF_Schema } from '../../../../mol-io/reader/cif/schema/mmcif';
import { MmcifFormat } from '../../../../mol-model-formats/structure/mmcif';
import { arrayFind } from '../../../../mol-data/util';
import { StateObject, StateTransformer } from '../../../../mol-state';
import { CifField } from '../../../../mol-io/reader/cif';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
import { mergeUnits } from '../util';
import { deepEqual } from '../../../../mol-util';
export { StructureFromPetworld };
type StructureFromPetworld = typeof StructureFromPetworld
const StructureFromPetworld = PluginStateTransform.BuiltIn({
name: 'structure-from-petworld',
display: { name: 'Structure from PetWorld', description: 'Create a molecular structure from PetWorld models.' },
from: SO.Molecule.Trajectory,
to: SO.Molecule.Structure,
params: {
modelIndex: PD.Numeric(0),
entityIds: PD.Value<string[]>([]),
}
})({
apply({ a, params }) {
return Task.create('Build Structure', async ctx => {
const s = await buildModelsAssembly(a.data, '1', params.modelIndex, params.entityIds).runInContext(ctx);
if (!s || !MmcifFormat.is(s.model.sourceData)) return StateObject.Null;
const { frame } = s.model.sourceData.data;
const pdbx_model = frame.categories.pdbx_model.getField('name')!;
const label = pdbx_model.str(params.modelIndex);
const props = { label, description: Structure.elementDescription(s) };
return new SO.Molecule.Structure(s, props);
});
},
update({ newParams, oldParams }) {
return deepEqual(newParams, oldParams)
? StateTransformer.UpdateResult.Unchanged
: StateTransformer.UpdateResult.Recreate;
},
dispose({ b }) {
b?.data.customPropertyDescriptors.dispose();
}
});
function buildModelsAssembly(trajectory: Trajectory, asmName: string, modelIndex: number, entitiyIds: string[]) {
return Task.create('Build Models Assembly', async ctx => {
const model = await Task.resolveInContext(trajectory.getFrameAtIndex(modelIndex), ctx);
if (!MmcifFormat.is(model.sourceData)) return;
const { db, frame } = model.sourceData.data;
const PDB_model_num = frame.categories.pdbx_struct_assembly_gen.getField('PDB_model_num')!;
// hack to cache models assemblies
if (!(trajectory as any).__modelsAssemblies) {
(trajectory as any).__modelsAssemblies = createModelsAssemblies(db.pdbx_struct_assembly, db.pdbx_struct_assembly_gen as StructAssemblyGen, db.pdbx_struct_oper_list, PDB_model_num);
}
const modelsAssemblies = (trajectory as any).__modelsAssemblies as ModelsAssembly[];
const modelsAssembly = arrayFind(modelsAssemblies, ma => ma.assembly.id.toLowerCase() === asmName);
if (!modelsAssembly) throw new Error(`Models Assembly '${asmName}' is not defined.`);
const { assembly } = modelsAssembly;
const assembler = Structure.Builder();
const g = assembly.operatorGroups[modelIndex];
const structure = Structure.ofModel(model);
const l = StructureElement.Location.create(structure);
const units = structure.units.filter(u => {
l.unit = u;
l.element = u.elements[0];
return entitiyIds.includes(StructureProperties.entity.id(l));
});
const unit = mergeUnits(units, 0);
for (const oper of g.operators) {
assembler.addUnit(unit.kind, unit.model, oper, unit.elements, unit.traits | Unit.Trait.FastBoundary, unit.invariantId);
}
return assembler.getStructure();
});
}
//
type StructAssembly = Table<mmCIF_Schema['pdbx_struct_assembly']>
type StructAssemblyGen = Table<mmCIF_Schema['pdbx_struct_assembly_gen']>
type StructOperList = Table<mmCIF_Schema['pdbx_struct_oper_list']>
type ModelsAssembly = { assembly: Assembly, modelNums: number[] };
function createModelsAssemblies(pdbx_struct_assembly: StructAssembly, pdbx_struct_assembly_gen: StructAssemblyGen, pdbx_struct_oper_list: StructOperList, PDB_model_num: CifField): ReadonlyArray<ModelsAssembly> {
if (!pdbx_struct_assembly._rowCount) return [];
const matrices = getMatrices(pdbx_struct_oper_list);
const assemblies: ModelsAssembly[] = [];
for (let i = 0; i < pdbx_struct_assembly._rowCount; i++) {
assemblies[assemblies.length] = createModelsAssembly(pdbx_struct_assembly, pdbx_struct_assembly_gen, i, matrices, PDB_model_num);
}
return assemblies;
}
type Matrices = Map<string, Mat4>
type Generator = { assemblyId: string, expression: string, asymIds: string[] }
function createModelsAssembly(pdbx_struct_assembly: StructAssembly, pdbx_struct_assembly_gen: StructAssemblyGen, index: number, matrices: Matrices, PDB_model_num: CifField): ModelsAssembly {
const id = pdbx_struct_assembly.id.value(index);
const details = pdbx_struct_assembly.details.value(index);
const generators: Generator[] = [];
const modelNums: number[] = [];
const { assembly_id, oper_expression, asym_id_list } = pdbx_struct_assembly_gen;
for (let i = 0, _i = pdbx_struct_assembly_gen._rowCount; i < _i; i++) {
if (assembly_id.value(i) !== id) continue;
generators[generators.length] = {
assemblyId: id,
expression: oper_expression.value(i),
asymIds: asym_id_list.value(i)
};
modelNums[modelNums.length] = PDB_model_num.int(i);
}
const assembly = Assembly.create(id, details, operatorGroupsProvider(generators, matrices));
return { assembly, modelNums };
}

View File

@@ -0,0 +1,134 @@
/**
* Copyright (c) 2022-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { StateBuilder, StateObjectRef } from '../../../../mol-state';
import { StructureFromPetworld } from './model';
import { Color } from '../../../../mol-util/color';
import { SpacefillRepresentationProvider } from '../../../../mol-repr/structure/representation/spacefill';
import { StructureRepresentation3D } from '../../../../mol-plugin-state/transforms/representation';
import { PluginContext } from '../../../../mol-plugin/context';
import { PluginStateObject } from '../../../../mol-plugin-state/objects';
import { GraphicsMode, MesoscaleGroup, MesoscaleState, getDistinctBaseColors, getGraphicsModeProps, getMesoscaleGroupParams } from '../state';
import { ColorNames } from '../../../../mol-util/color/names';
import { MmcifFormat } from '../../../../mol-model-formats/structure/mmcif';
import { Task } from '../../../../mol-task';
function getSpacefillParams(color: Color, graphics: GraphicsMode) {
const gmp = getGraphicsModeProps(graphics === 'custom' ? 'quality' : graphics);
return {
type: {
name: 'spacefill',
params: {
...SpacefillRepresentationProvider.defaultValues,
ignoreHydrogens: true,
instanceGranularity: true,
ignoreLight: true,
lodLevels: gmp.lodLevels,
quality: 'lowest', // avoid 'auto', triggers boundary calc
clip: {
variant: 'instance',
objects: [],
},
clipPrimitive: true,
approximate: gmp.approximate,
alphaThickness: gmp.alphaThickness,
},
},
colorTheme: {
name: 'uniform',
params: {
value: color,
saturation: 0,
lightness: 0,
}
},
sizeTheme: {
name: 'physical',
params: {
scale: 1,
}
},
};
}
export async function createPetworldHierarchy(plugin: PluginContext, trajectory: StateObjectRef<PluginStateObject.Molecule.Trajectory>) {
const cell = StateObjectRef.resolveAndCheck(plugin.state.data, trajectory);
const tr = cell?.obj?.data;
if (!cell || !tr) return;
if (!MmcifFormat.is(tr.representative.sourceData)) return;
const membrane: { modelIndex: number, entityIds: string[] }[] = [];
const other: { modelIndex: number, entityIds: string[] }[] = [];
for (let i = 0; i < tr.frameCount; ++i) {
const m = await Task.resolveInContext(tr.getFrameAtIndex(i));
// cannot use m.properties.structAsymMap because petworld models
// may assign the same asymId to multiple entities
const { label_asym_id, label_entity_id, _rowCount } = m.atomicHierarchy.chains;
const membraneIds: string[] = [];
const otherIds: string[] = [];
const seen = new Set<string>();
for (let i = 0; i < _rowCount; i ++) {
const entityId = label_entity_id.value(i);
if (seen.has(entityId)) continue;
const asymId = label_asym_id.value(i);
if (asymId.startsWith('MEM')) {
membraneIds.push(entityId);
} else {
otherIds.push(entityId);
}
seen.add(entityId);
}
if (membraneIds.length) {
membrane.push({ modelIndex: i, entityIds: membraneIds });
}
if (otherIds.length) {
other.push({ modelIndex: i, entityIds: otherIds });
}
}
const state = plugin.state.data;
const graphicsMode = MesoscaleState.get(plugin).graphics;
const groupParams = getMesoscaleGroupParams(graphicsMode);
const group = await state.build()
.toRoot()
.applyOrUpdateTagged('group:ent:', MesoscaleGroup, { ...groupParams, root: true, index: -1, tag: `ent:`, label: 'entity', color: { type: 'generate', value: ColorNames.white, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: 'group:ent:', state: { isCollapsed: false, isHidden: groupParams.hidden } })
.commit({ revertOnError: true });
await state.build()
.to(group)
.applyOrUpdateTagged(`group:ent:mem`, MesoscaleGroup, { ...groupParams, index: undefined, tag: `ent:mem`, label: 'Membrane', color: { type: 'uniform', value: ColorNames.lightgrey, variability: 20, shift: 0, lightness: 0, alpha: 1, emissive: 0 } }, { tags: `ent:`, state: { isCollapsed: true, isHidden: groupParams.hidden } })
.commit();
const colors = getDistinctBaseColors(other.length, 0);
await state.transaction(async () => {
try {
plugin.animationLoop.stop({ noDraw: true });
let build: StateBuilder.Root | StateBuilder.To<any> = state.build();
for (let i = 0, il = membrane.length; i < il; ++i) {
build = build
.to(cell)
.apply(StructureFromPetworld, membrane[i])
.apply(StructureRepresentation3D, getSpacefillParams(ColorNames.lightgrey, graphicsMode), { tags: [`ent:mem`] });
}
for (let i = 0, il = other.length; i < il; ++i) {
build = build
.to(cell)
.apply(StructureFromPetworld, other[i])
.apply(StructureRepresentation3D, getSpacefillParams(colors[i], graphicsMode), { tags: [`ent:`] });
}
await build.commit();
} catch (e) {
console.error(e);
plugin.log.error(e);
} finally {
plugin.animationLoop.start();
}
}).run();
}

View File

@@ -0,0 +1,605 @@
/**
* Copyright (c) 2023-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { PluginStateObject as PSO, PluginStateTransform } from '../../../mol-plugin-state/objects';
import { PluginContext } from '../../../mol-plugin/context';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { Task } from '../../../mol-task';
import { Color } from '../../../mol-util/color';
import { Spheres } from '../../../mol-geo/geometry/spheres/spheres';
import { Clip } from '../../../mol-util/clip';
import { escapeRegExp, stringToWords } from '../../../mol-util/string';
import { Vec3 } from '../../../mol-math/linear-algebra';
import { ParamMapping } from '../../../mol-util/param-mapping';
import { EntityNode } from '../ui/entities';
import { DistinctColorsProps, distinctColors } from '../../../mol-util/color/distinct';
import { Sphere3D } from '../../../mol-math/geometry';
import { Hcl } from '../../../mol-util/color/spaces/hcl';
import { StateObjectCell, StateObjectRef, StateSelection } from '../../../mol-state';
import { ShapeRepresentation3D, StructureRepresentation3D } from '../../../mol-plugin-state/transforms/representation';
import { SpacefillRepresentationProvider } from '../../../mol-repr/structure/representation/spacefill';
import { assertUnreachable } from '../../../mol-util/type-helpers';
import { MesoscaleExplorerState } from '../app';
import { saturate } from '../../../mol-math/interpolate';
function getHueRange(hue: number, variability: number) {
let min = hue - variability;
const minOverflow = (min < 0 ? -min : 0);
let max = hue + variability;
if (max > 360) min -= max - 360;
max += minOverflow;
return [Math.max(0, min), Math.min(360, max)] as [number, number];
}
function getGrayscaleColors(count: number, luminance: number, variability: number) {
const out: Color[] = [];
for (let i = 0; i < count; ++ i) {
const l = saturate(luminance / 100);
const v = saturate(variability / 180) * Math.random();
const s = Math.random() > 0.5 ? 1 : -1;
const d = Math.abs(l + s * v) % 1;
out[i] = Color.fromNormalizedRgb(d, d, d);
}
return out;
}
export function getDistinctGroupColors(count: number, color: Color, variability: number, shift: number, props?: Partial<DistinctColorsProps>) {
const hcl = Hcl.fromColor(Hcl(), color);
if (isNaN(hcl[0])) {
return getGrayscaleColors(count, hcl[2], variability);
}
if (count === 1) {
hcl[1] = 65;
hcl[2] = 55;
return [Hcl.toColor(hcl)];
}
const colors = distinctColors(count, {
hue: getHueRange(hcl[0], variability),
chroma: [30, 100],
luminance: [50, 100],
clusteringStepCount: 0,
minSampleCount: 1000,
sampleCountFactor: 100,
sort: 'none',
...props,
});
if (shift !== 0) {
const offset = Math.floor(shift / 100 * count);
return [...colors.slice(offset), ...colors.slice(0, offset)];
} else {
return colors;
}
}
const Colors = [0x377eb8, 0xe41a1c, 0x4daf4a, 0x984ea3, 0xff7f00, 0xffff33, 0xa65628, 0xf781bf] as Color[];
export function getDistinctBaseColors(count: number, shift: number, props?: Partial<DistinctColorsProps>): Color[] {
let colors: Color[];
if (count <= Colors.length) {
colors = Colors.slice(0, count).map(e => Array.isArray(e) ? e[0] : e);
} else {
colors = distinctColors(count, {
hue: [1, 360],
chroma: [25, 100],
luminance: [30, 100],
clusteringStepCount: 0,
minSampleCount: 1000,
sampleCountFactor: 100,
sort: 'none',
...props,
});
}
if (shift !== 0) {
const offset = Math.floor(shift / 100 * count);
return [...colors.slice(offset), ...colors.slice(0, offset)];
} else {
return colors;
}
}
export const ColorParams = {
type: PD.Select('generate', PD.arrayToOptions(['generate', 'uniform', 'custom'])),
value: PD.Color(Color(0xFFFFFF), { hideIf: p => p.type === 'custom' }),
variability: PD.Numeric(20, { min: 1, max: 180, step: 1 }, { hideIf: p => p.type !== 'generate' }),
shift: PD.Numeric(0, { min: 0, max: 100, step: 1 }, { hideIf: p => !p.type.includes('generate') }),
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }, { hideIf: p => p.type === 'custom' }),
alpha: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }, { hideIf: p => p.type === 'custom' }),
emissive: PD.Numeric(0, { min: 0, max: 1, step: 0.01 }, { hideIf: p => p.type === 'custom' }),
};
export type ColorProps = PD.Values<typeof ColorParams>
export const ColorValueParam = PD.Color(Color(0xFFFFFF));
export const RootParams = {
type: PD.Select('custom', PD.arrayToOptions(['group-generate', 'group-uniform', 'generate', 'uniform', 'custom'])),
value: PD.Color(Color(0xFFFFFF), { hideIf: p => p.type !== 'uniform' }),
variability: PD.Numeric(20, { min: 1, max: 180, step: 1 }, { hideIf: p => p.type !== 'group-generate' }),
shift: PD.Numeric(0, { min: 0, max: 100, step: 1 }, { hideIf: p => !p.type.includes('generate') }),
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }, { hideIf: p => p.type === 'custom' }),
alpha: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }, { hideIf: p => p.type === 'custom' }),
emissive: PD.Numeric(0, { min: 0, max: 1, step: 0.01 }, { hideIf: p => p.type === 'custom' }),
};
export const LightnessParams = {
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
};
export const DimLightness = 6;
export const OpacityParams = {
alpha: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }),
};
export const EmissiveParams = {
emissive: PD.Numeric(0, { min: 0, max: 1, step: 0.01 }),
};
export const PatternParams = {
frequency: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }),
amplitude: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }),
};
export const LodParams = {
lodLevels: Spheres.Params.lodLevels,
cellSize: Spheres.Params.cellSize,
batchSize: Spheres.Params.batchSize,
approximate: Spheres.Params.approximate,
};
export const SimpleClipParams = {
type: PD.Select('none', PD.objectToOptions(Clip.Type, t => stringToWords(t))),
invert: PD.Boolean(false),
position: PD.Group({
x: PD.Numeric(0, { min: -100, max: 100, step: 1 }, { immediateUpdate: true }),
y: PD.Numeric(0, { min: -100, max: 100, step: 1 }, { immediateUpdate: true }),
z: PD.Numeric(0, { min: -100, max: 100, step: 1 }, { immediateUpdate: true }),
}, { hideIf: g => g.type === 'none', isExpanded: true }),
rotation: PD.Group({
axis: PD.Vec3(Vec3.create(1, 0, 0)),
angle: PD.Numeric(0, { min: -180, max: 180, step: 1 }, { immediateUpdate: true }),
}, { hideIf: g => g.type === 'none', isExpanded: true }),
scale: PD.Group({
x: PD.Numeric(100, { min: 0, max: 100, step: 1 }, { immediateUpdate: true }),
y: PD.Numeric(100, { min: 0, max: 100, step: 1 }, { immediateUpdate: true }),
z: PD.Numeric(100, { min: 0, max: 100, step: 1 }, { immediateUpdate: true }),
}, { hideIf: g => ['none', 'plane'].includes(g.type), isExpanded: true }),
};
export type SimpleClipParams = typeof SimpleClipParams
export type SimpleClipProps = PD.Values<SimpleClipParams>
export function getClipObjects(values: SimpleClipProps, boundingSphere: Sphere3D): Clip.Props['objects'] {
const { center, radius } = boundingSphere;
const position = Vec3.clone(center);
Vec3.add(position, position, Vec3.create(
radius * values.position.x / 100,
radius * values.position.y / 100,
radius * values.position.z / 100
));
const scale = Vec3.create(values.scale.x, values.scale.y, values.scale.z);
Vec3.scale(scale, scale, 2 * radius / 100);
return [{
type: values.type,
invert: values.invert,
position,
scale,
rotation: values.rotation
}];
}
export function createClipMapping(node: EntityNode) {
return ParamMapping({
params: SimpleClipParams,
target: (ctx: PluginContext) => {
return node.clipValue;
}
})({
values(props, ctx) {
if (!props || props.objects.length === 0) {
return {
type: 'none',
invert: false,
position: { x: 0, y: 0, z: 0 },
rotation: { axis: Vec3.create(1, 0, 0), angle: 0 },
scale: { x: 100, y: 100, z: 100 },
};
}
const { center, radius } = node.plugin.canvas3d!.boundingSphere;
const { invert, position, scale, rotation, type } = props.objects[0];
const p = Vec3.clone(position);
Vec3.sub(p, p, center);
Vec3.scale(p, p, 100 / radius);
Vec3.round(p, p);
const s = Vec3.clone(scale);
Vec3.scale(s, s, 100 / radius / 2);
Vec3.round(s, s);
return {
type,
invert,
position: { x: p[0], y: p[1], z: p[2] },
rotation,
scale: { x: s[0], y: s[1], z: s[2] },
};
},
update: (s, props) => {
if (!props) return;
const clipObjects = getClipObjects(s, node.plugin.canvas3d!.boundingSphere);
props.objects = clipObjects;
},
apply: async (props, ctx) => {
if (props) node.updateClip(props);
}
});
}
export const MesoscaleGroupParams = {
root: PD.Value<boolean>(false, { isHidden: true }),
index: PD.Value<number>(-1, { isHidden: true }),
tag: PD.Value<string>('', { isHidden: true }),
label: PD.Value<string>('', { isHidden: true }),
hidden: PD.Boolean(false),
color: PD.Group(RootParams),
lightness: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
alpha: PD.Numeric(1, { min: 0, max: 1, step: 0.01 }),
emissive: PD.Numeric(0, { min: 0, max: 1, step: 0.01 }),
lod: PD.Group(LodParams),
clip: PD.Group(SimpleClipParams),
};
export type MesoscaleGroupProps = PD.Values<typeof MesoscaleGroupParams>;
export class MesoscaleGroupObject extends PSO.Create({ name: 'Mesoscale Group', typeClass: 'Object' }) { }
export const MesoscaleGroup = PluginStateTransform.BuiltIn({
name: 'mesoscale-group',
display: { name: 'Mesoscale Group' },
from: [PSO.Root, MesoscaleGroupObject],
to: MesoscaleGroupObject,
params: MesoscaleGroupParams,
})({
apply({ a, params }, plugin: PluginContext) {
return Task.create('Apply Mesoscale Group', async () => {
return new MesoscaleGroupObject({}, { label: params.label });
});
},
});
export function getMesoscaleGroupParams(graphicsMode: GraphicsMode): MesoscaleGroupProps {
const groupParams = PD.getDefaultValues(MesoscaleGroupParams);
if (graphicsMode === 'custom') return groupParams;
return {
...groupParams,
lod: {
...groupParams.lod,
...getGraphicsModeProps(graphicsMode),
}
};
}
//
export type LodLevels = typeof SpacefillRepresentationProvider.defaultValues['lodLevels']
export function getLodLevels(graphicsMode: Exclude<GraphicsMode, 'custom'>): LodLevels {
switch (graphicsMode) {
case 'performance':
return [
{ minDistance: 1, maxDistance: 300, overlap: 0, stride: 1, scaleBias: 1 },
{ minDistance: 300, maxDistance: 2000, overlap: 0, stride: 40, scaleBias: 3 },
{ minDistance: 2000, maxDistance: 6000, overlap: 0, stride: 150, scaleBias: 3 },
{ minDistance: 6000, maxDistance: 10000000, overlap: 0, stride: 300, scaleBias: 2.5 },
];
case 'balanced':
return [
{ minDistance: 1, maxDistance: 500, overlap: 0, stride: 1, scaleBias: 1 },
{ minDistance: 500, maxDistance: 2000, overlap: 0, stride: 15, scaleBias: 3 },
{ minDistance: 2000, maxDistance: 6000, overlap: 0, stride: 70, scaleBias: 2.7 },
{ minDistance: 6000, maxDistance: 10000000, overlap: 0, stride: 200, scaleBias: 2.5 },
];
case 'quality':
return [
{ minDistance: 1, maxDistance: 1000, overlap: 0, stride: 1, scaleBias: 1 },
{ minDistance: 1000, maxDistance: 4000, overlap: 0, stride: 10, scaleBias: 3 },
{ minDistance: 4000, maxDistance: 10000, overlap: 0, stride: 50, scaleBias: 2.7 },
{ minDistance: 10000, maxDistance: 10000000, overlap: 0, stride: 200, scaleBias: 2.3 },
];
case 'ultra':
return [
{ minDistance: 1, maxDistance: 2000, overlap: 0, stride: 1, scaleBias: 1 },
{ minDistance: 2000, maxDistance: 8000, overlap: 0, stride: 10, scaleBias: 3 },
{ minDistance: 8000, maxDistance: 20000, overlap: 0, stride: 50, scaleBias: 2.5 },
{ minDistance: 20000, maxDistance: 10000000, overlap: 0, stride: 200, scaleBias: 2 },
];
default:
assertUnreachable(graphicsMode);
}
}
export type GraphicsMode = 'ultra' | 'quality' | 'balanced' | 'performance' | 'custom';
export function getGraphicsModeProps(graphicsMode: Exclude<GraphicsMode, 'custom'>) {
return {
lodLevels: getLodLevels(graphicsMode),
approximate: graphicsMode !== 'quality' && graphicsMode !== 'ultra',
alphaThickness: graphicsMode === 'performance' ? 15 : 12,
};
}
export function setGraphicsCanvas3DProps(ctx: PluginContext, graphics: GraphicsMode) {
const pixelScale = graphics === 'balanced' ? 0.75
: graphics === 'performance' ? 0.5 : 1;
ctx.canvas3dContext?.setProps({ pixelScale });
ctx.canvas3d?.setProps({
postprocessing: {
sharpening: pixelScale < 1 ? {
name: 'on',
params: { sharpness: 0.5, denoise: true }
} : { name: 'off', params: {} }
}
});
}
//
export const MesoscaleStateParams = {
filter: PD.Value<string>('', { isHidden: true }),
graphics: PD.Select('quality', PD.arrayToOptions(['ultra', 'quality', 'balanced', 'performance', 'custom'] as GraphicsMode[])),
description: PD.Value<string>('', { isHidden: true }),
link: PD.Value<string>('', { isHidden: true }),
};
export class MesoscaleStateObject extends PSO.Create<MesoscaleState>({ name: 'Mesoscale State', typeClass: 'Object' }) { }
const MesoscaleStateTransform = PluginStateTransform.BuiltIn({
name: 'mesoscale-state',
display: { name: 'Mesoscale State' },
from: PSO.Root,
to: MesoscaleStateObject,
params: MesoscaleStateParams,
})({
apply({ a, params }, plugin: PluginContext) {
return Task.create('Apply Mesoscale State', async () => {
return new MesoscaleStateObject(params);
});
},
});
export { MesoscaleState };
type MesoscaleState = PD.Values<typeof MesoscaleStateParams>;
const MesoscaleState = {
async init(ctx: PluginContext) {
const cell = ctx.state.data.selectQ(q => q.ofType(MesoscaleStateObject))[0];
if (cell) throw new Error('MesoscaleState already initialized');
const customState = ctx.customState as MesoscaleExplorerState;
const state = await ctx.state.data.build().toRoot().apply(MesoscaleStateTransform, {
filter: '',
graphics: customState.graphicsMode,
}).commit();
customState.stateRef = state.ref;
},
get(ctx: PluginContext): MesoscaleState {
const ref = this.ref(ctx);
return ctx.state.data.tryGetCellData<MesoscaleStateObject>(ref);
},
async set(ctx: PluginContext, props: Partial<MesoscaleState>) {
const ref = this.ref(ctx);
await ctx.state.data.build().to(ref).update(MesoscaleStateTransform, old => Object.assign(old, props)).commit();
},
ref(ctx: PluginContext): string {
const ref = (ctx.customState as MesoscaleExplorerState).stateRef;
if (!ref) throw new Error('MesoscaleState not initialized');
return ref;
},
has(ctx: PluginContext): boolean {
const ref = (ctx.customState as MesoscaleExplorerState).stateRef || '';
return ctx.state.data.cells.has(ref) ? true : false;
},
};
//
export function getRoots(plugin: PluginContext): StateSelection.CellSeq<StateObjectCell<MesoscaleGroupObject>> {
const s = plugin.customState as MesoscaleExplorerState;
if (!s.stateCache.roots) {
s.stateCache.roots = plugin.state.data.select(StateSelection.Generators.rootsOfType(MesoscaleGroupObject));
}
return s.stateCache.roots;
}
export function getGroups(plugin: PluginContext, tag?: string): StateSelection.CellSeq<StateObjectCell<MesoscaleGroupObject>> {
const s = plugin.customState as MesoscaleExplorerState;
const k = `groups-${tag || ''}`;
if (!s.stateCache[k]) {
const selector = tag !== undefined
? StateSelection.Generators.ofTransformer(MesoscaleGroup).withTag(tag)
: StateSelection.Generators.ofTransformer(MesoscaleGroup);
s.stateCache[k] = plugin.state.data.select(selector);
}
return s.stateCache[k];
}
function _getAllGroups(plugin: PluginContext, tag: string | undefined, list: StateObjectCell[]) {
const groups = getGroups(plugin, tag);
list.push(...groups);
for (const g of groups) {
_getAllGroups(plugin, g.params?.values.tag, list);
}
return list;
}
export function getAllGroups(plugin: PluginContext, tag?: string) {
return _getAllGroups(plugin, tag, []);
}
export function getAllLeafGroups(plugin: PluginContext, tag: string) {
const allGroups = getAllGroups(plugin, tag);
allGroups.sort((a, b) => a.params?.values.index - b.params?.values.index);
return allGroups.filter(g => {
return getEntities(plugin, g.params?.values.tag).length > 0;
});
}
type EntityCells = StateSelection.CellSeq<StateObjectCell<PSO.Molecule.Structure.Representation3D | PSO.Shape.Representation3D>>
export function getEntities(plugin: PluginContext, tag?: string): EntityCells {
const s = plugin.customState as MesoscaleExplorerState;
const k = `entities-${tag || ''}`;
if (!s.stateCache[k]) {
const structureSelector = tag !== undefined
? StateSelection.Generators.ofTransformer(StructureRepresentation3D).withTag(tag)
: StateSelection.Generators.ofTransformer(StructureRepresentation3D);
const shapeSelector = tag !== undefined
? StateSelection.Generators.ofTransformer(ShapeRepresentation3D).withTag(tag)
: StateSelection.Generators.ofTransformer(ShapeRepresentation3D);
s.stateCache[k] = [
...plugin.state.data.select(structureSelector).filter(c => c.obj!.data.sourceData.elementCount > 0),
...plugin.state.data.select(shapeSelector),
];
}
return s.stateCache[k];
}
function getFilterMatcher(filter: string) {
return filter.startsWith('"') && filter.endsWith('"')
? new RegExp(`^${escapeRegExp(filter.substring(1, filter.length - 1))}$`, 'g')
: new RegExp(escapeRegExp(filter), 'gi');
}
export function getFilteredEntities(plugin: PluginContext, tag: string, filter: string) {
const matcher = getFilterMatcher(filter);
return getEntities(plugin, tag).filter(c => getEntityLabel(plugin, c).match(matcher) !== null);
}
function _getAllEntities(plugin: PluginContext, tag: string | undefined, list: EntityCells) {
list.push(...getEntities(plugin, tag));
for (const g of getGroups(plugin, tag)) {
_getAllEntities(plugin, g.params?.values.tag, list);
}
return list;
}
export function getAllEntities(plugin: PluginContext, tag?: string) {
return _getAllEntities(plugin, tag, []);
}
export function getAllFilteredEntities(plugin: PluginContext, tag: string, filter: string) {
const matcher = getFilterMatcher(filter);
return getAllEntities(plugin, tag).filter(c => getEntityLabel(plugin, c).match(matcher) !== null);
}
export function getEntityLabel(plugin: PluginContext, cell: StateObjectCell) {
return StateObjectRef.resolve(plugin.state.data, cell.transform.parent)?.obj?.label || 'Entity';
}
//
export async function updateColors(plugin: PluginContext, values: PD.Values, tag: string, filter: string) {
const update = plugin.state.data.build();
const { type, value, shift, lightness, alpha, emissive } = values;
if (type === 'group-generate' || type === 'group-uniform') {
const groups = getAllLeafGroups(plugin, tag);
const baseColors = getDistinctBaseColors(groups.length, shift);
for (let i = 0; i < groups.length; ++i) {
const g = groups[i];
const entities = getFilteredEntities(plugin, g.params?.values.tag, filter);
let groupColors: Color[] = [];
if (type === 'group-generate') {
const c = g.params?.values.color;
groupColors = getDistinctGroupColors(entities.length, baseColors[i], c.variability, c.shift);
}
for (let j = 0; j < entities.length; ++j) {
const c = type === 'group-generate' ? groupColors[j] : baseColors[i];
update.to(entities[j]).update(old => {
if (old.type) {
old.colorTheme.params.value = c;
old.colorTheme.params.lightness = lightness;
old.type.params.alpha = alpha;
old.type.params.xrayShaded = alpha < 1 ? 'inverted' : false;
old.type.params.emissive = emissive;
} else if (old.coloring) {
old.coloring.params.color = c;
old.coloring.params.lightness = lightness;
old.alpha = alpha;
old.xrayShaded = alpha < 1 ? true : false;
old.emissive = emissive;
}
});
}
update.to(g.transform.ref).update(old => {
old.color.type = type === 'group-generate' ? 'generate' : 'uniform';
old.color.value = baseColors[i];
old.color.lightness = lightness;
old.color.alpha = alpha;
old.color.emissive = emissive;
});
}
} else if (type === 'generate' || type === 'uniform') {
const entities = getAllFilteredEntities(plugin, tag, filter);
let groupColors: Color[] = [];
if (type === 'generate') {
groupColors = getDistinctBaseColors(entities.length, shift);
}
for (let j = 0; j < entities.length; ++j) {
const c = type === 'generate' ? groupColors[j] : value;
update.to(entities[j]).update(old => {
if (old.type) {
old.colorTheme.params.value = c;
old.colorTheme.params.lightness = lightness;
old.type.params.alpha = alpha;
old.type.params.xrayShaded = alpha < 1 ? 'inverted' : false;
old.type.params.emissive = emissive;
} else if (old.coloring) {
old.coloring.params.color = c;
old.coloring.params.lightness = lightness;
old.alpha = alpha;
old.xrayShaded = alpha < 1 ? true : false;
old.emissive = emissive;
}
});
}
const others = getAllLeafGroups(plugin, tag);
for (const o of others) {
update.to(o).update(old => {
old.color.type = type === 'generate' ? 'custom' : 'uniform';
old.color.value = value;
old.color.lightness = lightness;
old.color.alpha = alpha;
old.color.emissive = emissive;
});
}
}
await update.commit();
};
export function expandAllGroups(plugin: PluginContext) {
for (const g of getAllGroups(plugin)) {
if (g.state.isCollapsed) {
plugin.state.data.updateCellState(g.transform.ref, { isCollapsed: false });
}
}
};

View File

@@ -0,0 +1,87 @@
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { OrderedSet, SortedArray } from '../../../mol-data/int';
import { Box3D, GridLookup3D, PositionData, Sphere3D } from '../../../mol-math/geometry';
import { Vec3 } from '../../../mol-math/linear-algebra';
import { ElementIndex, Unit } from '../../../mol-model/structure';
export function mergeUnits(units: readonly Unit[], id: number): Unit {
const u = units[0];
let start = -1 as ElementIndex, end = -1 as ElementIndex;
let elements = SortedArray.Empty as SortedArray<ElementIndex>;
for (let i = 0, il = units.length; i < il; ++i) {
const e = units[i].elements;
if (SortedArray.isRange(e)) {
if (end !== -1 && e[0] === end + 1) {
// extend range
end = e[e.length - 1];
} else {
if (end !== -1) {
// pending range
elements = SortedArray.union(elements, SortedArray.ofRange(start, end));
}
// new range
start = e[0];
end = e[e.length - 1];
}
} else {
if (end !== -1) {
// pending range
elements = SortedArray.union(elements, SortedArray.ofRange(start, end));
start = -1 as ElementIndex, end = -1 as ElementIndex;
}
elements = SortedArray.union(elements, e);
}
}
if (end !== -1) {
// pending range
elements = SortedArray.union(elements, SortedArray.ofRange(start, end));
}
return Unit.create(id, id, 0, u.traits | Unit.Trait.MultiChain, u.kind, u.model, u.conformation.operator, elements);
}
export function partitionUnits(units: readonly Unit[], cellSize: number) {
const unitCount = units.length;
const mergedUnits: Unit[] = [];
const box = Box3D.setEmpty(Box3D());
const x = new Float32Array(unitCount);
const y = new Float32Array(unitCount);
const z = new Float32Array(unitCount);
const indices = OrderedSet.ofBounds(0, unitCount);
for (let i = 0, il = unitCount; i < il; ++i) {
const v = units[i].boundary.sphere.center;
x[i] = v[0];
y[i] = v[1];
z[i] = v[2];
Box3D.add(box, v);
}
Box3D.expand(box, box, Vec3.create(1, 1, 1));
const positionData: PositionData = { x, y, z, indices };
const boundary = { box, sphere: Sphere3D.fromBox3D(Sphere3D(), box) };
const lookup = GridLookup3D(positionData, boundary, Vec3.create(cellSize, cellSize, cellSize));
const { array, offset, count } = lookup.buckets;
for (let i = 0, il = offset.length; i < il; ++i) {
const start = offset[i];
const size = count[i];
const cellUnits: Unit[] = [];
for (let j = start, jl = start + size; j < jl; ++j) {
cellUnits.push(units[array[j]]);
}
mergedUnits.push(mergeUnits(cellUnits, i));
}
return mergedUnits;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<title>Mol* Mesoscale Explorer</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
hr {
margin: 10px;
}
h1, h2, h3, h4, h5 {
margin-top: 5px;
margin-bottom: 3px;
}
button {
padding: 2px;
}
#app {
position: absolute;
left: 100px;
top: 100px;
width: 800px;
height: 600px;
}
</style>
<link rel="stylesheet" type="text/css" href="molstar.css" />
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="./molstar.js"></script>
<script type="text/javascript">
function getParam(name, regex) {
var r = new RegExp(name + '=' + '(' + regex + ')[&]?', 'i');
return decodeURIComponent(((window.location.search || '').match(r) || [])[1] || '');
}
var debugMode = getParam('debug-mode', '[^&]+').trim() === '1';
if (debugMode) molstar.setDebugMode(debugMode);
var timingMode = getParam('timing-mode', '[^&]+').trim() === '1';
if (timingMode) molstar.setTimingMode(timingMode);
var hideControls = getParam('hide-controls', '[^&]+').trim() === '1';
var preferWebgl1 = getParam('prefer-webgl1', '[^&]+').trim() === '1' || void 0;
var allowMajorPerformanceCaveat = getParam('allow-major-performance-caveat', '[^&]+').trim() === '1';
var powerPreference = getParam('power-preference', '[^&]+').trim().toLowerCase();
var graphicsMode = getParam('graphics-mode', '[^&]+').trim().toLowerCase();
molstar.MesoscaleExplorer.create('app', {
layoutShowControls: !hideControls,
viewportShowExpand: false,
preferWebgl1: preferWebgl1,
allowMajorPerformanceCaveat: allowMajorPerformanceCaveat,
powerPreference: powerPreference || 'high-performance',
graphicsMode: graphicsMode || 'quality',
}).then(me => {
var example = getParam('example', '[^&]+').trim();
if (example) {
me.loadExample(example);
return;
}
var url = getParam('url', '[^&]+').trim();
var type = getParam('type', '[^&]+').trim();
if (url && type) {
me.loadUrl(url, type);
return;
}
var pdb = getParam('pdb', '[^&]+').trim();
if (pdb) {
me.loadPdb(pdb);
return;
}
var pdbdev = getParam('pdbdev', '[^&]+').trim();
if (pdbdev) {
me.loadPdbDev(pdbdev);
return;
}
window.addEventListener('unload', () => {
// to aid GC
me.dispose();
});
});
</script>
<!-- __MOLSTAR_ANALYTICS__ -->
</body>
</html>

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import './favicon.ico';
import './index.html';
require('./style.scss');
export * from './app';

View File

@@ -0,0 +1,33 @@
$default-background: #2D3E50;
$font-color: #EDF1F2;
$hover-font-color: #3B9AD9;
$entity-current-font-color: #FFFFFF;
$msp-btn-remove-background: #BF3A31;
$msp-btn-remove-hover-font-color:#ffffff;
$msp-btn-commit-on-font-color: #ffffff;
$entity-badge-font-color: #ccd4e0;
// used in LOG
$log-message: #0CCA5D;
$log-info: #5E3673;
$log-warning: #FCC937;
$log-error: #FD354B;
$logo-background: rgba(0,0,0,0.75);
@function color-lower-contrast($color, $amount) {
@return darken($color, $amount);
}
@function color-increase-contrast($color, $amount) {
@return lighten($color, $amount);
}
@import 'mol-plugin-ui/skin/base/base';
a {
color: $font-color;
&:hover {
color: $hover-font-color;
}
}

View File

@@ -0,0 +1,973 @@
/**
* Copyright (c) 2022-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { PluginUIComponent } from '../../../mol-plugin-ui/base';
import { Button, ControlGroup, IconButton } from '../../../mol-plugin-ui/controls/common';
import { ArrowDropDownSvg, ArrowRightSvg, CloseSvg, VisibilityOffOutlinedSvg, VisibilityOutlinedSvg, ContentCutSvg, BrushSvg, SearchSvg } from '../../../mol-plugin-ui/controls/icons';
import { PluginCommands } from '../../../mol-plugin/commands';
import { State, StateObjectCell, StateSelection, StateTransformer } from '../../../mol-state';
import { ParameterControls, ParameterMappingControl, ParamOnChange, SelectControl } from '../../../mol-plugin-ui/controls/parameters';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { Clip } from '../../../mol-util/clip';
import { StructureRepresentation3D } from '../../../mol-plugin-state/transforms/representation';
import { Color } from '../../../mol-util/color';
import { CombinedColorControl } from '../../../mol-plugin-ui/controls/color';
import { MarkerAction } from '../../../mol-util/marker-action';
import { EveryLoci, Loci } from '../../../mol-model/loci';
import { deepEqual } from '../../../mol-util';
import { ColorValueParam, ColorParams, ColorProps, DimLightness, LightnessParams, LodParams, MesoscaleGroup, MesoscaleGroupProps, OpacityParams, SimpleClipParams, SimpleClipProps, createClipMapping, getClipObjects, getDistinctGroupColors, RootParams, MesoscaleState, getRoots, getAllGroups, getAllLeafGroups, getFilteredEntities, getAllFilteredEntities, getGroups, getEntities, getAllEntities, getEntityLabel, updateColors, getGraphicsModeProps, GraphicsMode, MesoscaleStateParams, setGraphicsCanvas3DProps, PatternParams, expandAllGroups, EmissiveParams } from '../data/state';
import React from 'react';
import { MesoscaleExplorerState } from '../app';
import { StructureElement } from '../../../mol-model/structure/structure/element';
import { PluginStateObject as PSO } from '../../../mol-plugin-state/objects';
import { Structure } from '../../../mol-model/structure';
import { PluginContext } from '../../../mol-plugin/context';
import { Sphere3D } from '../../../mol-math/geometry';
function centerLoci(plugin: PluginContext, loci: Loci, durationMs = 250) {
const { canvas3d } = plugin;
if (!canvas3d) return;
const sphere = Loci.getBoundingSphere(loci) || Sphere3D();
const snapshot = canvas3d.camera.getCenter(sphere.center);
canvas3d.requestCameraReset({ durationMs, snapshot });
}
export class ModelInfo extends PluginUIComponent<{}, { isDisabled: boolean }> {
state = {
isDisabled: false,
};
componentDidMount() {
this.subscribe(this.plugin.state.data.behaviors.isUpdating, v => {
this.setState({ isDisabled: v });
});
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
if (!this.state.isDisabled && MesoscaleState.has(this.plugin) && MesoscaleState.ref(this.plugin) === e.ref) {
this.forceUpdate();
}
});
}
get info() {
if (!MesoscaleState.has(this.plugin)) return;
const state = MesoscaleState.get(this.plugin);
if (!state.description && !state.link) return;
return {
description: state.description,
link: state.link,
};
}
render() {
const info = this.info;
return info && <>
<div className='msp-help-text'>
<div>{info.description}</div>
<div><a href={info.link} target='_blank'>Source</a></div>
</div>
</>;
}
}
const SelectionStyleParam = PD.Select('color+outline', PD.objectToOptions({
'color+outline': 'Color & Outline',
'color': 'Color',
'outline': 'Outline'
} as const));
type SelectionStyle = typeof SelectionStyleParam['defaultValue']
export class SelectionInfo extends PluginUIComponent<{}, { isDisabled: boolean }> {
state = {
isDisabled: false,
};
componentDidMount() {
this.subscribe(this.plugin.state.data.behaviors.isUpdating, v => {
this.setState({ isDisabled: v });
});
this.subscribe(this.plugin.managers.structure.selection.events.changed, e => {
if (!this.state.isDisabled) {
this.forceUpdate();
}
});
}
get info() {
const info: { label: string, key: string }[] = [];
this.plugin.managers.structure.selection.entries.forEach((e, k) => {
if (StructureElement.Loci.is(e.selection) && !StructureElement.Loci.isEmpty(e.selection)) {
const cell = this.plugin.helpers.substructureParent.get(e.selection.structure);
info.push({
label: cell?.obj?.label || 'Unknown',
key: k,
});
}
});
return info;
}
find(label: string) {
MesoscaleState.set(this.plugin, { filter: `"${label}"` });
if (label) expandAllGroups(this.plugin);
};
remove(key: string) {
const e = this.plugin.managers.structure.selection.entries.get(key);
if (!e) return;
const loci = Structure.toStructureElementLoci(e.selection.structure);
this.plugin.managers.interactivity.lociSelects.deselect({ loci }, false);
}
center(key: string) {
const e = this.plugin.managers.structure.selection.entries.get(key);
if (!e) return;
const loci = Structure.toStructureElementLoci(e.selection.structure);
centerLoci(this.plugin, loci);
}
get selection() {
const info = this.info;
if (!info.length) return <>
<div className='msp-help-text'>
<div>Use <i>ctrl+left click</i> to select entities, either on the 3D canvas or in the tree below</div>
</div>
</>;
return <>
{info.map((entry, index) => {
const label = <Button className={`msp-btn-tree-label`} noOverflow disabled={this.state.isDisabled}
onClick={() => this.center(entry.key)}
>
<span title={entry.label}>{entry.label}</span>
</Button>;
const find = <IconButton svg={SearchSvg} toggleState={false} disabled={this.state.isDisabled} small onClick={() => this.find(entry.label)} />;
const remove = <IconButton svg={CloseSvg} toggleState={false} disabled={this.state.isDisabled} onClick={() => this.remove(entry.key)} />;
return <div key={index} className={`msp-flex-row`} style={{ margin: `1px 5px 1px ${1 * 10 + 5}px` }}>
{label}
{find}
{remove}
</div>;
})}
</>;
}
get style() {
const p = this.plugin.canvas3d?.props;
if (!p) return;
if (p.renderer.dimStrength === 1 && p.marking.enabled) return 'color+outline';
if (p.renderer.dimStrength === 1) return 'color';
if (p.marking.enabled) return 'outline';
}
setStyle(value: SelectionStyle) {
if (value.includes('color') && value.includes('outline')) {
this.plugin.canvas3d?.setProps({
renderer: {
dimStrength: 1,
},
marking: {
enabled: true
}
});
} else if (value.includes('color')) {
this.plugin.canvas3d?.setProps({
renderer: {
dimStrength: 1,
},
marking: {
enabled: false
}
});
} else if (value.includes('outline')) {
this.plugin.canvas3d?.setProps({
renderer: {
dimStrength: 0,
selectStrength: 0.3,
},
marking: {
enabled: true
}
});
} else {
this.plugin.canvas3d?.setProps({
renderer: {
dimStrength: 0,
selectStrength: 0,
},
marking: {
enabled: false
}
});
}
this.forceUpdate();
}
renderStyle() {
const style = this.style || '';
return <div style={{ margin: '5px', marginBottom: '10px' }}>
<SelectControl name={'Style'} param={SelectionStyleParam} value={style} onChange={(e) => { this.setStyle(e.value); }} />
</div>;
}
render() {
return <>
{this.renderStyle()}
{this.selection}
</>;
}
}
export class EntityControls extends PluginUIComponent<{}, { isDisabled: boolean }> {
filterRef = React.createRef<HTMLInputElement>();
prevFilter = '';
filterFocus = false;
state = {
isDisabled: false,
};
componentDidMount() {
this.subscribe(this.plugin.state.events.object.created, e => {
this.forceUpdate();
});
this.subscribe(this.plugin.state.events.object.removed, e => {
this.forceUpdate();
});
this.subscribe(this.plugin.state.data.behaviors.isUpdating, v => {
this.setState({ isDisabled: v });
});
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
if (!this.state.isDisabled && this.roots.some(r => e.cell === r) || (MesoscaleState.has(this.plugin) && MesoscaleState.ref(this.plugin) === e.ref)) {
this.forceUpdate();
}
});
}
componentDidUpdate(): void {
const filter = this.filter;
if (this.filterFocus) {
this.filterRef.current?.focus();
this.prevFilter = filter;
}
}
get roots() {
return getRoots(this.plugin);
}
setGroupBy = (value: number) => {
this.roots.forEach((c, i) => {
if (c.state.isHidden && value === i || !c.state.isHidden && value !== i) {
PluginCommands.State.ToggleVisibility(this.plugin, { state: c.parent!, ref: c.transform.ref });
}
});
};
get groupBy() {
const roots = this.roots;
for (let i = 0, il = roots.length; i < il; ++i) {
if (!roots[i].state.isHidden) return i;
}
return 0;
}
setFilter = (value: string) => {
this.filterFocus = true;
const filter = value.trim().replace(/\s+/gi, ' ');
MesoscaleState.set(this.plugin, { filter });
if (filter) expandAllGroups(this.plugin);
};
get filter() {
return MesoscaleState.has(this.plugin) ? MesoscaleState.get(this.plugin).filter : '';
}
setGraphics = (graphics: GraphicsMode) => {
MesoscaleState.set(this.plugin, { graphics });
(this.plugin.customState as MesoscaleExplorerState).graphicsMode = graphics;
if (graphics === 'custom') return;
const update = this.plugin.state.data.build();
const { lodLevels, approximate, alphaThickness } = getGraphicsModeProps(graphics);
for (const r of getAllEntities(this.plugin)) {
update.to(r).update(old => {
if (old.type) {
old.type.params.lodLevels = lodLevels;
old.type.params.approximate = approximate;
old.type.params.alphaThickness = alphaThickness;
}
});
}
for (const g of getAllGroups(this.plugin)) {
update.to(g).update(old => {
old.lod.lodLevels = lodLevels;
old.lod.approximate = approximate;
});
}
update.commit();
setGraphicsCanvas3DProps(this.plugin, graphics);
};
get graphics() {
const customState = this.plugin.customState as MesoscaleExplorerState;
return MesoscaleState.has(this.plugin) ? MesoscaleState.get(this.plugin).graphics : customState.graphicsMode;
}
renderGraphics() {
const graphics = this.graphics;
return <div style={{ margin: '5px', marginBottom: '10px' }}>
<SelectControl name={'Graphics'} param={MesoscaleStateParams.graphics} value={`${graphics}`} onChange={(e) => { this.setGraphics(e.value); }} />
</div>;
}
render() {
const roots = this.roots;
if (roots.length === 0 || !MesoscaleState.has(this.plugin)) {
return <>
{this.renderGraphics()}
</>;
}
const disabled = this.state.isDisabled;
const groupBy = this.groupBy;
const options: [string, string][] = [];
roots.forEach((c, i) => {
options.push([`${i}`, c.obj!.label]);
});
const groupParam = PD.Select(options[0][0], options);
const root = roots.length === 1 ? roots[0] : roots[groupBy];
const filter = this.filter;
return <>
{this.renderGraphics()}
<div className={`msp-flex-row msp-control-row`} style={{ margin: '5px', marginBottom: '10px' }}>
<input type='text' ref={this.filterRef}
value={filter}
placeholder='Search'
onChange={e => this.setFilter(e.target.value)}
disabled={disabled}
onBlur={() => this.filterFocus = false}
/>
<IconButton svg={CloseSvg} toggleState={false} disabled={disabled} onClick={() => this.setFilter('')} />
</div>
{options.length > 1 && <div style={{ margin: '5px', marginBottom: '10px' }}>
<SelectControl name={'Group By'} param={groupParam} value={`${groupBy}`} onChange={(e) => { this.setGroupBy(parseInt(e.value)); }} />
</div>}
<GroupNode filter={filter} cell={root} depth={0} />
</>;
}
}
class Node<P extends {}, S extends { isDisabled: boolean }> extends PluginUIComponent<P & { cell: StateObjectCell, depth: number }, S> {
is(e: State.ObjectEvent) {
return e.ref === this.ref && e.state === this.props.cell.parent;
}
get ref() {
return this.props.cell.transform.ref;
}
get cell() {
return this.props.cell;
}
get roots() {
return getRoots(this.plugin);
}
componentDidMount() {
this.subscribe(this.plugin.state.data.behaviors.isUpdating, v => {
this.setState({ isDisabled: v });
});
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
if (!this.state.isDisabled && this.is(e)) {
this.forceUpdate();
}
});
}
}
export class GroupNode extends Node<{ filter: string }, { isCollapsed: boolean, action?: 'color' | 'clip' | 'root', isDisabled: boolean }> {
state = {
isCollapsed: !!this.props.cell.state.isCollapsed,
action: undefined,
isDisabled: false,
};
toggleExpanded = (e: React.MouseEvent<HTMLElement>) => {
PluginCommands.State.ToggleExpanded(this.plugin, { state: this.cell.parent!, ref: this.ref });
};
toggleColor = (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
this.setState({ action: this.state.action === 'color' ? undefined : 'color' });
};
toggleClip = () => {
this.setState({ action: this.state.action === 'clip' ? undefined : 'clip' });
};
toggleRoot = () => {
this.setState({ action: this.state.action === 'root' ? undefined : 'root' });
};
highlight = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
this.plugin.canvas3d?.mark({ loci: EveryLoci }, MarkerAction.RemoveHighlight);
for (const r of this.allFilteredEntities) {
const repr = r.obj?.data.repr;
if (repr) {
this.plugin.canvas3d?.mark({ repr, loci: EveryLoci }, MarkerAction.Highlight);
}
}
};
clearHighlight = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
this.plugin.canvas3d?.mark({ loci: EveryLoci }, MarkerAction.RemoveHighlight);
e.currentTarget.blur();
};
get groups() {
return getGroups(this.plugin, this.cell.params?.values.tag);
}
get allGroups() {
const allGroups = getAllGroups(this.plugin, this.cell.params?.values.tag);
allGroups.push(this.cell);
return allGroups;
}
get entities() {
return getEntities(this.plugin, this.cell.params?.values.tag);
}
get filteredEntities() {
return getFilteredEntities(this.plugin, this.cell.params?.values.tag, this.props.filter);
}
get allEntities() {
return getAllEntities(this.plugin, this.cell.params?.values.tag);
}
get allFilteredEntities() {
return getAllFilteredEntities(this.plugin, this.cell.params?.values.tag, this.props.filter);
}
toggleVisible = (e: React.MouseEvent<HTMLElement>) => {
PluginCommands.State.ToggleVisibility(this.plugin, { state: this.cell.parent!, ref: this.ref });
const isHidden = this.cell.state.isHidden;
for (const r of this.allFilteredEntities) {
this.plugin.state.data.updateCellState(r.transform.ref, { isHidden });
}
this.plugin.build().to(this.ref).update(old => {
old.hidden = isHidden;
}).commit();
};
updateColor = (values: ColorProps) => {
const update = this.plugin.state.data.build();
const { value, type, lightness, alpha, emissive } = values;
const entities = this.filteredEntities;
let groupColors: Color[] = [];
if (type === 'generate') {
groupColors = getDistinctGroupColors(entities.length, value, values.variability, values.shift);
}
for (let i = 0; i < entities.length; ++i) {
const c = type === 'generate' ? groupColors[i] : value;
update.to(entities[i]).update(old => {
if (old.type) {
old.colorTheme.params.value = c;
old.colorTheme.params.lightness = lightness;
old.type.params.alpha = alpha;
old.type.params.xrayShaded = alpha < 1 ? 'inverted' : false;
old.type.params.emissive = emissive;
} else {
old.coloring.params.color = c;
old.coloring.params.lightness = lightness;
old.alpha = alpha;
old.xrayShaded = alpha < 1 ? true : false;
old.emissive = emissive;
}
});
}
update.to(this.ref).update(old => {
old.color = values;
});
for (const r of this.roots) {
update.to(r).update(old => {
old.color.type = 'custom';
});
}
update.commit();
};
updateRoot = async (values: PD.Values) => {
await updateColors(this.plugin, values, this.cell.params?.values.tag, this.props.filter);
const update = this.plugin.state.data.build();
for (const r of this.roots) {
if (r !== this.cell) {
update.to(r).update(old => {
old.color.type = 'custom';
});
const others = getAllLeafGroups(this.plugin, r.params?.values.tag);
for (const o of others) {
update.to(o).update(old => {
old.color.type = 'custom';
});
}
}
}
update.to(this.ref).update(old => {
old.color = values;
});
update.commit();
};
updateClip = (values: PD.Values) => {
const update = this.plugin.state.data.build();
const clipObjects = getClipObjects(values as SimpleClipProps, this.plugin.canvas3d!.boundingSphere);
for (const r of this.allFilteredEntities) {
update.to(r).update(old => {
if (old.type) {
old.type.params.clip.objects = clipObjects;
} else {
old.clip.objects = clipObjects;
}
});
}
for (const g of this.allGroups) {
update.to(g).update(old => {
old.clip = values;
});
}
update.commit();
};
updateLod = (values: PD.Values) => {
MesoscaleState.set(this.plugin, { graphics: 'custom' });
(this.plugin.customState as MesoscaleExplorerState).graphicsMode = 'custom';
const update = this.plugin.state.data.build();
for (const r of this.allFilteredEntities) {
update.to(r).update(old => {
if (old.type) {
old.type.params.lodLevels = values.lodLevels;
old.type.params.cellSize = values.cellSize;
old.type.params.batchSize = values.batchSize;
old.type.params.approximate = values.approximate;
}
});
}
for (const g of this.allGroups) {
update.to(g).update(old => {
old.lod = values;
});
}
update.commit();
};
update = (props: MesoscaleGroupProps) => {
this.plugin.state.data.build().to(this.ref).update(props);
};
renderColor() {
const color = this.cell.params?.values.color;
if (this.cell.params?.values.color.type === 'uniform') {
const style = {
backgroundColor: Color.toStyle(color.value),
minWidth: 32,
width: 32,
borderRight: `6px solid ${Color.toStyle(Color.lighten(color.value, color.lightness))}`
};
return <Button style={style} onClick={this.toggleColor} />;
} else if (this.cell.params?.values.color.type === 'generate') {
const style = {
minWidth: 32,
width: 32,
borderRight: `6px solid ${Color.toStyle(Color.lighten(color.value, color.lightness))}`
};
return <IconButton style={style} svg={BrushSvg} toggleState={false} small onClick={this.toggleColor} />;
} else {
return <IconButton svg={BrushSvg} toggleState={false} small onClick={this.toggleColor} />;
}
}
render() {
if (this.allFilteredEntities.length === 0) return;
const state = this.cell.state;
const disabled = false;
const groupLabel = this.cell.obj!.label;
const depth = this.props.depth;
const colorValue = this.cell.params?.values.color;
const rootValue = this.cell.params?.values.color;
const clipValue = this.cell.params?.values.clip;
const lodValue = this.cell.params?.values.lod;
const isRoot = this.cell.params?.values.root;
const groups = this.groups;
const entities = this.entities;
const label = <Button className={`msp-btn-tree-label`} noOverflow disabled={disabled}
onMouseEnter={this.highlight}
onMouseLeave={this.clearHighlight}
>
<span title={groupLabel}>{groupLabel}</span>
</Button>;
const expand = <IconButton svg={state.isCollapsed ? ArrowRightSvg : ArrowDropDownSvg} flex='20px' disabled={disabled} onClick={this.toggleExpanded} transparent className='msp-no-hover-outline' style={{ visibility: groups.length > 0 || entities.length > 0 ? 'visible' : 'hidden' }} />;
const color = (entities.length > 0 && !isRoot) && this.renderColor();
const root = (isRoot && this.allGroups.length > 1) && <IconButton svg={BrushSvg} toggleState={false} disabled={disabled} small onClick={this.toggleRoot} />;
const clip = <IconButton svg={ContentCutSvg} toggleState={false} disabled={disabled} small onClick={this.toggleClip} />;
const visibility = <IconButton svg={state.isHidden ? VisibilityOffOutlinedSvg : VisibilityOutlinedSvg} toggleState={false} disabled={disabled} small onClick={this.toggleVisible} />;
return <>
<div className={`msp-flex-row`} style={{ margin: `1px 5px 1px ${depth * 10 + 5}px` }}>
{expand}
{label}
{root || color}
{clip}
{visibility}
</div>
{this.state.action === 'color' && <div style={{ marginRight: 5 }} className='msp-accent-offset'>
<ControlGroup header='Color' initialExpanded={true} hideExpander={true} hideOffset={true} onHeaderClick={this.toggleColor}
topRightIcon={CloseSvg} noTopMargin childrenClassName='msp-viewport-controls-panel-controls'>
<ParameterControls params={ColorParams} values={colorValue} onChangeValues={this.updateColor} />
</ControlGroup>
</div>}
{this.state.action === 'clip' && <div style={{ marginRight: 5 }} className='msp-accent-offset'>
<ControlGroup header='Clip' initialExpanded={true} hideExpander={true} hideOffset={true} onHeaderClick={this.toggleClip}
topRightIcon={CloseSvg} noTopMargin childrenClassName='msp-viewport-controls-panel-controls'>
<ParameterControls params={SimpleClipParams} values={clipValue} onChangeValues={this.updateClip} />
<ParameterControls params={LodParams} values={lodValue} onChangeValues={this.updateLod} />
</ControlGroup>
</div>}
{this.state.action === 'root' && <div style={{ marginRight: 5 }} className='msp-accent-offset'>
<ControlGroup header='Color' initialExpanded={true} hideExpander={true} hideOffset={true} onHeaderClick={this.toggleRoot}
topRightIcon={CloseSvg} noTopMargin childrenClassName='msp-viewport-controls-panel-controls'>
<ParameterControls params={RootParams} values={rootValue} onChangeValues={this.updateRoot} />
</ControlGroup>
</div>}
{(!state.isCollapsed) && <>
{groups.map(c => {
return <GroupNode filter={this.props.filter} cell={c} depth={depth + 1} key={c.transform.ref} />;
})}
{this.filteredEntities.map(c => {
return <EntityNode cell={c} depth={depth + 1} key={c.transform.ref} />;
})}
</>}
</>;
}
}
export class EntityNode extends Node<{}, { action?: 'color' | 'clip', isDisabled: boolean }> {
state = {
action: undefined,
isDisabled: false,
};
clipMapping = createClipMapping(this);
get groups() {
return this.plugin.state.data.select(StateSelection.Generators.ofTransformer(MesoscaleGroup)
.filter(c => !!this.cell.transform.tags?.includes(c.params?.values.tag)));
}
toggleVisible = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
PluginCommands.State.ToggleVisibility(this.plugin, { state: this.props.cell.parent!, ref: this.ref });
e.currentTarget.blur();
};
toggleColor = (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
if (e?.ctrlKey) {
this.updateLightness({ lightness: this.lightnessValue?.lightness ? 0 : DimLightness });
e.preventDefault();
} else {
this.setState({ action: this.state.action === 'color' ? undefined : 'color' });
}
};
toggleClip = () => {
this.setState({ action: this.state.action === 'clip' ? undefined : 'clip' });
};
highlight = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
this.plugin.canvas3d?.mark({ loci: EveryLoci }, MarkerAction.RemoveHighlight);
const repr = this.cell?.obj?.data.repr;
if (repr) {
this.plugin.canvas3d?.mark({ repr, loci: EveryLoci }, MarkerAction.Highlight);
}
e.currentTarget.blur();
};
clearHighlight = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
this.plugin.canvas3d?.mark({ loci: EveryLoci }, MarkerAction.RemoveHighlight);
e.currentTarget.blur();
};
toggleSelect = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
const cell = this.cell as StateObjectCell<PSO.Molecule.Structure.Representation3D | PSO.Shape.Representation3D> | undefined;
if (!(cell?.obj?.data.sourceData instanceof Structure)) return;
const loci = Structure.toStructureElementLoci(cell.obj.data.sourceData);
this.plugin.managers.interactivity.lociSelects.toggle({ loci }, false);
};
center = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
const cell = this.cell as StateObjectCell<PSO.Molecule.Structure.Representation3D | PSO.Shape.Representation3D> | undefined;
if (!(cell?.obj?.data.sourceData instanceof Structure)) return;
const loci = Structure.toStructureElementLoci(cell.obj.data.sourceData);
centerLoci(this.plugin, loci);
};
handleClick = (e: React.MouseEvent<HTMLElement>) => {
if (e.ctrlKey) {
this.toggleSelect(e);
} else {
this.center(e);
}
};
get colorValue(): Color | undefined {
return this.cell.transform.params?.colorTheme?.params.value ?? this.cell.transform.params?.coloring?.params.color;
}
get lightnessValue(): { lightness: number } | undefined {
return {
lightness: this.cell.transform.params?.colorTheme?.params.lightness ?? this.cell.transform.params?.coloring?.params.lightness ?? 0
};
}
get opacityValue(): { alpha: number } | undefined {
return {
alpha: this.cell.transform.params?.type?.params.alpha ?? this.cell.transform.params?.alpha ?? 1
};
}
get emissiveValue(): { emissive: number } | undefined {
return {
emissive: this.cell.transform.params?.type?.params.emissive ?? this.cell.transform.params?.emissive ?? 0
};
}
get clipValue(): Clip.Props | undefined {
return this.cell.transform.params.type?.params.clip ?? this.cell.transform.params.clip;
}
get lodValue(): PD.Values<typeof LodParams> | undefined {
const p = this.cell.transform.params?.type?.params;
if (!p) return;
return {
lodLevels: p.lodLevels,
cellSize: p.cellSize,
batchSize: p.batchSize,
approximate: p.approximate,
};
}
get patternValue(): { amplitude: number, frequency: number } | undefined {
const p = this.cell.transform.params;
if (p.type) return;
return {
amplitude: p.bumpAmplitude,
frequency: p.bumpFrequency * 10,
};
}
updateColor: ParamOnChange = ({ value }) => {
const update = this.plugin.state.data.build();
for (const g of this.groups) {
update.to(g.transform.ref).update(old => {
old.color.type = 'custom';
});
}
for (const r of this.roots) {
update.to(r).update(old => {
old.color.type = 'custom';
});
}
update.to(this.ref).update(old => {
if (old.colorTheme) {
old.colorTheme.params.value = value;
} else if (old.coloring) {
old.coloring.params.color = value;
}
});
update.commit();
};
updateLightness = (values: PD.Values) => {
return this.plugin.build().to(this.ref).update(old => {
if (old.colorTheme) {
old.colorTheme.params.lightness = values.lightness;
} else if (old.coloring) {
old.coloring.params.lightness = values.lightness;
}
}).commit();
};
updateOpacity = (values: PD.Values) => {
return this.plugin.build().to(this.ref).update(old => {
if (old.type) {
old.type.params.alpha = values.alpha;
old.type.params.xrayShaded = values.alpha < 1 ? 'inverted' : false;
} else {
old.alpha = values.alpha;
old.xrayShaded = values.alpha < 1 ? true : false;
}
}).commit();
};
updateEmissive = (values: PD.Values) => {
return this.plugin.build().to(this.ref).update(old => {
if (old.type) {
old.type.params.emissive = values.emissive;
} else {
old.emissive = values.emissive;
}
}).commit();
};
updateClip = (props: Clip.Props) => {
const params = this.cell.transform.params;
const clip = params.type ? params.type.params.clip : params.clip;
if (!PD.areEqual(Clip.Params, clip, props)) {
this.plugin.build().to(this.ref).update(old => {
if (old.type) {
old.type.params.clip = props;
} else {
old.clip = props;
}
}).commit();
}
};
updateLod = (values: PD.Values) => {
const params = this.cell.transform.params as StateTransformer.Params<StructureRepresentation3D>;
if (!params.type) return;
MesoscaleState.set(this.plugin, { graphics: 'custom' });
(this.plugin.customState as MesoscaleExplorerState).graphicsMode = 'custom';
if (!deepEqual(params.type.params.lodLevels, values.lodLevels) || params.type.params.cellSize !== values.cellSize || params.type.params.batchSize !== values.batchSize || params.type.params.approximate !== values.approximate) {
this.plugin.build().to(this.ref).update(old => {
old.type.params.lodLevels = values.lodLevels;
old.type.params.cellSize = values.cellSize;
old.type.params.batchSize = values.batchSize;
old.type.params.approximate = values.approximate;
}).commit();
}
};
updatePattern = (values: PD.Values) => {
return this.plugin.build().to(this.ref).update(old => {
if (!old.type) {
old.bumpAmplitude = values.amplitude;
old.bumpFrequency = values.frequency / 10;
}
}).commit();
};
render() {
const cellState = this.cell.state;
const disabled = this.cell.status !== 'error' && this.cell.status !== 'ok';
const depth = this.props.depth;
const colorValue = this.colorValue;
const lightnessValue = this.lightnessValue;
const opacityValue = this.opacityValue;
const emissiveValue = this.emissiveValue;
const lodValue = this.lodValue;
const patternValue = this.patternValue;
const l = getEntityLabel(this.plugin, this.cell);
const label = <Button className={`msp-btn-tree-label msp-type-class-${this.cell.obj!.type.typeClass}`} noOverflow disabled={disabled}
onClick={this.handleClick}
onMouseEnter={this.highlight}
onMouseLeave={this.clearHighlight}
>
<span title={l}>{l}</span>
</Button>;
const color = colorValue !== undefined && <Button style={{ backgroundColor: Color.toStyle(colorValue), minWidth: 32, width: 32, borderRight: `6px solid ${Color.toStyle(Color.lighten(colorValue, lightnessValue?.lightness || 0))}` }} onClick={this.toggleColor} />;
const clip = <IconButton svg={ContentCutSvg} toggleState={false} disabled={disabled} small onClick={this.toggleClip} />;
const visibility = <IconButton svg={cellState.isHidden ? VisibilityOffOutlinedSvg : VisibilityOutlinedSvg} toggleState={false} disabled={disabled} small onClick={this.toggleVisible} />;
return <>
<div className={`msp-flex-row`} style={{ margin: `1px 5px 1px ${depth * 10 + 5}px` }}>
{label}
{color}
{clip}
{visibility}
</div>
{this.state.action === 'color' && colorValue !== void 0 && <div style={{ marginRight: 5 }} className='msp-accent-offset'>
<ControlGroup header='Color' initialExpanded={true} hideExpander={true} hideOffset={true} onHeaderClick={this.toggleColor}
topRightIcon={CloseSvg} noTopMargin childrenClassName='msp-viewport-controls-panel-controls'>
<CombinedColorControl param={ColorValueParam} value={colorValue ?? Color(0xFFFFFF)} onChange={this.updateColor} name='color' hideNameRow />
<ParameterControls params={LightnessParams} values={lightnessValue} onChangeValues={this.updateLightness} />
<ParameterControls params={OpacityParams} values={opacityValue} onChangeValues={this.updateOpacity} />
<ParameterControls params={EmissiveParams} values={emissiveValue} onChangeValues={this.updateEmissive} />
{patternValue && <ParameterControls params={PatternParams} values={patternValue} onChangeValues={this.updatePattern} />}
</ControlGroup>
</div>}
{this.state.action === 'clip' && <div style={{ marginRight: 5 }} className='msp-accent-offset'>
<ControlGroup header='Clip' initialExpanded={true} hideExpander={true} hideOffset={true} onHeaderClick={this.toggleClip}
topRightIcon={CloseSvg} noTopMargin childrenClassName='msp-viewport-controls-panel-controls'>
<ParameterMappingControl mapping={this.clipMapping} />
{lodValue && <ParameterControls params={LodParams} values={lodValue} onChangeValues={this.updateLod} />}
</ControlGroup>
</div>}
</>;
}
}

View File

@@ -0,0 +1,98 @@
/**
* Copyright (c) 2022-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Mp4EncoderUI } from '../../../extensions/mp4-export/ui';
import { PluginUIComponent } from '../../../mol-plugin-ui/base';
import { SectionHeader } from '../../../mol-plugin-ui/controls/common';
import { MesoscaleExplorerState } from '../app';
import { MesoscaleState } from '../data/state';
import { EntityControls, ModelInfo, SelectionInfo } from './entities';
import { LoaderControls, ExampleControls, SessionControls, SnapshotControls, DatabaseControls } from './states';
const Spacer = () => <div style={{ height: '2em' }} />;
export class LeftPanel extends PluginUIComponent {
render() {
const customState = this.plugin.customState as MesoscaleExplorerState;
return <div className='msp-scrollable-container'>
<SectionHeader title='Database' />
<DatabaseControls />
<Spacer />
<SectionHeader title='Open' />
<LoaderControls />
<Spacer />
{customState.examples?.length && <>
<SectionHeader title='Example' />
<ExampleControls />
<Spacer />
</>}
<SectionHeader title='Session' />
<SessionControls />
<Spacer />
<SectionHeader title='Snapshots' />
<SnapshotControls />
<Spacer />
<Mp4EncoderUI />
</div>;
}
}
export class RightPanel extends PluginUIComponent<{}, { isDisabled: boolean }> {
state = {
isDisabled: false,
};
get hasModelInfo() {
return (
MesoscaleState.has(this.plugin) &&
!!(MesoscaleState.get(this.plugin).description ||
MesoscaleState.get(this.plugin).link)
);
}
componentDidMount() {
this.subscribe(this.plugin.state.data.behaviors.isUpdating, v => {
this.setState({ isDisabled: v });
});
this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
if (!this.state.isDisabled && MesoscaleState.has(this.plugin) && MesoscaleState.ref(this.plugin) === e.ref) {
this.forceUpdate();
}
});
this.subscribe(this.plugin.managers.structure.selection.events.changed, e => {
if (!this.state.isDisabled) {
this.forceUpdate();
}
});
}
render() {
return <div className='msp-scrollable-container'>
{this.hasModelInfo && <>
<SectionHeader title='Model' />
<ModelInfo />
<Spacer />
</>}
<>
<SectionHeader title='Selection' />
<SelectionInfo />
<Spacer />
</>
<SectionHeader title='Entities' />
<EntityControls />
</div>;
}
}

View File

@@ -0,0 +1,363 @@
/**
* Copyright (c) 2022-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { MmcifFormat } from '../../../mol-model-formats/structure/mmcif';
import { MmcifProvider } from '../../../mol-plugin-state/formats/trajectory';
import { PluginStateObject } from '../../../mol-plugin-state/objects';
import { PluginUIComponent } from '../../../mol-plugin-ui/base';
import { Button, ExpandGroup } from '../../../mol-plugin-ui/controls/common';
import { GetAppSvg, Icon, OpenInBrowserSvg } from '../../../mol-plugin-ui/controls/icons';
import { ApplyActionControl } from '../../../mol-plugin-ui/state/apply-action';
import { LocalStateSnapshotList, LocalStateSnapshotParams, LocalStateSnapshots } from '../../../mol-plugin-ui/state/snapshots';
import { PluginCommands } from '../../../mol-plugin/commands';
import { PluginContext } from '../../../mol-plugin/context';
import { StateAction, StateObjectRef, StateTransform } from '../../../mol-state';
import { Task } from '../../../mol-task';
import { Color } from '../../../mol-util/color/color';
import { getFileNameInfo } from '../../../mol-util/file-info';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { ExampleEntry, MesoscaleExplorerState } from '../app';
import { createCellpackHierarchy } from '../data/cellpack/preset';
import { createGenericHierarchy } from '../data/generic/preset';
import { createMmcifHierarchy } from '../data/mmcif/preset';
import { createPetworldHierarchy } from '../data/petworld/preset';
import { MesoscaleState, MesoscaleStateObject, setGraphicsCanvas3DProps } from '../data/state';
function adjustPluginProps(ctx: PluginContext) {
ctx.managers.interactivity.setProps({ granularity: 'chain' });
ctx.canvas3d?.setProps({
multiSample: { mode: 'off' },
cameraClipping: { far: false, minNear: 50 },
sceneRadiusFactor: 2,
renderer: {
colorMarker: true,
highlightColor: Color(0xffffff),
highlightStrength: 0,
selectColor: Color(0xffffff),
selectStrength: 0,
dimColor: Color(0xffffff),
dimStrength: 1,
markerPriority: 2,
interiorColorFlag: false,
interiorDarkening: 0.15,
exposure: 1.1,
xrayEdgeFalloff: 3,
},
marking: {
enabled: true,
highlightEdgeColor: Color(0x999999),
selectEdgeColor: Color(0xffff00),
highlightEdgeStrength: 1,
selectEdgeStrength: 1,
ghostEdgeStrength: 1,
innerEdgeFactor: 2.5,
edgeScale: 2,
},
postprocessing: {
occlusion: {
name: 'on',
params: {
samples: 32,
multiScale: {
name: 'on',
params: {
levels: [
{ radius: 2, bias: 1.0 },
{ radius: 5, bias: 1.0 },
{ radius: 8, bias: 1.0 },
{ radius: 11, bias: 1.0 },
],
nearThreshold: 10,
farThreshold: 1500,
}
},
radius: 5,
bias: 1,
blurKernelSize: 11,
resolutionScale: 1,
color: Color(0x000000),
}
},
shadow: {
name: 'on',
params: {
bias: 0.6,
maxDistance: 80,
steps: 3,
tolerance: 1.0,
}
},
outline: {
name: 'on',
params: {
scale: 1,
threshold: 0.15,
color: Color(0x000000),
includeTransparent: false,
}
}
}
});
const { graphics } = MesoscaleState.get(ctx);
setGraphicsCanvas3DProps(ctx, graphics);
}
async function createHierarchy(ctx: PluginContext, ref: string) {
const parsed = await MmcifProvider.parse(ctx, ref);
const tr = StateObjectRef.resolveAndCheck(ctx.state.data, parsed.trajectory)?.obj?.data;
if (!tr) throw new Error('no trajectory');
if (!MmcifFormat.is(tr.representative.sourceData)) {
throw new Error('not mmcif');
}
const { frame, db } = tr.representative.sourceData.data;
let hasCellpackAssemblyMethodDetails = false;
const { method_details } = db.pdbx_struct_assembly;
for (let i = 0, il = method_details.rowCount; i < il; ++i) {
if (method_details.value(i).toUpperCase() === 'CELLPACK') {
hasCellpackAssemblyMethodDetails = true;
break;
}
}
if (frame.categories.pdbx_model) {
await createPetworldHierarchy(ctx, parsed.trajectory);
} else if (
frame.header.toUpperCase().includes('CELLPACK') ||
hasCellpackAssemblyMethodDetails
) {
await createCellpackHierarchy(ctx, parsed.trajectory);
} else {
await createMmcifHierarchy(ctx, parsed.trajectory);
}
}
async function reset(ctx: PluginContext) {
const customState = ctx.customState as MesoscaleExplorerState;
delete customState.stateRef;
customState.stateCache = {};
ctx.managers.asset.clear();
await PluginCommands.State.Snapshots.Clear(ctx);
await PluginCommands.State.RemoveObject(ctx, { state: ctx.state.data, ref: StateTransform.RootRef });
await MesoscaleState.init(ctx);
adjustPluginProps(ctx);
}
export async function loadExampleEntry(ctx: PluginContext, entry: ExampleEntry) {
const { url, type } = entry;
await loadUrl(ctx, url, type);
MesoscaleState.set(ctx, {
description: entry.description || entry.label,
link: entry.link,
});
}
export async function loadUrl(ctx: PluginContext, url: string, type: 'molx' | 'molj' | 'cif' | 'bcif') {
if (type === 'molx' || type === 'molj') {
await PluginCommands.State.Snapshots.OpenUrl(ctx, { url, type });
} else {
await reset(ctx);
const isBinary = type === 'bcif';
const data = await ctx.builders.data.download({ url, isBinary });
await createHierarchy(ctx, data.ref);
}
}
export async function loadPdb(ctx: PluginContext, id: string) {
await reset(ctx);
const url = `https://models.rcsb.org/${id.toUpperCase()}.bcif`;
const data = await ctx.builders.data.download({ url, isBinary: true });
await createHierarchy(ctx, data.ref);
}
export async function loadPdbDev(ctx: PluginContext, id: string) {
await reset(ctx);
const nId = id.toUpperCase().startsWith('PDBDEV_') ? id : `PDBDEV_${id.padStart(8, '0')}`;
const url = `https://pdb-dev.wwpdb.org/bcif/${nId.toUpperCase()}.bcif`;
const data = await ctx.builders.data.download({ url, isBinary: true });
await createHierarchy(ctx, data.ref);
}
//
export const LoadDatabase = StateAction.build({
display: { name: 'Database', description: 'Load from Database' },
params: (a, ctx: PluginContext) => {
return {
source: PD.Select('pdb', PD.objectToOptions({ pdb: 'PDB', pdbDev: 'PDB-Dev' })),
entry: PD.Text(''),
};
},
from: PluginStateObject.Root
})(({ params }, ctx: PluginContext) => Task.create('Loading from database...', async taskCtx => {
if (params.source === 'pdb') {
await loadPdb(ctx, params.entry);
} else if (params.source === 'pdbDev') {
await loadPdbDev(ctx, params.entry);
}
}));
export const LoadExample = StateAction.build({
display: { name: 'Load', description: 'Load an example' },
params: (a, ctx: PluginContext) => {
const entries = (ctx.customState as MesoscaleExplorerState).examples || [];
return {
entry: PD.Select(0, entries.map((s, i) => [i, s.label])),
};
},
from: PluginStateObject.Root
})(({ params }, ctx: PluginContext) => Task.create('Loading example...', async taskCtx => {
const entries = (ctx.customState as MesoscaleExplorerState).examples || [];
await loadExampleEntry(ctx, entries[params.entry]);
}));
export const LoadModel = StateAction.build({
display: { name: 'Load', description: 'Load a model' },
params: {
files: PD.FileList({ accept: '.cif,.bcif,.cif.gz,.bcif.gz,.zip', multiple: true, description: 'mmCIF or Cellpack- or Petworld-style cif file.', label: 'File(s)' }),
},
from: PluginStateObject.Root
})(({ params }, ctx: PluginContext) => Task.create('Loading model...', async taskCtx => {
if (params.files === null || params.files.length === 0) {
ctx.log.error('No file(s) selected');
return;
}
await reset(ctx);
const firstFile = params.files[0];
const firstInfo = getFileNameInfo(firstFile.file!.name);
if (firstInfo.name.endsWith('zip')) {
try {
await createGenericHierarchy(ctx, firstFile);
} catch (e) {
console.error(e);
ctx.log.error(`Error opening file '${firstFile.name}'`);
}
} else {
for (const file of params.files) {
try {
const info = getFileNameInfo(file.file!.name);
if (!['cif', 'bcif'].includes(info.ext)) continue;
const isBinary = ctx.dataFormats.binaryExtensions.has(info.ext);
const { data } = await ctx.builders.data.readFile({ file, isBinary });
await createHierarchy(ctx, data.ref);
} catch (e) {
console.error(e);
ctx.log.error(`Error opening file '${file.name}'`);
}
}
}
}));
//
export class DatabaseControls extends PluginUIComponent {
componentDidMount() {
}
render() {
return <div style={{ margin: '5px' }}>
<ApplyActionControl state={this.plugin.state.data} action={LoadDatabase} nodeRef={this.plugin.state.data.tree.root.ref} applyLabel={'Load'} hideHeader />
</div>;
}
}
export class LoaderControls extends PluginUIComponent {
componentDidMount() {
}
render() {
return <div style={{ margin: '5px' }}>
<ApplyActionControl state={this.plugin.state.data} action={LoadModel} nodeRef={this.plugin.state.data.tree.root.ref} applyLabel={'Load'} hideHeader />
</div>;
}
}
export class ExampleControls extends PluginUIComponent {
componentDidMount() {
}
render() {
return <div style={{ margin: '5px' }}>
<ApplyActionControl state={this.plugin.state.data} action={LoadExample} nodeRef={this.plugin.state.data.tree.root.ref} applyLabel={'Load'} hideHeader />
</div>;
}
}
export async function openState(ctx: PluginContext, file: File) {
const customState = ctx.customState as MesoscaleExplorerState;
delete customState.stateRef;
customState.stateCache = {};
ctx.managers.asset.clear();
await PluginCommands.State.Snapshots.Clear(ctx);
await PluginCommands.State.Snapshots.OpenFile(ctx, { file });
const cell = ctx.state.data.selectQ(q => q.ofType(MesoscaleStateObject))[0];
if (!cell) throw new Error('Missing MesoscaleState');
customState.stateRef = cell.transform.ref;
customState.graphicsMode = cell.obj?.data.graphics || customState.graphicsMode;
}
export class SessionControls extends PluginUIComponent {
downloadToFileZip = () => {
PluginCommands.State.Snapshots.DownloadToFile(this.plugin, { type: 'zip' });
};
open = (e: React.ChangeEvent<HTMLInputElement>) => {
if (!e.target.files || !e.target.files[0]) {
this.plugin.log.error('No state file selected');
return;
}
openState(this.plugin, e.target.files[0]);
};
render() {
return <div style={{ margin: '5px' }}>
<div className='msp-flex-row'>
<Button icon={GetAppSvg} onClick={this.downloadToFileZip} title='Download the state.'>
Download
</Button>
<div className='msp-btn msp-btn-block msp-btn-action msp-loader-msp-btn-file'>
<Icon svg={OpenInBrowserSvg} inline /> Open <input onChange={this.open} type='file' multiple={false} accept='.molx,.molj' />
</div>
</div>
</div>;
}
}
export class SnapshotControls extends PluginUIComponent<{}> {
render() {
return <div style={{ margin: '5px' }}>
<div style={{ marginBottom: '10px' }}>
<LocalStateSnapshotList />
</div>
<div style={{ marginBottom: '10px' }}>
<LocalStateSnapshots />
</div>
<div style={{ marginBottom: '10px' }}>
<ExpandGroup header='Snapshot Options' initiallyExpanded={false}>
<LocalStateSnapshotParams />
</ExpandGroup>
</div>
</div>;
}
}

581
src/apps/viewer/app.ts Normal file
View File

@@ -0,0 +1,581 @@
/**
* Copyright (c) 2018-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { ANVILMembraneOrientation } from '../../extensions/anvil/behavior';
import { Backgrounds } from '../../extensions/backgrounds';
import { DnatcoNtCs } from '../../extensions/dnatco';
import { G3DFormat, G3dProvider } from '../../extensions/g3d/format';
import { GeometryExport } from '../../extensions/geo-export';
import { MAQualityAssessment, QualityAssessmentPLDDTPreset, QualityAssessmentQmeanPreset } from '../../extensions/model-archive/quality-assessment/behavior';
import { QualityAssessment } from '../../extensions/model-archive/quality-assessment/prop';
import { ModelExport } from '../../extensions/model-export';
import { Mp4Export } from '../../extensions/mp4-export';
import { MolViewSpec } from '../../extensions/mvs/behavior';
import { loadMVSX } from '../../extensions/mvs/components/formats';
import { loadMVS } from '../../extensions/mvs/load';
import { MVSData } from '../../extensions/mvs/mvs-data';
import { PDBeStructureQualityReport } from '../../extensions/pdbe';
import { RCSBValidationReport } from '../../extensions/rcsb';
import { AssemblySymmetry, AssemblySymmetryConfig } from '../../extensions/assembly-symmetry';
import { SbNcbrPartialCharges, SbNcbrPartialChargesPreset, SbNcbrPartialChargesPropertyProvider } from '../../extensions/sb-ncbr';
import { Volseg, VolsegVolumeServerConfig } from '../../extensions/volumes-and-segmentations';
import { wwPDBChemicalComponentDictionary } from '../../extensions/wwpdb/ccd/behavior';
import { wwPDBStructConnExtensionFunctions } from '../../extensions/wwpdb/struct-conn';
import { ZenodoImport } from '../../extensions/zenodo';
import { SaccharideCompIdMapType } from '../../mol-model/structure/structure/carbohydrates/constants';
import { Volume } from '../../mol-model/volume';
import { DownloadStructure, PdbDownloadProvider } from '../../mol-plugin-state/actions/structure';
import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
import { PresetTrajectoryHierarchy } from '../../mol-plugin-state/builder/structure/hierarchy-preset';
import { PresetStructureRepresentations, StructureRepresentationPresetProvider } from '../../mol-plugin-state/builder/structure/representation-preset';
import { BuiltInCoordinatesFormat } from '../../mol-plugin-state/formats/coordinates';
import { DataFormatProvider } from '../../mol-plugin-state/formats/provider';
import { BuiltInTopologyFormat } from '../../mol-plugin-state/formats/topology';
import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory';
import { BuildInVolumeFormat } from '../../mol-plugin-state/formats/volume';
import { createVolumeRepresentationParams } from '../../mol-plugin-state/helpers/volume-representation-params';
import { PluginStateObject } from '../../mol-plugin-state/objects';
import { StateTransforms } from '../../mol-plugin-state/transforms';
import { TrajectoryFromModelAndCoordinates } from '../../mol-plugin-state/transforms/model';
import { PluginUIContext } from '../../mol-plugin-ui/context';
import { createPluginUI } from '../../mol-plugin-ui';
import { renderReact18 } from '../../mol-plugin-ui/react18';
import { DefaultPluginUISpec, PluginUISpec } from '../../mol-plugin-ui/spec';
import { PluginCommands } from '../../mol-plugin/commands';
import { PluginConfig } from '../../mol-plugin/config';
import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
import { PluginSpec } from '../../mol-plugin/spec';
import { PluginState } from '../../mol-plugin/state';
import { StateObjectRef, StateObjectSelector } from '../../mol-state';
import { Task } from '../../mol-task';
import { Asset } from '../../mol-util/assets';
import { Color } from '../../mol-util/color';
import '../../mol-util/polyfill';
import { ObjectKeys } from '../../mol-util/type-helpers';
export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
export { consoleStats, setDebugMode, setProductionMode, setTimingMode } from '../../mol-util/debug';
const CustomFormats = [
['g3d', G3dProvider] as const
];
export const ExtensionMap = {
'volseg': PluginSpec.Behavior(Volseg),
'backgrounds': PluginSpec.Behavior(Backgrounds),
'dnatco-ntcs': PluginSpec.Behavior(DnatcoNtCs),
'pdbe-structure-quality-report': PluginSpec.Behavior(PDBeStructureQualityReport),
'assembly-symmetry': PluginSpec.Behavior(AssemblySymmetry),
'rcsb-validation-report': PluginSpec.Behavior(RCSBValidationReport),
'anvil-membrane-orientation': PluginSpec.Behavior(ANVILMembraneOrientation),
'g3d': PluginSpec.Behavior(G3DFormat),
'model-export': PluginSpec.Behavior(ModelExport),
'mp4-export': PluginSpec.Behavior(Mp4Export),
'geo-export': PluginSpec.Behavior(GeometryExport),
'ma-quality-assessment': PluginSpec.Behavior(MAQualityAssessment),
'zenodo-import': PluginSpec.Behavior(ZenodoImport),
'sb-ncbr-partial-charges': PluginSpec.Behavior(SbNcbrPartialCharges),
'wwpdb-chemical-component-dictionary': PluginSpec.Behavior(wwPDBChemicalComponentDictionary),
'mvs': PluginSpec.Behavior(MolViewSpec),
};
const DefaultViewerOptions = {
customFormats: CustomFormats as [string, DataFormatProvider][],
extensions: ObjectKeys(ExtensionMap),
disabledExtensions: [] as string[],
layoutIsExpanded: true,
layoutShowControls: true,
layoutShowRemoteState: true,
layoutControlsDisplay: 'reactive' as PluginLayoutControlsDisplay,
layoutShowSequence: true,
layoutShowLog: true,
layoutShowLeftPanel: true,
collapseLeftPanel: false,
collapseRightPanel: false,
disableAntialiasing: PluginConfig.General.DisableAntialiasing.defaultValue,
pixelScale: PluginConfig.General.PixelScale.defaultValue,
pickScale: PluginConfig.General.PickScale.defaultValue,
transparency: PluginConfig.General.Transparency.defaultValue,
preferWebgl1: PluginConfig.General.PreferWebGl1.defaultValue,
allowMajorPerformanceCaveat: PluginConfig.General.AllowMajorPerformanceCaveat.defaultValue,
powerPreference: PluginConfig.General.PowerPreference.defaultValue,
viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue,
viewportShowControls: PluginConfig.Viewport.ShowControls.defaultValue,
viewportShowSettings: PluginConfig.Viewport.ShowSettings.defaultValue,
viewportShowSelectionMode: PluginConfig.Viewport.ShowSelectionMode.defaultValue,
viewportShowAnimation: PluginConfig.Viewport.ShowAnimation.defaultValue,
viewportShowTrajectoryControls: PluginConfig.Viewport.ShowTrajectoryControls.defaultValue,
pluginStateServer: PluginConfig.State.DefaultServer.defaultValue,
volumeStreamingServer: PluginConfig.VolumeStreaming.DefaultServer.defaultValue,
volumeStreamingDisabled: !PluginConfig.VolumeStreaming.Enabled.defaultValue,
pdbProvider: PluginConfig.Download.DefaultPdbProvider.defaultValue,
emdbProvider: PluginConfig.Download.DefaultEmdbProvider.defaultValue,
saccharideCompIdMapType: 'default' as SaccharideCompIdMapType,
volumesAndSegmentationsDefaultServer: VolsegVolumeServerConfig.DefaultServer.defaultValue,
rcsbAssemblySymmetryDefaultServerType: AssemblySymmetryConfig.DefaultServerType.defaultValue,
rcsbAssemblySymmetryDefaultServerUrl: AssemblySymmetryConfig.DefaultServerUrl.defaultValue,
rcsbAssemblySymmetryApplyColors: AssemblySymmetryConfig.ApplyColors.defaultValue,
};
type ViewerOptions = typeof DefaultViewerOptions;
export class Viewer {
constructor(public plugin: PluginUIContext) {
}
static async create(elementOrId: string | HTMLElement, options: Partial<ViewerOptions> = {}) {
const definedOptions = {} as any;
// filter for defined properies only so the default values
// are property applied
for (const p of Object.keys(options) as (keyof ViewerOptions)[]) {
if (options[p] !== void 0) definedOptions[p] = options[p];
}
const o: ViewerOptions = { ...DefaultViewerOptions, ...definedOptions };
const defaultSpec = DefaultPluginUISpec();
const disabledExtension = new Set(o.disabledExtensions ?? []);
const spec: PluginUISpec = {
actions: defaultSpec.actions,
behaviors: [
...defaultSpec.behaviors,
...o.extensions.filter(e => !disabledExtension.has(e)).map(e => ExtensionMap[e]),
],
animations: [...defaultSpec.animations || []],
customParamEditors: defaultSpec.customParamEditors,
customFormats: o?.customFormats,
layout: {
initial: {
isExpanded: o.layoutIsExpanded,
showControls: o.layoutShowControls,
controlsDisplay: o.layoutControlsDisplay,
regionState: {
bottom: 'full',
left: o.collapseLeftPanel ? 'collapsed' : 'full',
right: o.collapseRightPanel ? 'hidden' : 'full',
top: 'full',
}
},
},
components: {
...defaultSpec.components,
controls: {
...defaultSpec.components?.controls,
top: o.layoutShowSequence ? undefined : 'none',
bottom: o.layoutShowLog ? undefined : 'none',
left: o.layoutShowLeftPanel ? undefined : 'none',
},
remoteState: o.layoutShowRemoteState ? 'default' : 'none',
},
config: [
[PluginConfig.General.DisableAntialiasing, o.disableAntialiasing],
[PluginConfig.General.PixelScale, o.pixelScale],
[PluginConfig.General.PickScale, o.pickScale],
[PluginConfig.General.Transparency, o.transparency],
[PluginConfig.General.PreferWebGl1, o.preferWebgl1],
[PluginConfig.General.AllowMajorPerformanceCaveat, o.allowMajorPerformanceCaveat],
[PluginConfig.General.PowerPreference, o.powerPreference],
[PluginConfig.Viewport.ShowExpand, o.viewportShowExpand],
[PluginConfig.Viewport.ShowControls, o.viewportShowControls],
[PluginConfig.Viewport.ShowSettings, o.viewportShowSettings],
[PluginConfig.Viewport.ShowSelectionMode, o.viewportShowSelectionMode],
[PluginConfig.Viewport.ShowAnimation, o.viewportShowAnimation],
[PluginConfig.Viewport.ShowTrajectoryControls, o.viewportShowTrajectoryControls],
[PluginConfig.State.DefaultServer, o.pluginStateServer],
[PluginConfig.State.CurrentServer, o.pluginStateServer],
[PluginConfig.VolumeStreaming.DefaultServer, o.volumeStreamingServer],
[PluginConfig.VolumeStreaming.Enabled, !o.volumeStreamingDisabled],
[PluginConfig.Download.DefaultPdbProvider, o.pdbProvider],
[PluginConfig.Download.DefaultEmdbProvider, o.emdbProvider],
[PluginConfig.Structure.DefaultRepresentationPreset, ViewerAutoPreset.id],
[PluginConfig.Structure.SaccharideCompIdMapType, o.saccharideCompIdMapType],
[VolsegVolumeServerConfig.DefaultServer, o.volumesAndSegmentationsDefaultServer],
[AssemblySymmetryConfig.DefaultServerType, o.rcsbAssemblySymmetryDefaultServerType],
[AssemblySymmetryConfig.DefaultServerUrl, o.rcsbAssemblySymmetryDefaultServerUrl],
[AssemblySymmetryConfig.ApplyColors, o.rcsbAssemblySymmetryApplyColors],
]
};
const element = typeof elementOrId === 'string'
? document.getElementById(elementOrId)
: elementOrId;
if (!element) throw new Error(`Could not get element with id '${elementOrId}'`);
const plugin = await createPluginUI({
target: element,
spec,
render: renderReact18,
onBeforeUIRender: plugin => {
// the preset needs to be added before the UI renders otherwise
// "Download Structure" wont be able to pick it up
plugin.builders.structure.representation.registerPreset(ViewerAutoPreset);
}
});
return new Viewer(plugin);
}
setRemoteSnapshot(id: string) {
const url = `${this.plugin.config.get(PluginConfig.State.CurrentServer)}/get/${id}`;
return PluginCommands.State.Snapshots.Fetch(this.plugin, { url });
}
loadSnapshotFromUrl(url: string, type: PluginState.SnapshotType) {
return PluginCommands.State.Snapshots.OpenUrl(this.plugin, { url, type });
}
loadStructureFromUrl(url: string, format: BuiltInTrajectoryFormat = 'mmcif', isBinary = false, options?: LoadStructureOptions & { label?: string }) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'url',
params: {
url: Asset.Url(url),
format: format as any,
isBinary,
label: options?.label,
options: { ...params.source.params.options, representationParams: options?.representationParams as any },
}
}
}));
}
async loadAllModelsOrAssemblyFromUrl(url: string, format: BuiltInTrajectoryFormat = 'mmcif', isBinary = false, options?: LoadStructureOptions) {
const plugin = this.plugin;
const data = await plugin.builders.data.download({ url, isBinary }, { state: { isGhost: true } });
const trajectory = await plugin.builders.structure.parseTrajectory(data, format);
await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'all-models', { useDefaultIfSingleModel: true, representationPresetParams: options?.representationParams });
}
async loadStructureFromData(data: string | number[], format: BuiltInTrajectoryFormat, options?: { dataLabel?: string }) {
const _data = await this.plugin.builders.data.rawData({ data, label: options?.dataLabel });
const trajectory = await this.plugin.builders.structure.parseTrajectory(_data, format);
await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
}
loadPdb(pdb: string, options?: LoadStructureOptions) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
const provider = this.plugin.config.get(PluginConfig.Download.DefaultPdbProvider)!;
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'pdb' as const,
params: {
provider: {
id: pdb,
server: {
name: provider,
params: PdbDownloadProvider[provider].defaultValue as any
}
},
options: { ...params.source.params.options, representationParams: options?.representationParams as any },
}
}
}));
}
loadPdbDev(pdbDev: string) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'pdb-dev' as const,
params: {
provider: {
id: pdbDev,
encoding: 'bcif',
},
options: params.source.params.options,
}
}
}));
}
loadEmdb(emdb: string, options?: { detail?: number }) {
const provider = this.plugin.config.get(PluginConfig.Download.DefaultEmdbProvider)!;
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadDensity, {
source: {
name: 'pdb-emd-ds' as const,
params: {
provider: {
id: emdb,
server: provider,
},
detail: options?.detail ?? 3,
}
}
}));
}
loadAlphaFoldDb(afdb: string) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'alphafolddb' as const,
params: {
id: afdb,
options: {
...params.source.params.options,
representation: 'preset-structure-representation-ma-quality-assessment-plddt'
},
}
}
}));
}
loadModelArchive(id: string) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'modelarchive' as const,
params: {
id,
options: params.source.params.options,
}
}
}));
}
/**
* @example Load X-ray density from volume server
viewer.loadVolumeFromUrl({
url: 'https://www.ebi.ac.uk/pdbe/densities/x-ray/1tqn/cell?detail=3',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1.5,
color: 0x3362B2
}, {
type: 'relative',
value: 3,
color: 0x33BB33,
volumeIndex: 1
}, {
type: 'relative',
value: -3,
color: 0xBB3333,
volumeIndex: 1
}], {
entryId: ['2FO-FC', 'FO-FC'],
isLazy: true
});
* *********************
* @example Load EM density from volume server
viewer.loadVolumeFromUrl({
url: 'https://maps.rcsb.org/em/emd-30210/cell?detail=6',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1,
color: 0x3377aa
}], {
entryId: 'EMD-30210',
isLazy: true
});
*/
async loadVolumeFromUrl({ url, format, isBinary }: { url: string, format: BuildInVolumeFormat, isBinary: boolean }, isovalues: VolumeIsovalueInfo[], options?: { entryId?: string | string[], isLazy?: boolean }) {
const plugin = this.plugin;
if (!plugin.dataFormats.get(format)) {
throw new Error(`Unknown density format: ${format}`);
}
if (options?.isLazy) {
const update = this.plugin.build();
update.toRoot().apply(StateTransforms.Data.LazyVolume, {
url,
format,
entryId: options?.entryId,
isBinary,
isovalues: isovalues.map(v => ({ alpha: 1, volumeIndex: 0, ...v }))
});
return update.commit();
}
return plugin.dataTransaction(async () => {
const data = await plugin.builders.data.download({ url, isBinary }, { state: { isGhost: true } });
const parsed = await plugin.dataFormats.get(format)!.parse(plugin, data, { entryId: options?.entryId });
const firstVolume = (parsed.volume || parsed.volumes[0]) as StateObjectSelector<PluginStateObject.Volume.Data>;
if (!firstVolume?.isOk) throw new Error('Failed to parse any volume.');
const repr = plugin.build();
for (const iso of isovalues) {
const volume: StateObjectSelector<PluginStateObject.Volume.Data> = parsed.volumes?.[iso.volumeIndex ?? 0] ?? parsed.volume;
const volumeData = volume.cell!.obj!.data;
repr
.to(volume)
.apply(StateTransforms.Representation.VolumeRepresentation3D, createVolumeRepresentationParams(this.plugin, firstVolume.data!, {
type: 'isosurface',
typeParams: { alpha: iso.alpha ?? 1, isoValue: Volume.adjustedIsoValue(volumeData, iso.value, iso.type) },
color: 'uniform',
colorParams: { value: iso.color }
}));
}
await repr.commit();
});
}
/**
* @example
* viewer.loadTrajectory({
* model: { kind: 'model-url', url: 'villin.gro', format: 'gro' },
* coordinates: { kind: 'coordinates-url', url: 'villin.xtc', format: 'xtc', isBinary: true },
* preset: 'all-models' // or 'default'
* });
*/
async loadTrajectory(params: LoadTrajectoryParams) {
const plugin = this.plugin;
let model: StateObjectSelector;
if (params.model.kind === 'model-data' || params.model.kind === 'model-url') {
const data = params.model.kind === 'model-data'
? await plugin.builders.data.rawData({ data: params.model.data, label: params.modelLabel })
: await plugin.builders.data.download({ url: params.model.url, isBinary: params.model.isBinary, label: params.modelLabel });
const trajectory = await plugin.builders.structure.parseTrajectory(data, params.model.format ?? 'mmcif');
model = await plugin.builders.structure.createModel(trajectory);
} else {
const data = params.model.kind === 'topology-data'
? await plugin.builders.data.rawData({ data: params.model.data, label: params.modelLabel })
: await plugin.builders.data.download({ url: params.model.url, isBinary: params.model.isBinary, label: params.modelLabel });
const provider = plugin.dataFormats.get(params.model.format);
model = await provider!.parse(plugin, data);
}
const data = params.coordinates.kind === 'coordinates-data'
? await plugin.builders.data.rawData({ data: params.coordinates.data, label: params.coordinatesLabel })
: await plugin.builders.data.download({ url: params.coordinates.url, isBinary: params.coordinates.isBinary, label: params.coordinatesLabel });
const provider = plugin.dataFormats.get(params.coordinates.format);
const coords = await provider!.parse(plugin, data);
const trajectory = await plugin.build().toRoot()
.apply(TrajectoryFromModelAndCoordinates, {
modelRef: model.ref,
coordinatesRef: coords.ref
}, { dependsOn: [model.ref, coords.ref] })
.commit();
const preset = await plugin.builders.structure.hierarchy.applyPreset(trajectory, params.preset ?? 'default');
return { model, coords, preset };
}
async loadMvsFromUrl(url: string, format: 'mvsj' | 'mvsx', options?: { replaceExisting?: boolean, keepCamera?: boolean }) {
if (format === 'mvsj') {
const data = await this.plugin.runTask(this.plugin.fetch({ url, type: 'string' }));
const mvsData = MVSData.fromMVSJ(data);
await loadMVS(this.plugin, mvsData, { sanityChecks: true, sourceUrl: url, ...options });
} else if (format === 'mvsx') {
const data = await this.plugin.runTask(this.plugin.fetch({ url, type: 'binary' }));
await this.plugin.runTask(Task.create('Load MVSX file', async ctx => {
const parsed = await loadMVSX(this.plugin, ctx, data);
await loadMVS(this.plugin, parsed.mvsData, { sanityChecks: true, sourceUrl: parsed.sourceUrl, ...options });
}));
} else {
throw new Error(`Unknown MolViewSpec format: ${format}`);
}
}
/** Load MolViewSpec from `data`.
* If `format` is 'mvsj', `data` must be a string or a Uint8Array containing a UTF8-encoded string.
* If `format` is 'mvsx', `data` must be a Uint8Array or a string containing base64-encoded binary data prefixed with 'base64,'. */
async loadMvsData(data: string | Uint8Array, format: 'mvsj' | 'mvsx', options?: { replaceExisting?: boolean, keepCamera?: boolean }) {
if (typeof data === 'string' && data.startsWith('base64')) {
data = Uint8Array.from(atob(data.substring(7)), c => c.charCodeAt(0)); // Decode base64 string to Uint8Array
}
if (format === 'mvsj') {
if (typeof data !== 'string') {
data = new TextDecoder().decode(data); // Decode Uint8Array to string using UTF8
}
const mvsData = MVSData.fromMVSJ(data);
await loadMVS(this.plugin, mvsData, { sanityChecks: true, sourceUrl: undefined, ...options });
} else if (format === 'mvsx') {
if (typeof data === 'string') {
throw new Error("loadMvsData: if `format` is 'mvsx', then `data` must be a Uint8Array or a base64-encoded string prefixed with 'base64,'.");
}
await this.plugin.runTask(Task.create('Load MVSX file', async ctx => {
const parsed = await loadMVSX(this.plugin, ctx, data as Uint8Array);
await loadMVS(this.plugin, parsed.mvsData, { sanityChecks: true, sourceUrl: parsed.sourceUrl, ...options });
}));
} else {
throw new Error(`Unknown MolViewSpec format: ${format}`);
}
}
handleResize() {
this.plugin.layout.events.updated.next(void 0);
}
dispose() {
this.plugin.dispose();
}
}
export interface LoadStructureOptions {
representationParams?: StructureRepresentationPresetProvider.CommonParams
}
export interface VolumeIsovalueInfo {
type: 'absolute' | 'relative',
value: number,
color: Color,
alpha?: number,
volumeIndex?: number
}
export interface LoadTrajectoryParams {
model: { kind: 'model-url', url: string, format?: BuiltInTrajectoryFormat /* mmcif */, isBinary?: boolean }
| { kind: 'model-data', data: string | number[] | ArrayBuffer | Uint8Array, format?: BuiltInTrajectoryFormat /* mmcif */ }
| { kind: 'topology-url', url: string, format: BuiltInTopologyFormat, isBinary?: boolean }
| { kind: 'topology-data', data: string | number[] | ArrayBuffer | Uint8Array, format: BuiltInTopologyFormat },
modelLabel?: string,
coordinates: { kind: 'coordinates-url', url: string, format: BuiltInCoordinatesFormat, isBinary?: boolean }
| { kind: 'coordinates-data', data: string | number[] | ArrayBuffer | Uint8Array, format: BuiltInCoordinatesFormat },
coordinatesLabel?: string,
preset?: keyof PresetTrajectoryHierarchy
}
export const ViewerAutoPreset = StructureRepresentationPresetProvider({
id: 'preset-structure-representation-viewer-auto',
display: {
name: 'Automatic (w/ Annotation)', group: 'Annotation',
description: 'Show standard automatic representation but colored by quality assessment (if available in the model).'
},
isApplicable(a) {
return (
!!a.data.models.some(m => QualityAssessment.isApplicable(m, 'pLDDT')) ||
!!a.data.models.some(m => QualityAssessment.isApplicable(m, 'qmean'))
);
},
params: () => StructureRepresentationPresetProvider.CommonParams,
async apply(ref, params, plugin) {
const structureCell = StateObjectRef.resolveAndCheck(plugin.state.data, ref);
const structure = structureCell?.obj?.data;
if (!structureCell || !structure) return {};
if (!!structure.models.some(m => QualityAssessment.isApplicable(m, 'pLDDT'))) {
return await QualityAssessmentPLDDTPreset.apply(ref, params, plugin);
} else if (!!structure.models.some(m => QualityAssessment.isApplicable(m, 'qmean'))) {
return await QualityAssessmentQmeanPreset.apply(ref, params, plugin);
} else if (!!structure.models.some(m => SbNcbrPartialChargesPropertyProvider.isApplicable(m))) {
return await SbNcbrPartialChargesPreset.apply(ref, params, plugin);
} else {
return await PresetStructureRepresentations.auto.apply(ref, params, plugin);
}
}
});
export const PluginExtensions = {
wwPDBStructConn: wwPDBStructConnExtensionFunctions,
mvs: { MVSData, loadMVS },
};

View File

@@ -20,7 +20,7 @@
<div id="app"></div>
<script type="text/javascript" src="./molstar.js"></script>
<script type="text/javascript">
var viewer = new molstar.Viewer('app', {
molstar.Viewer.create('app', {
layoutIsExpanded: true,
layoutShowControls: false,
layoutShowRemoteState: false,
@@ -34,11 +34,20 @@
pdbProvider: 'rcsb',
emdbProvider: 'rcsb',
}).then(viewer => {
viewer.loadPdb('7bv2');
viewer.loadEmdb('EMD-30210', { detail: 6 });
// viewer.loadAllModelsOrAssemblyFromUrl('https://cs.litemol.org/5ire/full', 'mmcif', false, { representationParams: { theme: { globalName: 'operator-name' } } })
// viewer.loadStructureFromUrl('my url', 'pdb', false, {
// representationParams: {
// theme: {
// globalName: 'uniform',
// globalColorParams: { value: 0xff0000 }
// }
// },
// label: 'my structure'
// });
});
viewer.loadPdb('7bv2');
viewer.loadEmdb('EMD-30210', { detail: 6 });
// viewer.loadAllModelsOrAssemblyFromUrl('https://cs.litemol.org/5ire/full', 'mmcif', false, { representationParams: { theme: { globalName: 'operator-name' } } })
</script>
</body>
</html>

View File

@@ -46,7 +46,10 @@
}
var debugMode = getParam('debug-mode', '[^&]+').trim() === '1';
if (debugMode) molstar.setDebugMode(debugMode, debugMode);
if (debugMode) molstar.setDebugMode(debugMode);
var timingMode = getParam('timing-mode', '[^&]+').trim() === '1';
if (timingMode) molstar.setTimingMode(timingMode);
var hideControls = getParam('hide-controls', '[^&]+').trim() === '1';
var collapseLeftPanel = getParam('collapse-left-panel', '[^&]+').trim() === '1';
@@ -56,7 +59,15 @@
var pixelScale = getParam('pixel-scale', '[^&]+').trim();
var pickScale = getParam('pick-scale', '[^&]+').trim();
var pickPadding = getParam('pick-padding', '[^&]+').trim();
var viewer = new molstar.Viewer('app', {
var transparency = getParam('transparency', '[^&]+').trim().toLowerCase();
var preferWebgl1 = getParam('prefer-webgl1', '[^&]+').trim() === '1' || void 0;
var allowMajorPerformanceCaveat = getParam('allow-major-performance-caveat', '[^&]+').trim() === '1';
var powerPreference = getParam('power-preference', '[^&]+').trim().toLowerCase();
// console.log('Available extensions: ', Object.keys(molstar.ExtensionMap));
molstar.Viewer.create('app', {
disabledExtensions: [], // anything from Object.keys(molstar.ExtensionMap)
layoutShowControls: !hideControls,
viewportShowExpand: false,
collapseLeftPanel: collapseLeftPanel,
@@ -68,28 +79,52 @@
pixelScale: parseFloat(pixelScale) || 1,
pickScale: parseFloat(pickScale) || 0.25,
pickPadding: isNaN(parseFloat(pickPadding)) ? 1 : parseFloat(pickPadding),
transparency: transparency || undefined,
preferWebgl1: preferWebgl1,
allowMajorPerformanceCaveat: allowMajorPerformanceCaveat,
powerPreference: powerPreference || 'high-performance',
}).then(viewer => {
var snapshotId = getParam('snapshot-id', '[^&]+').trim();
if (snapshotId) viewer.setRemoteSnapshot(snapshotId);
var snapshotUrl = getParam('snapshot-url', '[^&]+').trim();
var snapshotUrlType = getParam('snapshot-url-type', '[^&]+').toLowerCase().trim() || 'molj';
if (snapshotUrl && snapshotUrlType) viewer.loadSnapshotFromUrl(snapshotUrl, snapshotUrlType);
var structureUrl = getParam('structure-url', '[^&]+').trim();
var structureUrlFormat = getParam('structure-url-format', '[a-z]+').toLowerCase().trim();
var structureUrlIsBinary = getParam('structure-url-is-binary', '[^&]+').trim() === '1';
if (structureUrl) viewer.loadStructureFromUrl(structureUrl, structureUrlFormat, structureUrlIsBinary);
var mvsUrl = getParam('mvs-url', '[^&]+').trim();
var mvsData = getParam('mvs-data', '[^&]+').trim();
var mvsFormat = getParam('mvs-format', '[^&]+').trim() || 'mvsj';
if (mvsUrl && mvsData) console.error('Cannot specify mvs-url and mvs-data URL parameters at the same time. Ignoring both.');
else if (mvsUrl) viewer.loadMvsFromUrl(mvsUrl, mvsFormat);
else if (mvsData) viewer.loadMvsData(mvsData, mvsFormat);
var pdb = getParam('pdb', '[^&]+').trim();
if (pdb) viewer.loadPdb(pdb);
var pdbDev = getParam('pdb-dev', '[^&]+').trim();
if (pdbDev) viewer.loadPdbDev(pdbDev);
var emdb = getParam('emdb', '[^&]+').trim();
if (emdb) viewer.loadEmdb(emdb);
var afdb = getParam('afdb', '[^&]+').trim();
if (afdb) viewer.loadAlphaFoldDb(afdb);
var modelArchive = getParam('model-archive', '[^&]+').trim();
if (modelArchive) viewer.loadModelArchive(modelArchive);
window.addEventListener('unload', () => {
// to aid GC
viewer.dispose();
});
});
var snapshotId = getParam('snapshot-id', '[^&]+').trim();
if (snapshotId) viewer.setRemoteSnapshot(snapshotId);
var snapshotUrl = getParam('snapshot-url', '[^&]+').trim();
var snapshotUrlType = getParam('snapshot-url-type', '[^&]+').toLowerCase().trim() || 'molj';
if (snapshotUrl && snapshotUrlType) viewer.loadSnapshotFromUrl(snapshotUrl, snapshotUrlType);
var structureUrl = getParam('structure-url', '[^&]+').trim();
var structureUrlFormat = getParam('structure-url-format', '[a-z]+').toLowerCase().trim();
var structureUrlIsBinary = getParam('structure-url-is-binary', '[^&]+').trim() === '1';
if (structureUrl) viewer.loadStructureFromUrl(structureUrl, structureUrlFormat, structureUrlIsBinary);
var pdb = getParam('pdb', '[^&]+').trim();
if (pdb) viewer.loadPdb(pdb);
var pdbDev = getParam('pdb-dev', '[^&]+').trim();
if (pdbDev) viewer.loadPdbDev(pdbDev);
var emdb = getParam('emdb', '[^&]+').trim();
if (emdb) viewer.loadEmdb(emdb);
</script>
<!-- __MOLSTAR_ANALYTICS__ -->
</body>
</html>

View File

@@ -1,346 +1,12 @@
/**
* Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { ANVILMembraneOrientation } from '../../extensions/anvil/behavior';
import { CellPack } from '../../extensions/cellpack';
import { DnatcoConfalPyramids } from '../../extensions/dnatco';
import { G3DFormat, G3dProvider } from '../../extensions/g3d/format';
import { Mp4Export } from '../../extensions/mp4-export';
import { GeometryExport } from '../../extensions/geo-export';
import { PDBeStructureQualityReport } from '../../extensions/pdbe';
import { RCSBAssemblySymmetry, RCSBValidationReport } from '../../extensions/rcsb';
import { DownloadStructure, PdbDownloadProvider } from '../../mol-plugin-state/actions/structure';
import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
import { StructureRepresentationPresetProvider } from '../../mol-plugin-state/builder/structure/representation-preset';
import { DataFormatProvider } from '../../mol-plugin-state/formats/provider';
import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory';
import { BuildInVolumeFormat } from '../../mol-plugin-state/formats/volume';
import { createVolumeRepresentationParams } from '../../mol-plugin-state/helpers/volume-representation-params';
import { PluginStateObject } from '../../mol-plugin-state/objects';
import { StateTransforms } from '../../mol-plugin-state/transforms';
import { createPlugin } from '../../mol-plugin-ui';
import { PluginUIContext } from '../../mol-plugin-ui/context';
import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
import { DefaultPluginUISpec, PluginUISpec } from '../../mol-plugin-ui/spec';
import { PluginCommands } from '../../mol-plugin/commands';
import { PluginConfig } from '../../mol-plugin/config';
import { PluginSpec } from '../../mol-plugin/spec';
import { PluginState } from '../../mol-plugin/state';
import { StateObjectSelector } from '../../mol-state';
import { Asset } from '../../mol-util/assets';
import { Color } from '../../mol-util/color';
import '../../mol-util/polyfill';
import { ObjectKeys } from '../../mol-util/type-helpers';
import './embedded.html';
import './favicon.ico';
import './index.html';
require('mol-plugin-ui/skin/light.scss');
export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
export { setDebugMode, setProductionMode } from '../../mol-util/debug';
const CustomFormats = [
['g3d', G3dProvider] as const
];
const Extensions = {
'cellpack': PluginSpec.Behavior(CellPack),
'dnatco-confal-pyramids': PluginSpec.Behavior(DnatcoConfalPyramids),
'pdbe-structure-quality-report': PluginSpec.Behavior(PDBeStructureQualityReport),
'rcsb-assembly-symmetry': PluginSpec.Behavior(RCSBAssemblySymmetry),
'rcsb-validation-report': PluginSpec.Behavior(RCSBValidationReport),
'anvil-membrane-orientation': PluginSpec.Behavior(ANVILMembraneOrientation),
'g3d': PluginSpec.Behavior(G3DFormat),
'mp4-export': PluginSpec.Behavior(Mp4Export),
'geo-export': PluginSpec.Behavior(GeometryExport)
};
const DefaultViewerOptions = {
customFormats: CustomFormats as [string, DataFormatProvider][],
extensions: ObjectKeys(Extensions),
layoutIsExpanded: true,
layoutShowControls: true,
layoutShowRemoteState: true,
layoutControlsDisplay: 'reactive' as PluginLayoutControlsDisplay,
layoutShowSequence: true,
layoutShowLog: true,
layoutShowLeftPanel: true,
collapseLeftPanel: false,
disableAntialiasing: PluginConfig.General.DisableAntialiasing.defaultValue,
pixelScale: PluginConfig.General.PixelScale.defaultValue,
pickScale: PluginConfig.General.PickScale.defaultValue,
pickPadding: PluginConfig.General.PickPadding.defaultValue,
enableWboit: PluginConfig.General.EnableWboit.defaultValue,
viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue,
viewportShowControls: PluginConfig.Viewport.ShowControls.defaultValue,
viewportShowSettings: PluginConfig.Viewport.ShowSettings.defaultValue,
viewportShowSelectionMode: PluginConfig.Viewport.ShowSelectionMode.defaultValue,
viewportShowAnimation: PluginConfig.Viewport.ShowAnimation.defaultValue,
pluginStateServer: PluginConfig.State.DefaultServer.defaultValue,
volumeStreamingServer: PluginConfig.VolumeStreaming.DefaultServer.defaultValue,
volumeStreamingDisabled: !PluginConfig.VolumeStreaming.Enabled.defaultValue,
pdbProvider: PluginConfig.Download.DefaultPdbProvider.defaultValue,
emdbProvider: PluginConfig.Download.DefaultEmdbProvider.defaultValue,
};
type ViewerOptions = typeof DefaultViewerOptions;
export class Viewer {
plugin: PluginUIContext
constructor(elementOrId: string | HTMLElement, options: Partial<ViewerOptions> = {}) {
const o = { ...DefaultViewerOptions, ...options };
const defaultSpec = DefaultPluginUISpec();
const spec: PluginUISpec = {
actions: defaultSpec.actions,
behaviors: [
...defaultSpec.behaviors,
...o.extensions.map(e => Extensions[e]),
],
animations: [...defaultSpec.animations || []],
customParamEditors: defaultSpec.customParamEditors,
customFormats: o?.customFormats,
layout: {
initial: {
isExpanded: o.layoutIsExpanded,
showControls: o.layoutShowControls,
controlsDisplay: o.layoutControlsDisplay,
regionState: {
bottom: 'full',
left: o.collapseLeftPanel ? 'collapsed' : 'full',
right: 'full',
top: 'full',
}
},
},
components: {
...defaultSpec.components,
controls: {
...defaultSpec.components?.controls,
top: o.layoutShowSequence ? undefined : 'none',
bottom: o.layoutShowLog ? undefined : 'none',
left: o.layoutShowLeftPanel ? undefined : 'none',
},
remoteState: o.layoutShowRemoteState ? 'default' : 'none',
},
config: [
[PluginConfig.General.DisableAntialiasing, o.disableAntialiasing],
[PluginConfig.General.PixelScale, o.pixelScale],
[PluginConfig.General.PickScale, o.pickScale],
[PluginConfig.General.PickPadding, o.pickPadding],
[PluginConfig.General.EnableWboit, o.enableWboit],
[PluginConfig.Viewport.ShowExpand, o.viewportShowExpand],
[PluginConfig.Viewport.ShowControls, o.viewportShowControls],
[PluginConfig.Viewport.ShowSettings, o.viewportShowSettings],
[PluginConfig.Viewport.ShowSelectionMode, o.viewportShowSelectionMode],
[PluginConfig.Viewport.ShowAnimation, o.viewportShowAnimation],
[PluginConfig.State.DefaultServer, o.pluginStateServer],
[PluginConfig.State.CurrentServer, o.pluginStateServer],
[PluginConfig.VolumeStreaming.DefaultServer, o.volumeStreamingServer],
[PluginConfig.VolumeStreaming.Enabled, !o.volumeStreamingDisabled],
[PluginConfig.Download.DefaultPdbProvider, o.pdbProvider],
[PluginConfig.Download.DefaultEmdbProvider, o.emdbProvider]
]
};
const element = typeof elementOrId === 'string'
? document.getElementById(elementOrId)
: elementOrId;
if (!element) throw new Error(`Could not get element with id '${elementOrId}'`);
this.plugin = createPlugin(element, spec);
}
setRemoteSnapshot(id: string) {
const url = `${this.plugin.config.get(PluginConfig.State.CurrentServer)}/get/${id}`;
return PluginCommands.State.Snapshots.Fetch(this.plugin, { url });
}
loadSnapshotFromUrl(url: string, type: PluginState.SnapshotType) {
return PluginCommands.State.Snapshots.OpenUrl(this.plugin, { url, type });
}
loadStructureFromUrl(url: string, format: BuiltInTrajectoryFormat = 'mmcif', isBinary = false, options?: LoadStructureOptions) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'url',
params: {
url: Asset.Url(url),
format: format as any,
isBinary,
options: { ...params.source.params.options, representationParams: options?.representationParams as any },
}
}
}));
}
async loadAllModelsOrAssemblyFromUrl(url: string, format: BuiltInTrajectoryFormat = 'mmcif', isBinary = false, options?: LoadStructureOptions) {
const plugin = this.plugin;
const data = await plugin.builders.data.download({ url, isBinary }, { state: { isGhost: true } });
const trajectory = await plugin.builders.structure.parseTrajectory(data, format);
await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'all-models', { useDefaultIfSingleModel: true, representationPresetParams: options?.representationParams });
}
async loadStructureFromData(data: string | number[], format: BuiltInTrajectoryFormat, options?: { dataLabel?: string }) {
const _data = await this.plugin.builders.data.rawData({ data, label: options?.dataLabel });
const trajectory = await this.plugin.builders.structure.parseTrajectory(_data, format);
await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default');
}
loadPdb(pdb: string, options?: LoadStructureOptions) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
const provider = this.plugin.config.get(PluginConfig.Download.DefaultPdbProvider)!;
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'pdb' as const,
params: {
provider: {
id: pdb,
server: {
name: provider,
params: PdbDownloadProvider[provider].defaultValue as any
}
},
options: { ...params.source.params.options, representationParams: options?.representationParams as any },
}
}
}));
}
loadPdbDev(pdbDev: string) {
const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin);
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, {
source: {
name: 'pdb-dev' as const,
params: {
provider: {
id: pdbDev,
encoding: 'bcif',
},
options: params.source.params.options,
}
}
}));
}
loadEmdb(emdb: string, options?: { detail?: number }) {
const provider = this.plugin.config.get(PluginConfig.Download.DefaultEmdbProvider)!;
return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadDensity, {
source: {
name: 'pdb-emd-ds' as const,
params: {
provider: {
id: emdb,
server: provider,
},
detail: options?.detail ?? 3,
}
}
}));
}
/**
* @example Load X-ray density from volume server
viewer.loadVolumeFromUrl({
url: 'https://www.ebi.ac.uk/pdbe/densities/x-ray/1tqn/cell?detail=3',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1.5,
color: 0x3362B2
}, {
type: 'relative',
value: 3,
color: 0x33BB33,
volumeIndex: 1
}, {
type: 'relative',
value: -3,
color: 0xBB3333,
volumeIndex: 1
}], {
entryId: ['2FO-FC', 'FO-FC'],
isLazy: true
});
* *********************
* @example Load EM density from volume server
viewer.loadVolumeFromUrl({
url: 'https://maps.rcsb.org/em/emd-30210/cell?detail=6',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1,
color: 0x3377aa
}], {
entryId: 'EMD-30210',
isLazy: true
});
*/
async loadVolumeFromUrl({ url, format, isBinary }: { url: string, format: BuildInVolumeFormat, isBinary: boolean }, isovalues: VolumeIsovalueInfo[], options?: { entryId?: string | string[], isLazy?: boolean }) {
const plugin = this.plugin;
if (!plugin.dataFormats.get(format)) {
throw new Error(`Unknown density format: ${format}`);
}
if (options?.isLazy) {
const update = this.plugin.build();
update.toRoot().apply(StateTransforms.Data.LazyVolume, {
url,
format,
entryId: options?.entryId,
isBinary,
isovalues: isovalues.map(v => ({ alpha: 1, volumeIndex: 0, ...v }))
});
return update.commit();
}
return plugin.dataTransaction(async () => {
const data = await plugin.builders.data.download({ url, isBinary }, { state: { isGhost: true } });
const parsed = await plugin.dataFormats.get(format)!.parse(plugin, data, { entryId: options?.entryId });
const firstVolume = (parsed.volume || parsed.volumes[0]) as StateObjectSelector<PluginStateObject.Volume.Data>;
if (!firstVolume?.isOk) throw new Error('Failed to parse any volume.');
const repr = plugin.build();
for (const iso of isovalues) {
repr
.to(parsed.volumes?.[iso.volumeIndex ?? 0] ?? parsed.volume)
.apply(StateTransforms.Representation.VolumeRepresentation3D, createVolumeRepresentationParams(this.plugin, firstVolume.data!, {
type: 'isosurface',
typeParams: { alpha: iso.alpha ?? 1, isoValue: iso.type === 'absolute' ? { kind: 'absolute', absoluteValue: iso.value } : { kind: 'relative', relativeValue: iso.value } },
color: 'uniform',
colorParams: { value: iso.color }
}));
}
await repr.commit();
});
}
handleResize() {
this.plugin.layout.events.updated.next(void 0);
}
}
export interface LoadStructureOptions {
representationParams?: StructureRepresentationPresetProvider.CommonParams
}
export interface VolumeIsovalueInfo {
type: 'absolute' | 'relative',
value: number,
color: Color,
alpha?: number,
volumeIndex?: number
}
export * from './app';

View File

@@ -1,8 +1,9 @@
#!/usr/bin/env node
/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Josh McMenemy <josh.mcmenemy@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import * as argparse from 'argparse';
@@ -14,7 +15,7 @@ const writeFile = util.promisify(fs.writeFile);
import { DatabaseCollection } from '../../mol-data/db';
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
import { ensureDataAvailable, readCCD } from './util';
import { DefaultDataOptions, ensureDataAvailable, readCCD } from './util';
function extractIonNames(ccd: DatabaseCollection<CCD_Schema>) {
const ionNames: string[] = [];
@@ -31,11 +32,11 @@ function extractIonNames(ccd: DatabaseCollection<CCD_Schema>) {
function writeIonNamesFile(filePath: string, ionNames: string[]) {
const output = `/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Code-generated ion names params file. Names extracted from CCD components.
*
* @author molstar/chem-comp-dict/create-table cli
* @author molstar/chem-comp-dict/create-ions cli
*/
export const IonNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
@@ -43,8 +44,8 @@ export const IonNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").re
writeFile(filePath, output);
}
async function run(out: string, forceDownload = false) {
await ensureDataAvailable(forceDownload);
async function run(out: string, options = DefaultDataOptions) {
await ensureDataAvailable(options);
const ccd = await readCCD();
const ionNames = extractIonNames(ccd);
if (!fs.existsSync(path.dirname(out))) {
@@ -64,10 +65,15 @@ parser.add_argument('--forceDownload', '-f', {
action: 'store_true',
help: 'Force download of CCD and PVCD.'
});
parser.add_argument('--ccdUrl', '-c', {
help: 'Fetch the CCD from a custom URL. This forces download of the CCD.',
required: false
});
interface Args {
out: string,
forceDownload?: boolean,
ccdUrl?: string
}
const args: Args = parser.parse_args();
run(args.out, args.forceDownload);
run(args.out, { forceDownload: args.forceDownload, ccdUrl: args.ccdUrl });

View File

@@ -0,0 +1,82 @@
#!/usr/bin/env node
/**
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import * as argparse from 'argparse';
import * as path from 'path';
import util from 'util';
import fs from 'fs';
require('util.promisify').shim();
const writeFile = util.promisify(fs.writeFile);
import { DatabaseCollection } from '../../mol-data/db';
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
import { DefaultDataOptions, ensureDataAvailable, readCCD } from './util';
function extractSaccharideNames(ccd: DatabaseCollection<CCD_Schema>) {
const saccharideNames: string[] = [];
for (const k in ccd) {
const { chem_comp } = ccd[k];
const type = chem_comp.type.value(0).toUpperCase();
if (type.includes('SACCHARIDE')) {
saccharideNames.push(chem_comp.id.value(0));
}
}
// these are extra saccharides that don't have SACCHARIDE in their type
saccharideNames.push(
'UMQ', // UNDECYL-MALTOSIDE, via GlyFinder
'SQD', // SULFOQUINOVOSYLDIACYLGLYCEROL, via GlyFinder
);
return saccharideNames;
}
function writeSaccharideNamesFile(filePath: string, ionNames: string[]) {
const output = `/**
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Code-generated ion names params file. Names extracted from CCD components.
*
* @author molstar/cli/chem-comp-dict/create-saccharides
*/
export const SaccharideNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
`;
writeFile(filePath, output);
}
async function run(out: string, options = DefaultDataOptions) {
await ensureDataAvailable(options);
const ccd = await readCCD();
const saccharideNames = extractSaccharideNames(ccd);
if (!fs.existsSync(path.dirname(out))) {
fs.mkdirSync(path.dirname(out));
}
writeSaccharideNamesFile(out, saccharideNames);
}
const parser = new argparse.ArgumentParser({
add_help: true,
description: 'Extract and save SaccharideNames from CCD.'
});
parser.add_argument('out', {
help: 'Generated file output path.'
});
parser.add_argument('--forceDownload', '-f', {
action: 'store_true',
help: 'Force download of CCD and PVCD.'
});
parser.add_argument('--ccdUrl', '-c', {
help: 'Fetch the CCD from a custom URL. This forces download of the CCD.',
required: false
});
interface Args {
out: string,
forceDownload?: boolean,
ccdUrl?: string
}
const args: Args = parser.parse_args();
run(args.out, { forceDownload: args.forceDownload, ccdUrl: args.ccdUrl });

View File

@@ -18,7 +18,7 @@ import { SetUtils } from '../../mol-util/set';
import { DefaultMap } from '../../mol-util/map';
import { mmCIF_chemCompBond_schema } from '../../mol-io/reader/cif/schema/mmcif-extras';
import { ccd_chemCompAtom_schema } from '../../mol-io/reader/cif/schema/ccd-extras';
import { ensureDataAvailable, getEncodedCif, readCCD, readPVCD } from './util';
import { DefaultDataOptions, ensureDataAvailable, getEncodedCif, readCCD, readPVCD } from './util';
type CCB = Table<CCD_Schema['chem_comp_bond']>
type CCA = Table<CCD_Schema['chem_comp_atom']>
@@ -239,8 +239,8 @@ function createAtoms(ccd: DatabaseCollection<CCD_Schema>, pvcd: DatabaseCollecti
);
}
async function run(out: string, binary = false, forceDownload = false, ccaOut?: string) {
await ensureDataAvailable(forceDownload);
async function run(out: string, binary = false, options = DefaultDataOptions, ccaOut?: string) {
await ensureDataAvailable(options);
const ccd = await readCCD();
const pvcd = await readPVCD();
@@ -283,12 +283,22 @@ parser.add_argument('--ccaOut', '-a', {
help: 'Optional generated file output path for chem_comp_atom data.',
required: false
});
parser.add_argument('--ccdUrl', '-c', {
help: 'Fetch the CCD from a custom URL. This forces download of the CCD.',
required: false
});
parser.add_argument('--pvcdUrl', '-p', {
help: 'Fetch the PVCD from a custom URL. This forces download of the PVCD.',
required: false
});
interface Args {
out: string,
forceDownload?: boolean,
binary?: boolean,
ccaOut?: string
ccaOut?: string,
ccdUrl?: string,
pvcdUrl?: string
}
const args: Args = parser.parse_args();
run(args.out, args.binary, args.forceDownload, args.ccaOut);
run(args.out, args.binary, { forceDownload: args.forceDownload, ccdUrl: args.ccdUrl, pvcdUrl: args.pvcdUrl }, args.ccaOut);

View File

@@ -35,9 +35,9 @@ export async function ensureAvailable(path: string, url: string, forceDownload =
}
}
export async function ensureDataAvailable(forceDownload = false) {
await ensureAvailable(CCD_PATH, CCD_URL, forceDownload);
await ensureAvailable(PVCD_PATH, PVCD_URL, forceDownload);
export async function ensureDataAvailable(options: DataOptions) {
await ensureAvailable(CCD_PATH, options.ccdUrl || CCD_URL, !!options.ccdUrl || options.forceDownload);
await ensureAvailable(PVCD_PATH, options.pvcdUrl || PVCD_URL, !!options.pvcdUrl || options.forceDownload);
}
export async function readFileAsCollection<S extends Database.Schema>(path: string, schema: S) {
@@ -68,8 +68,18 @@ export function getEncodedCif(name: string, database: Database<Database.Schema>,
return encoder.getData();
}
export type DataOptions = {
ccdUrl?: string,
pvcdUrl?: string,
forceDownload?: boolean
}
export const DefaultDataOptions: DataOptions = {
forceDownload: false
};
const DATA_DIR = path.join(__dirname, '..', '..', '..', '..', 'build/data');
const CCD_PATH = path.join(DATA_DIR, 'components.cif');
const PVCD_PATH = path.join(DATA_DIR, 'aa-variants-v1.cif');
const CCD_URL = 'http://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif';
const PVCD_URL = 'http://ftp.wwpdb.org/pub/pdb/data/monomers/aa-variants-v1.cif';
const CCD_URL = 'https://files.wwpdb.org/pub/pdb/data/monomers/components.cif';
const PVCD_URL = 'https://files.wwpdb.org/pub/pdb/data/monomers/aa-variants-v1.cif';

View File

@@ -71,7 +71,7 @@ function classify(name: string, field: CifField): CifWriter.Field {
}
export function convert(path: string, asText = false, hints?: EncodingStrategyHint[], filter?: string) {
return Task.create<Uint8Array>('BinaryCIF', async ctx => {
return Task.create<Uint8Array>('Convert CIF', async ctx => {
const encodingProvider: BinaryEncodingProvider = hints
? CifWriter.createEncodingProviderFromJsonConfig(hints)
: { get: (c, f) => void 0 };

View File

@@ -18,7 +18,7 @@ async function process(srcPath: string, outPath: string, configPath?: string, fi
const config = configPath ? JSON.parse(fs.readFileSync(configPath, 'utf8')) : void 0;
const filter = filterPath ? fs.readFileSync(filterPath, 'utf8') : void 0;
const res = await convert(srcPath, false, config, filter);
const res = await convert(srcPath, srcPath.toLowerCase().indexOf('.bcif') > 0, config, filter);
await write(outPath, res);
}
@@ -38,13 +38,13 @@ function run(args: Args) {
const parser = new argparse.ArgumentParser({
add_help: true,
description: 'Convert any CIF file to a BCIF file'
description: 'Convert any BCIF file to a CIF file or vice versa'
});
parser.add_argument('src', {
help: 'Source CIF path'
help: 'Source file path'
});
parser.add_argument('out', {
help: 'Output BCIF path'
help: 'Output file path'
});
parser.add_argument('-c', '--config', {
help: 'Optional encoding strategy/precision config path',

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -35,20 +35,16 @@ async function runGenerateSchemaMmcif(name: string, fieldNamesPath: string, type
const ihmDic = await parseCifText(fs.readFileSync(IHM_DIC_PATH, 'utf8')).run();
if (ihmDic.isError) throw ihmDic;
await ensureCarbBranchDicAvailable();
const carbBranchDic = await parseCifText(fs.readFileSync(CARB_BRANCH_DIC_PATH, 'utf8')).run();
if (carbBranchDic.isError) throw carbBranchDic;
await ensureCarbCompDicAvailable();
const carbCompDic = await parseCifText(fs.readFileSync(CARB_COMP_DIC_PATH, 'utf8')).run();
if (carbCompDic.isError) throw carbCompDic;
await ensureMaDicAvailable();
const maDic = await parseCifText(fs.readFileSync(MA_DIC_PATH, 'utf8')).run();
if (maDic.isError) throw maDic;
const mmcifDicVersion = getDicVersion(mmcifDic.result.blocks[0]);
const ihmDicVersion = getDicVersion(ihmDic.result.blocks[0]);
const carbDicVersion = 'draft';
const version = `Dictionary versions: mmCIF ${mmcifDicVersion}, IHM ${ihmDicVersion}, CARB ${carbDicVersion}.`;
const maDicVersion = getDicVersion(maDic.result.blocks[0]);
const version = `Dictionary versions: mmCIF ${mmcifDicVersion}, IHM ${ihmDicVersion}, MA ${maDicVersion}.`;
const frames: CifFrame[] = [...mmcifDic.result.blocks[0].saveFrames, ...ihmDic.result.blocks[0].saveFrames, ...carbBranchDic.result.blocks[0].saveFrames, ...carbCompDic.result.blocks[0].saveFrames];
const frames: CifFrame[] = [...mmcifDic.result.blocks[0].saveFrames, ...ihmDic.result.blocks[0].saveFrames, ...maDic.result.blocks[0].saveFrames];
const schema = generateSchema(frames);
await runGenerateSchema(name, version, schema, fieldNamesPath, typescript, out, moldbImportPath, addAliases);
@@ -139,8 +135,7 @@ async function getFieldNamesFilter(fieldNamesPath: string): Promise<Filter> {
async function ensureMmcifDicAvailable() { await ensureDicAvailable(MMCIF_DIC_PATH, MMCIF_DIC_URL); }
async function ensureIhmDicAvailable() { await ensureDicAvailable(IHM_DIC_PATH, IHM_DIC_URL); }
async function ensureCarbBranchDicAvailable() { await ensureDicAvailable(CARB_BRANCH_DIC_PATH, CARB_BRANCH_DIC_URL); }
async function ensureCarbCompDicAvailable() { await ensureDicAvailable(CARB_COMP_DIC_PATH, CARB_COMP_DIC_URL); }
async function ensureMaDicAvailable() { await ensureDicAvailable(MA_DIC_PATH, MA_DIC_URL); }
async function ensureCifCoreDicAvailable() {
await ensureDicAvailable(CIF_CORE_DIC_PATH, CIF_CORE_DIC_URL);
await ensureDicAvailable(CIF_CORE_ENUM_PATH, CIF_CORE_ENUM_URL);
@@ -163,12 +158,10 @@ async function ensureDicAvailable(dicPath: string, dicUrl: string) {
const DIC_DIR = path.resolve(__dirname, '../../../../build/dics/');
const MMCIF_DIC_PATH = `${DIC_DIR}/mmcif_pdbx_v50.dic`;
const MMCIF_DIC_URL = 'http://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic';
const IHM_DIC_PATH = `${DIC_DIR}/ihm-extension.dic`;
const IHM_DIC_URL = 'https://raw.githubusercontent.com/ihmwg/IHM-dictionary/master/ihm-extension.dic';
const CARB_BRANCH_DIC_PATH = `${DIC_DIR}/entity_branch-extension.dic`;
const CARB_BRANCH_DIC_URL = 'https://raw.githubusercontent.com/pdbxmmcifwg/carbohydrate-extension/master/dict/entity_branch-extension.dic';
const CARB_COMP_DIC_PATH = `${DIC_DIR}/chem_comp-extension.dic`;
const CARB_COMP_DIC_URL = 'https://raw.githubusercontent.com/pdbxmmcifwg/carbohydrate-extension/master/dict/chem_comp-extension.dic';
const IHM_DIC_PATH = `${DIC_DIR}/mmcif_ihm_ext.dic`;
const IHM_DIC_URL = 'https://raw.githubusercontent.com/ihmwg/IHMCIF/master/dist/mmcif_ihm_ext.dic';
const MA_DIC_PATH = `${DIC_DIR}/ma-extension.dic`;
const MA_DIC_URL = 'https://raw.githubusercontent.com/ihmwg/ModelCIF/master/dist/mmcif_ma.dic';
const CIF_CORE_DIC_PATH = `${DIC_DIR}/cif_core.dic`;
const CIF_CORE_DIC_URL = 'https://raw.githubusercontent.com/COMCIFS/cif_core/master/cif_core.dic';

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -13,15 +13,18 @@ export function getFieldType(type: string, description: string, values?: string[
switch (type) {
// mmCIF
case 'code':
case 'ucode':
case 'line':
case 'uline':
case 'text':
case 'char':
case 'uchar3':
case 'uchar1':
case 'boolean':
return values && values.length ? EnumCol(values, 'str', description) : StrCol(description);
case 'ucode':
case 'uline':
case 'uchar3':
case 'uchar1':
case 'uchar5':
// only force lower-case for enums
return values && values.length ? EnumCol(values.map(x => x.toLowerCase()), 'lstr', description) : StrCol(description);
case 'aliasname':
case 'name':
case 'idname':
@@ -38,6 +41,7 @@ export function getFieldType(type: string, description: string, values?: string[
case 'pdbx_related_db_id':
case 'sequence_dep':
case 'pdb_id':
case 'pdb_id_u': // should be case insensitve, but can't express that
case 'emd_id':
// todo, consider adding specialised fields
case 'yyyy-mm-dd':
@@ -49,6 +53,7 @@ export function getFieldType(type: string, description: string, values?: string[
case 'operation_expression':
case 'point_symmetry':
case '4x3_matrix':
case '3x4_matrix':
case '3x4_matrices':
case 'point_group':
case 'point_group_helical':
@@ -58,6 +63,7 @@ export function getFieldType(type: string, description: string, values?: string[
case 'symop':
case 'exp_data_doi':
case 'asym_id':
case 'uniprot_ptm_id':
return StrCol(description);
case 'int':
case 'non_negative_int':
@@ -68,6 +74,7 @@ export function getFieldType(type: string, description: string, values?: string[
case 'ec-type':
case 'ucode-alphanum-csv':
case 'id_list':
case 'entity_id_list':
return ListCol('str', ',', description);
case 'id_list_spc':
return ListCol('str', ' ', description);
@@ -84,6 +91,8 @@ export function getFieldType(type: string, description: string, values?: string[
case 'DateTime':
case 'Tag':
case 'Implied':
case 'Word':
case 'Uri':
return wrapContainer('str', ',', description, container);
case 'Real':
return wrapContainer('float', ',', description, container);
@@ -147,7 +156,7 @@ function getImportFrames(d: Data.CifFrame, imports: Imports) {
}
/** get field from given or linked category */
function getField(category: string, field: string, d: Data.CifFrame, imports: Imports, ctx: FrameData): Data.CifField|undefined {
function getField(category: string, field: string, d: Data.CifFrame, imports: Imports, ctx: FrameData): Data.CifField | undefined {
const { categories, links } = ctx;
const cat = d.categories[category];
if (cat) {

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -10,7 +10,7 @@ import { FieldPath } from '../../../mol-io/reader/cif/schema';
function header(name: string, info: string, moldataImportPath: string) {
return `/**
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Code-generated '${name}' schema file. ${info}
*
@@ -35,13 +35,17 @@ function getTypeShorthands(schema: Database, fields?: Filter) {
const { columns } = schema.tables[table];
Object.keys(columns).forEach(columnName => {
if (fields && !fields[table][columnName]) return;
types.add(schema.tables[table].columns[columnName].type);
const col = schema.tables[table].columns[columnName];
if (col.type === 'enum') types.add(col.subType);
types.add(col.type);
});
});
const shorthands: string[] = [];
types.forEach(type => {
switch (type) {
case 'str': shorthands.push('const str = Schema.str;'); break;
case 'ustr': shorthands.push('const ustr = Schema.ustr;'); break;
case 'lstr': shorthands.push('const lstr = Schema.lstr;'); break;
case 'int': shorthands.push('const int = Schema.int;'); break;
case 'float': shorthands.push('const float = Schema.float;'); break;
case 'coord': shorthands.push('const coord = Schema.coord;'); break;

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
@@ -29,8 +29,8 @@ export function FloatCol(description: string): FloatCol { return { type: 'float'
export type CoordCol = { type: 'coord' } & BaseCol
export function CoordCol(description: string): CoordCol { return { type: 'coord', description }; }
export type EnumCol = { type: 'enum', subType: 'int' | 'str', values: string[] } & BaseCol
export function EnumCol(values: string[], subType: 'int' | 'str', description: string): EnumCol {
export type EnumCol = { type: 'enum', subType: 'int' | 'str' | 'ustr' | 'lstr', values: string[] } & BaseCol
export function EnumCol(values: string[], subType: 'int' | 'str' | 'ustr' | 'lstr', description: string): EnumCol {
return { type: 'enum', description, values, subType };
}

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env node
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Adam Midlik <midlik@gmail.com>
*
* Command-line application for printing MolViewSpec tree schema
* Build: npm run build
* Run: node lib/commonjs/cli/mvs/mvs-print-schema
* node lib/commonjs/cli/mvs/mvs-print-schema --markdown
*/
import { ArgumentParser } from 'argparse';
import { treeSchemaToMarkdown, treeSchemaToString } from '../../extensions/mvs/tree/generic/tree-schema';
import { MVSDefaults } from '../../extensions/mvs/tree/mvs/mvs-defaults';
import { MVSTreeSchema } from '../../extensions/mvs/tree/mvs/mvs-tree';
/** Command line argument values for `main` */
interface Args {
markdown: boolean,
}
/** Return parsed command line arguments for `main` */
function parseArguments(): Args {
const parser = new ArgumentParser({ description: 'Command-line application for printing MolViewSpec tree schema.' });
parser.add_argument('-m', '--markdown', { action: 'store_true', help: 'Print the schema as markdown instead of plain text.' });
const args = parser.parse_args();
return { ...args };
}
/** Main workflow for printing MolViewSpec tree schema. */
function main(args: Args) {
if (args.markdown) {
console.log(treeSchemaToMarkdown(MVSTreeSchema, MVSDefaults));
} else {
console.log(treeSchemaToString(MVSTreeSchema, MVSDefaults));
}
}
main(parseArguments());

158
src/cli/mvs/mvs-render.ts Normal file
View File

@@ -0,0 +1,158 @@
#!/usr/bin/env node
/**
* Copyright (c) 2023-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Adam Midlik <midlik@gmail.com>
*
* Command-line application for rendering images from MolViewSpec files
* Build: npm install --no-save canvas gl jpeg-js pngjs // these packages are not listed in Mol* dependencies for performance reasons
* npm run build
* Run: node lib/commonjs/cli/mvs/mvs-render -i examples/mvs/1cbs.mvsj -o ../outputs/1cbs.png --size 800x600 --molj
*/
import { ArgumentParser } from 'argparse';
import fs from 'fs';
import gl from 'gl';
import jpegjs from 'jpeg-js';
import path from 'path';
import pngjs from 'pngjs';
import { Canvas3DParams } from '../../mol-canvas3d/canvas3d';
import { setCanvasModule } from '../../mol-geo/geometry/text/font-atlas';
import { PluginContext } from '../../mol-plugin/context';
import { HeadlessPluginContext } from '../../mol-plugin/headless-plugin-context';
import { DefaultPluginSpec, PluginSpec } from '../../mol-plugin/spec';
import { ExternalModules, defaultCanvas3DParams } from '../../mol-plugin/util/headless-screenshot';
import { Task } from '../../mol-task';
import { setFSModule } from '../../mol-util/data-source';
import { onelinerJsonString } from '../../mol-util/json';
import { ParamDefinition as PD } from '../../mol-util/param-definition';
// MolViewSpec must be imported after HeadlessPluginContext
import { MolViewSpec } from '../../extensions/mvs/behavior';
import { loadMVSX } from '../../extensions/mvs/components/formats';
import { loadMVS } from '../../extensions/mvs/load';
import { MVSData } from '../../extensions/mvs/mvs-data';
setFSModule(fs);
setCanvasModule(require('canvas'));
const DEFAULT_SIZE = '800x800';
/** Command line argument values for `main` */
interface Args {
input: string[],
output: string[],
size: { width: number, height: number },
molj: boolean,
}
/** Return parsed command line arguments for `main` */
function parseArguments(): Args {
const parser = new ArgumentParser({ description: 'Command-line application for rendering images from MolViewSpec files' });
parser.add_argument('-i', '--input', { required: true, nargs: '+', help: 'Input file(s) in .mvsj or .mvsx format. File format is inferred from the file extension.' });
parser.add_argument('-o', '--output', { required: true, nargs: '+', help: 'File path(s) for output files (one output path for each input file). Output format is inferred from the file extension (.png or .jpg)' });
parser.add_argument('-s', '--size', { help: `Output image resolution, {width}x{height}. Default: ${DEFAULT_SIZE}.`, default: DEFAULT_SIZE });
parser.add_argument('-m', '--molj', { action: 'store_true', help: `Save Mol* state (.molj) in addition to rendered images (use the same output file paths but with .molj extension)` });
const args = parser.parse_args();
try {
const parts = args.size.split('x');
if (parts.length !== 2) throw new Error('Must contain two x-separated parts');
args.size = { width: parseIntStrict(parts[0]), height: parseIntStrict(parts[1]) };
} catch {
parser.error(`argument: --size: invalid image size string: '${args.size}' (must be two x-separated integers (width and height), e.g. '400x300')`);
}
if (args.input.length !== args.output.length) {
parser.error(`argument: --output: must specify the same number of input and output file paths (specified ${args.input.length} input path${args.input.length !== 1 ? 's' : ''} but ${args.output.length} output path${args.output.length !== 1 ? 's' : ''})`);
}
return { ...args };
}
/** Main workflow for rendering images from MolViewSpec files */
async function main(args: Args): Promise<void> {
const plugin = await createHeadlessPlugin(args);
for (let i = 0; i < args.input.length; i++) {
const input = args.input[i];
const output = args.output[i];
console.log(`Processing ${input} -> ${output}`);
let mvsData: MVSData;
let sourceUrl: string | undefined;
if (input.toLowerCase().endsWith('.mvsj')) {
const data = fs.readFileSync(input, { encoding: 'utf8' });
mvsData = MVSData.fromMVSJ(data);
sourceUrl = `file://${path.resolve(input)}`;
} else if (input.toLowerCase().endsWith('.mvsx')) {
const data = fs.readFileSync(input);
const mvsx = await plugin.runTask(Task.create('Load MVSX', async ctx => loadMVSX(plugin, ctx, data)));
mvsData = mvsx.mvsData;
sourceUrl = mvsx.sourceUrl;
} else {
throw new Error(`Input file name must end with .mvsj or .mvsx: ${input}`);
}
await loadMVS(plugin, mvsData, { sanityChecks: true, replaceExisting: true, sourceUrl: sourceUrl });
fs.mkdirSync(path.dirname(output), { recursive: true });
if (args.molj) {
await plugin.saveStateSnapshot(withExtension(output, '.molj'));
}
await plugin.saveImage(output);
checkState(plugin);
}
await plugin.clear();
plugin.dispose();
}
/** Return a new and initiatized HeadlessPlugin */
async function createHeadlessPlugin(args: Pick<Args, 'size'>): Promise<HeadlessPluginContext> {
const externalModules: ExternalModules = { gl, pngjs, 'jpeg-js': jpegjs };
const spec = DefaultPluginSpec();
spec.behaviors.push(PluginSpec.Behavior(MolViewSpec));
const headlessCanvasOptions = defaultCanvas3DParams();
const canvasOptions = {
...PD.getDefaultValues(Canvas3DParams),
cameraResetDurationMs: headlessCanvasOptions.cameraResetDurationMs,
postprocessing: headlessCanvasOptions.postprocessing,
};
const plugin = new HeadlessPluginContext(externalModules, spec, args.size, { canvas: canvasOptions });
try {
await plugin.init();
} catch (error) {
plugin.dispose();
throw error;
}
return plugin;
}
/** Parse integer, fail early. */
function parseIntStrict(str: string): number {
if (str === '') throw new Error('Is empty string');
const result = Number(str);
if (isNaN(result)) throw new Error('Is NaN');
if (Math.floor(result) !== result) throw new Error('Is not integer');
return result;
}
/** Replace the file extension in `filename` by `extension`. If `filename` has no extension, add it. */
function withExtension(filename: string, extension: string): string {
const oldExtension = path.extname(filename);
return filename.slice(0, -oldExtension.length) + extension;
}
/** Check Mol* state, print and throw error if any cell is not OK. */
function checkState(plugin: PluginContext): void {
const cells = Array.from(plugin.state.data.cells.values());
const badCell = cells.find(cell => cell.status !== 'ok');
if (badCell) {
console.error(`Building Mol* state failed`);
console.error(` Transformer: ${badCell.transform.transformer.id}`);
console.error(` Params: ${onelinerJsonString(badCell.transform.params)}`);
console.error(` Error: ${badCell.errorText}`);
console.error(``);
throw new Error(`Building Mol* state failed: ${badCell.errorText}`);
}
}
main(parseArguments());

View File

@@ -0,0 +1,58 @@
#!/usr/bin/env node
/**
* Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Adam Midlik <midlik@gmail.com>
*
* Command-line application for validating MolViewSpec files
* Build: npm run build
* Run: node lib/commonjs/cli/mvs/mvs-validate examples/mvs/1cbs.mvsj
*/
import { ArgumentParser } from 'argparse';
import fs from 'fs';
import { setFSModule } from '../../mol-util/data-source';
import { MVSData } from '../../extensions/mvs/mvs-data';
setFSModule(fs);
/** Command line argument values for `main` */
interface Args {
input: string[],
no_extra: boolean,
}
/** Return parsed command line arguments for `main` */
function parseArguments(): Args {
const parser = new ArgumentParser({ description: 'Command-line application for validating MolViewSpec files. Prints validation status (OK/FAILED) to stdout, detailed validation issues to stderr. Exits with a zero exit code if all input files are OK.' });
parser.add_argument('input', { nargs: '+', help: 'Input file(s) in .mvsj format' });
parser.add_argument('--no-extra', { action: 'store_true', help: 'Treat presence of extra node params as an issue.' });
const args = parser.parse_args();
return { ...args };
}
/** Main workflow for validating MolViewSpec files. Returns the number of failed input files. */
function main(args: Args): number {
let nFailed = 0;
for (const input of args.input) {
const data = fs.readFileSync(input, { encoding: 'utf8' });
const mvsData = MVSData.fromMVSJ(data);
const issues = MVSData.validationIssues(mvsData, { noExtra: args.no_extra });
const status = issues ? 'FAILED' : 'OK';
console.log(`${status.padEnd(6)} ${input}`);
if (issues) {
nFailed++;
for (const issue of issues) {
console.error(issue);
}
}
}
return nFailed;
}
const nFailed = main(parseArguments());
if (nFailed > 0) {
process.exitCode = 1;
}

View File

@@ -25,7 +25,7 @@ async function readFile(path: string) {
}
}
async function parseCif(data: string|Uint8Array) {
async function parseCif(data: string | Uint8Array) {
const comp = CIF.parse(data);
const parsed = await comp.run(p => console.log(Progress.format(p)), 250);
if (parsed.isError) throw parsed;

Some files were not shown because too many files have changed in this diff Show More