Skip to content

Commit 81116e3

Browse files
authored
Merge pull request #1 from molstar/pub-updates
Add docs on animations, primitives, and volumes
2 parents 8f4bab3 + 22d9781 commit 81116e3

File tree

12 files changed

+9297
-1606
lines changed

12 files changed

+9297
-1606
lines changed

docs/animations.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MolViewSpec animations
2+
3+
Animations are sequential collections of individual MolViewSpec scenes. You can combine them freely into complex stories
4+
that render scenes one-by-one. The Mol* viewer can interpolate between these states, providing you with a powerful story
5+
telling tool tailored to structural biology.
6+
7+
## Creating snapshots
8+
9+
Use the builder as normal and define the desired scene. Invoke `get_snapshot()` to obtain a snapshot instance (in
10+
contrast to the default way of emitting the generated state description using `get_state()`).
11+
12+
```python
13+
snapshot1 = builder.get_snapshot(
14+
title="1tqn",
15+
description="""
16+
### 1tqn with ligand and electron density map
17+
- 2FO-FC at 1.5σ, blue
18+
- FO-FC (positive) at 3σ, green
19+
- FO-FC (negative) at -3σ, red
20+
""",
21+
)
22+
```
23+
24+
A snapshot can hold additional metadata such as a custom title and description. Markup is supported.
25+
26+
## Combining snapshots
27+
28+
Individual snapshots can then be combined into an animation by providing them in the desired order using the `snapshots`
29+
parameter. Additionally, global metadata can be added that describes shared properties of all snapshots.
30+
31+
```python
32+
states = States(snapshots=[snapshot1, snapshot2], metadata=GlobalMetadata(description="1tqn + Volume Server")).json(
33+
exclude_none=True, indent=2
34+
)
35+
```
36+
37+
The output is valid MolViewSpec JSON that can be opened in Mol*. Mol* will interpolate between individual substates and
38+
add smooth transitions by default. You can further customize this behavior using the `transition_duration_ms` and
39+
`linger_duration_ms` properties.

docs/demos.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Demonstrations
2+
3+
The following demos showcase how MolViewSpec helps with creating interactive stories and visualizations.
4+
5+
## [Kinases Story](https://molstar.org/demos/mvs-kinase-story/)
6+
7+
BCR-ABL is a classic case of how structural biology can drive drug discovery. This story will help you
8+
understand the role of BCR-ABL in chronic myeloid leukemia and how the drug Imatinib works. The source code can be found
9+
[here](https://github.com/molstar/molstar/tree/master/src/examples).
10+
11+
[![Kinases Story](./files/kinases.png 'Kinases Story')](https://molstar.org/demos/mvs-kinase-story/)
12+
13+
## [I/HM Restraints](https://molstar.org/demos/ihm-restraints/)
14+
15+
Visualize structural restraints for integrated hybrid models (I/HM). The source code can be found
16+
[here](https://github.com/molstar/molstar/tree/master/src/examples).
17+
18+
[![I/HM Restraints](./files/ihm-restraints.png 'I/HM Restraints')](https://molstar.org/demos/ihm-restraints/)

docs/files/distance-primitive.png

212 KB
Loading

docs/files/ihm-restraints.png

734 KB
Loading

docs/files/kinases.png

841 KB
Loading

0 commit comments

Comments
 (0)