Skip to content

Commit 73a48f7

Browse files
committed
#1 adds support for additional file types, fixes reset on panel switch
1 parent 426d63b commit 73a48f7

File tree

6 files changed

+161
-15
lines changed

6 files changed

+161
-15
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Change Log
22

33
All notable changes to the "protein-viewer" extension will be documented in this file.
4+
## 1.0.2
5+
6+
* Update docs
7+
* Fixes issue that viewer would autorefresh and lose state when switching between views.
8+
9+
Adds support for additional filetypes:
10+
* `.pdbqt`
11+
* `.mmcif`
12+
* `.gro`
13+
* `.xyz`
14+
* `.cif`
15+
16+
Adds support for molecules:
17+
* `.mol`
18+
* `.mol2`
19+
* `.sdf`
420

521
## 1.0.1
622

README.md

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
VSCoding Sequence allows for visualisation of protein structures in the editor, courtesy of the fantastic [Mol*](https://molstar.org/)
66

7-
## Features
87

8+
[Viewer Docs](https://molstar.org/viewer-docs/) | [Mol* Docs](https://molstar.org/docs/)
9+
10+
## Features
911
### Loading a Structure from the PDB
1012

1113
![Usage gif](img/usage.gif)
@@ -18,6 +20,91 @@ Simply call the `Start Protein Viewer command`, enter a PDB accession code & awa
1820

1921
Right-click on the `.pdb` file in the file editor and select `Launch Protein Viewer from File`
2022

23+
**Supported Formats**
24+
25+
* `.pdb`
26+
* `.pdbqt`
27+
* `.mmcif`
28+
* `.gro`
29+
* `.xyz`
30+
* `.cif`
31+
* `.mol`
32+
* `.mol2`
33+
* `.sdf`
34+
35+
## Usage
36+
*The below is taken from the [Mol\* viewer docs](https://molstar.org/viewer-docs/) which is based on the [RCSB PDB mol* documentation](https://www.rcsb.org/3d-view/molstar/help/getting-started) thanks to the generosity of RCSB PDB and Dr. Shuchismita Dutta.*
37+
### Interface
38+
![Viewer Layout](https://molstar.org/viewer-docs/img/generalinterface3.png)
39+
40+
**3D Canvas**: This is the space where a PDB structure is displayed for manipulation in three dimensions (3D). It is located on the left side of the screen.
41+
42+
**Toggle Menu**: This menu provides users quick access to some commonly used operations for the 3D canvas. It is located towards the right side of the 3D canvas and has the following functions.
43+
44+
45+
| Function | Description | Icon |
46+
|---|---|---|
47+
|Reset Camera | Centers and resets the view of the structure on the 3D canvas | ![Rest Camera Icon](https://molstar.org/viewer-docs/img/resetcameraicon.png) |
48+
|Screenshot/State Snapshot | Takes an image of the structure as shown and gives options for resolution and download | ![Screenshot.State Snapshot Icon](https://molstar.org/viewer-docs/img/screenshoticon.png) |
49+
|Controls Panel | Hides/shows the Controls Panel to the right | ![Control Panel Icon](https://molstar.org/viewer-docs/img/controlpanelicon.png) |
50+
|Expanded Viewport | Expands 3D canvas and Controls Panel to the full browser screen |![Expanded Viewport Icon](https://molstar.org/viewer-docs/img/expandedviewporticon.png) |
51+
|Settings/Control Info | Provides settings for viewing of 3D canvas, as well as information about moving in 3D and mouse controls| ![Settings/Control Info Icon](https://molstar.org/viewer-docs/img/settingsicon.png)|
52+
|[Selection Mode](https://molstar.org/viewer-docs/making-selections/#selection-mode) |Switches from Default Mode to Selection Mode |![Selection Mode Icon](https://molstar.org/viewer-docs/img/selectionmodeicon.png) |
53+
54+
**[Sequence Panel](https://molstar.org/viewer-docs/navigating-by-sequence/#sequence-panel)**: This menu displays the polymer sequences of macromolecules (proteins and nucleic acids) present in the uploaded PDB structures. In addition, it provides quick access to any small molecular ligands or entities present in the structure(s). It is located at the top of the screen above the 3D Canvas.
55+
56+
**[Controls Panel](https://molstar.org/viewer-docs/managing-the-display/#controls-panel)**: This menu has the following panels for structure manipulation. It is located at the right side of the screen.
57+
* [Structure](https://molstar.org/viewer-docs/managing-the-display/#structure-panel)
58+
* [Measurements](https://molstar.org/viewer-docs/managing-the-display/#measurements-panel)
59+
* [Components](https://molstar.org/viewer-docs/managing-the-display/#components-panel)
60+
* [Density](https://molstar.org/viewer-docs/managing-the-display/#density-panel)
61+
* [Assembly Symmetry](https://molstar.org/viewer-docs/managing-the-display/#assembly-symmetry-panel)
62+
* [Import](https://molstar.org/viewer-docs/managing-the-display/#import-panel)
63+
* [Session](https://molstar.org/viewer-docs/managing-the-display/#session-panel)
64+
* [Superposition](https://molstar.org/viewer-docs/managing-the-display/#superposition-panel)
65+
66+
**Log Panel**: This panel shows various logs containing information about actions taken while viewing the structure. This is located at the bottom of the screen below the 3D Canvas.
67+
68+
### Mouse Controls
69+
All the interactions with the molecule(s) uploaded in Mol* require using mouse controls (in the 3D canvas). These controls allow the user to manipulate the view of structures via a variety of functions such as rotating, translating, zooming, and clipping the structures. When not specified, a “click” refers to pressing the left mouse button or tapping a single finger on a touchscreen. If an action is available for the right mouse button, it can also be completed by using the Control button + left mouse button. The general mouse controls are listed below:
70+
71+
* **Rotate**: click the left mouse button and move. Alternatively, use the Shift button + left mouse button and drag to rotate the canvas.
72+
* **Translate**: click the right mouse button and move. Alternatively, use the Control button + the left mouse button and move. On a touchscreen device, use a two-finger drag.
73+
* **Zoom**: use the mouse wheel. On a touchpad, use a two-finger drag. On a touchscreen device, pinch two fingers.
74+
* **Center and zoom**: use the right mouse button to click onto the part of the structure you wish to focus on.
75+
* **Clip**: use the Shift button + the mouse wheel to change the clipping planes. On a touchpad, use the Shift button + a two-finger drag.
76+
77+
Moving the mouse over (or hovering over) any part of the 3D structure displayed in the 3D canvas, without clicking on it, will highlight it (by coloring it in magenta) according to the [Picking Level](https://molstar.org/viewer-docs/making-selections/#picking-level) currently selected. Additionally, in the lower right corner of the 3D canvas, information about the PDB ID, model number, instance, chain ID, residue number, and chain name is listed for the highlighted part of the structure.
78+
79+
As you interact with the structure using the mouse, Mol* contains two modes for which the behavior of a click is different. As a result, each mode enables unique operations to be performed. To switch between the two modes, use the Selection Mode icon (shaped like a cursor) that appears in the Toggle Menu. The list below summarizes Default Mode and Selection Mode.
80+
81+
* **Default Mode**: A click on a residue (or any object in 3D) will focus on it. The focused residue and its surroundings (residues and ligands) will be displayed in a ball & stick representation. All local non-covalent interactions will be shown. To hide the surroundings, click on the target residue again.
82+
* **[Selection Mode](https://molstar.org/viewer-docs/making-selections/#selection-mode)**: A click on a residue (or any object in 3D) will select it. What exactly will be selected depends on the value of the [Picking Level](https://molstar.org/viewer-docs/making-selections/#picking-level). Selected parts of the structure will appear with a bright green tint in the 3D canvas and in the [Sequence Panel](https://molstar.org/viewer-docs/navigating-by-sequence/#sequence-panel). When selecting polymers with the Picking Level set to “residue,” holding the Shift key while clicking will extend the selection along the polymer from the last clicked residue on. Clicking on any point in the 3D canvas that has no atom will clear the selection.
83+
84+
## Community
85+
### Support
86+
Need help? Please [open an issue](https://github.com/a-r-j/vscoding-sequence/issues/new/choose) for support.
87+
88+
### Discussion
89+
Find me on twitter: [@arian_jamasb](https://twitter.com/arian_jamasb) or drop me an email: [[email protected]](mailto:[email protected])
90+
91+
## Change log
92+
### 1.0.2
93+
* Update docs & package metadata
94+
* Fixes issue that viewer would autorefresh and lose state when switching between views.
95+
96+
Adds support for additional filetypes:
97+
* `.pdbqt`
98+
* `.mmcif`
99+
* `.gro`
100+
* `.xyz`
101+
* `.cif`
102+
103+
Adds support for molecules:
104+
* `.mol`
105+
* `.mol2`
106+
* `.sdf`
107+
21108
### 1.0.1
22109

23110
* Adds Right-click open from context menu
@@ -27,3 +114,25 @@ Right-click on the `.pdb` file in the file editor and select `Launch Protein Vie
27114
### 1.0.0
28115

29116
Initial release!
117+
118+
## Reference
119+
120+
If this extension proves useful, you should cite the developers of Mol*
121+
122+
```bibtex
123+
@article{10.1093/nar/gkab314,
124+
author = {Sehnal, David and Bittrich, Sebastian and Deshpande, Mandar and Svobodová, Radka and Berka, Karel and Bazgier, Václav and Velankar, Sameer and Burley, Stephen K and Koča, Jaroslav and Rose, Alexander S},
125+
title = "{Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures}",
126+
journal = {Nucleic Acids Research},
127+
volume = {49},
128+
number = {W1},
129+
pages = {W431-W437},
130+
year = {2021},
131+
month = {05},
132+
abstract = "{Large biomolecular structures are being determined experimentally on a daily basis using established techniques such as crystallography and electron microscopy. In addition, emerging integrative or hybrid methods (I/HM) are producing structural models of huge macromolecular machines and assemblies, sometimes containing 100s of millions of non-hydrogen atoms. The performance requirements for visualization and analysis tools delivering these data are increasing rapidly. Significant progress in developing online, web-native three-dimensional (3D) visualization tools was previously accomplished with the introduction of the LiteMol suite and NGL Viewers. Thereafter, Mol* development was jointly initiated by PDBe and RCSB PDB to combine and build on the strengths of LiteMol (developed by PDBe) and NGL (developed by RCSB PDB). The web-native Mol* Viewer enables 3D visualization and streaming of macromolecular coordinate and experimental data, together with capabilities for displaying structure quality, functional, or biological context annotations. High-performance graphics and data management allows users to simultaneously visualise up to hundreds of (superimposed) protein structures, stream molecular dynamics simulation trajectories, render cell-level models, or display huge I/HM structures. It is the primary 3D structure viewer used by PDBe and RCSB PDB. It can be easily integrated into third-party services. Mol* Viewer is open source and freely available at https://molstar.org/.}",
133+
issn = {0305-1048},
134+
doi = {10.1093/nar/gkab314},
135+
url = {https://doi.org/10.1093/nar/gkab314},
136+
eprint = {https://academic.oup.com/nar/article-pdf/49/W1/W431/38842088/gkab314.pdf},
137+
}
138+
```

out/panels/ProteinViewerPanel.js

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out/panels/ProteinViewerPanel.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "protein-viewer",
33
"displayName": "Protein Viewer",
4-
"description": "",
5-
"version": "0.0.2",
4+
"description": "Visualise 3D biological structures in the editor",
5+
"version": "0.0.3",
66
"publisher": "ArianJamasb",
77
"author": {
88
"name": "Arian Jamasb"
@@ -21,6 +21,29 @@
2121
"Visualization",
2222
"Data Science"
2323
],
24+
"keywords": [
25+
"protein",
26+
"molecule",
27+
"biology",
28+
"3d",
29+
"structure",
30+
"pdb",
31+
"pdbqt",
32+
"mmcif",
33+
"sdf",
34+
"ent",
35+
"mol",
36+
"mol2",
37+
"xyz",
38+
"cif",
39+
"gro",
40+
"macromolecule",
41+
"bioinformatics",
42+
"computational biology",
43+
"chemistry",
44+
"cheminformatics",
45+
"computational chemistry",
46+
],
2447
"activationEvents": [
2548
"onCommand:protein-viewer.start",
2649
"onCommand:protein-viewer.activateFromFile"
@@ -39,7 +62,7 @@
3962
],
4063
"menus": {
4164
"explorer/context": [{
42-
"when": "resourceExtname == .pdb",
65+
"when": "resourceExtname == .pdb || resourceExtname == .PDB || resourceExtname == .mol2 || resourceExtname == .MOL2 || resourceExtname == .sdf || resourceExtname == .SDF || resourceExtname == .mmCIF || resourceExtname == .mmcif || resourceExtname == .Mol || resourceExtname == .mol || resourceExtname == .MOL || resourceExtname == .xyz || resourceExtname == .XYZ || resourceExtname == .ent || resourceExtname == .ENT || resourceExtname == .pdbqt || resourceExtname == .PDBQT || resourceExtname == .cif || resourceExtname == .CIF || resourceExtname == .mcif || resourceExtname == .MCIF || resourceExtname == .gro || resourceExtname == .GRO",
4366
"command": "protein-viewer.activateFromFile",
4467
"group": "navigation"
4568
}]

0 commit comments

Comments
 (0)