molstar-cli 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- molstar_cli/__init__.py +12 -0
- molstar_cli/__main__.py +5 -0
- molstar_cli/_version.py +24 -0
- molstar_cli/cli.py +70 -0
- molstar_cli/server.py +128 -0
- molstar_cli/static/molstar/LICENSE.molstar +21 -0
- molstar_cli/static/molstar/VERSION +1 -0
- molstar_cli/static/molstar/favicon.ico +0 -0
- molstar_cli/static/molstar/images/cells.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_back6.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_bottom4.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_front5.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_left2.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_right1.jpg +0 -0
- molstar_cli/static/molstar/images/nebula_top3.jpg +0 -0
- molstar_cli/static/molstar/molstar.css +3 -0
- molstar_cli/static/molstar/molstar.js +7872 -0
- molstar_cli/static/molstar/theme/blue.css +2 -0
- molstar_cli/static/molstar/theme/blue.js +1 -0
- molstar_cli/static/molstar/theme/dark.css +2 -0
- molstar_cli/static/molstar/theme/dark.js +1 -0
- molstar_cli/static/molstar/theme/light.css +2 -0
- molstar_cli/static/molstar/theme/light.js +1 -0
- molstar_cli/static/open.html +38 -0
- molstar_cli-0.0.1.dist-info/METADATA +134 -0
- molstar_cli-0.0.1.dist-info/RECORD +30 -0
- molstar_cli-0.0.1.dist-info/WHEEL +4 -0
- molstar_cli-0.0.1.dist-info/entry_points.txt +2 -0
- molstar_cli-0.0.1.dist-info/licenses/LICENSE +21 -0
- molstar_cli-0.0.1.dist-info/licenses/molstar_cli/static/molstar/LICENSE.molstar +21 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: molstar-cli
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Open local structure and map files (mmCIF, PDB, EMDB maps, ...) in the Mol* viewer from the command line
|
|
5
|
+
Project-URL: Homepage, https://github.com/aozalevsky/molstar_cli
|
|
6
|
+
Project-URL: Issues, https://github.com/aozalevsky/molstar_cli/issues
|
|
7
|
+
Project-URL: Mol*, https://molstar.org
|
|
8
|
+
Author: Arthur Zalevsky
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: molstar_cli/static/molstar/LICENSE.molstar
|
|
12
|
+
Keywords: cryo-em,emdb,mmcif,mol*,molecular visualization,molstar,pdb,viewer
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# molstar-cli
|
|
25
|
+
|
|
26
|
+
Open local structure and map files in the [Mol*](https://molstar.org) viewer from the terminal.
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
$ pip install molstar-cli
|
|
30
|
+
$ molstar 5me2.cif emd_3488.map.gz
|
|
31
|
+
Mol* viewer: http://127.0.0.1:34037/MtXDcbb3cYRnGhsxczKvZw/
|
|
32
|
+
Press Ctrl-C to stop.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
All files open together in one Mol* scene in your default browser — e.g. a model fitted
|
|
36
|
+
into its cryo-EM map. The Mol* viewer is bundled, so it works offline; there are no
|
|
37
|
+
dependencies beyond Python ≥ 3.10.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
molstar FILE [FILE ...] [-p PORT] [--no-browser]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```console
|
|
46
|
+
$ molstar *.cif # several structures, one scene
|
|
47
|
+
$ molstar model.cif emd_1234.map.gz # model + EMDB map
|
|
48
|
+
$ molstar PDBDEV_00000001.cif # integrative (IHM) models, incl. coarse-grained beads
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The command keeps serving while you look at the structures; stop it with Ctrl-C.
|
|
52
|
+
Reloading the browser tab re-reads the files from disk.
|
|
53
|
+
|
|
54
|
+
| Option | |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `-p`, `--port PORT` | listen on a fixed port instead of a random free one |
|
|
57
|
+
| `--no-browser` | only print the URL |
|
|
58
|
+
| `-V`, `--version` | print the molstar-cli and bundled Mol* versions |
|
|
59
|
+
|
|
60
|
+
### Supported formats
|
|
61
|
+
|
|
62
|
+
Anything Mol*'s *Open Files* dialog accepts, detected by file extension, optionally
|
|
63
|
+
wrapped in `.gz` or `.zip`:
|
|
64
|
+
|
|
65
|
+
- **Structures:** mmCIF / PDBx (`.cif`, `.mmcif`, `.mcif`) including IHM integrative
|
|
66
|
+
models, BinaryCIF (`.bcif`), PDB (`.pdb`, `.ent`), PDBQT, PQR, GRO, XYZ, SDF / MOL /
|
|
67
|
+
MOL2, LAMMPS data/dump
|
|
68
|
+
- **Volumes:** CCP4 / MRC / MAP (`.map`, `.mrc`, `.ccp4` — EMDB maps), DSN6 / BRIX,
|
|
69
|
+
DX, Cube, density server CIF, MTZ
|
|
70
|
+
- **Trajectories and topologies:** DCD, XTC, TRR, NetCDF, PSF, PRMTOP, TOP
|
|
71
|
+
- **Other:** PLY / OBJ meshes, MolViewSpec (`.mvsj`, `.mvsx`), Mol* sessions (`.molj`, `.molx`)
|
|
72
|
+
|
|
73
|
+
Unsupported files are skipped with a warning in the Mol* log panel.
|
|
74
|
+
|
|
75
|
+
Maps open at Mol*'s default isovalue (2σ) — the EMDB-recommended contour level is not
|
|
76
|
+
stored in the map file. Adjust it in the Volume panel on the right.
|
|
77
|
+
|
|
78
|
+
### Remote machines
|
|
79
|
+
|
|
80
|
+
With `--no-browser`, or on a Linux machine without a display (e.g. over SSH), `molstar`
|
|
81
|
+
doesn't start a browser; it prints an `ssh -L` command instead:
|
|
82
|
+
|
|
83
|
+
```console
|
|
84
|
+
server$ molstar model.cif
|
|
85
|
+
Mol* viewer: http://127.0.0.1:41235/Xy.../
|
|
86
|
+
On a remote machine? Run `ssh -L 41235:127.0.0.1:41235 server` on your computer, then open the URL above there.
|
|
87
|
+
Press Ctrl-C to stop.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Use `--port` to keep the same forwarded port between runs.
|
|
91
|
+
|
|
92
|
+
### Security
|
|
93
|
+
|
|
94
|
+
The server listens on `127.0.0.1` only, every URL carries a random token, and only the
|
|
95
|
+
files named on the command line can be read — no directory listing, no other paths.
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
```console
|
|
100
|
+
$ python -m venv .venv && .venv/bin/pip install -e . pytest
|
|
101
|
+
$ .venv/bin/pytest
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Updating the bundled Mol*
|
|
105
|
+
|
|
106
|
+
The prebuilt viewer from the [`molstar` npm package](https://www.npmjs.com/package/molstar)
|
|
107
|
+
is vendored in `molstar_cli/static/molstar/` (no Node.js needed):
|
|
108
|
+
|
|
109
|
+
```console
|
|
110
|
+
$ python scripts/update_molstar.py 5.11.0
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Check that it loads, then commit the result.
|
|
114
|
+
|
|
115
|
+
### Releasing
|
|
116
|
+
|
|
117
|
+
Create a GitHub release with a tag like `v0.0.2`. The package version is taken from the
|
|
118
|
+
tag, so there is nothing to bump. The *Publish to PyPI* workflow builds and uploads it
|
|
119
|
+
using [trusted publishing](https://docs.pypi.org/trusted-publishers/) (PyPI publisher:
|
|
120
|
+
owner `aozalevsky`, repository `molstar_cli`, workflow `publish.yml`, environment `pypi`).
|
|
121
|
+
|
|
122
|
+
## Citing Mol*
|
|
123
|
+
|
|
124
|
+
If you use Mol* in your work, please cite:
|
|
125
|
+
|
|
126
|
+
> D. Sehnal, S. Bittrich, M. Deshpande, R. Svobodová, K. Berka, V. Bazgier, S. Velankar,
|
|
127
|
+
> S.K. Burley, J. Koča, A.S. Rose. Mol* Viewer: modern web app for 3D visualization and
|
|
128
|
+
> analysis of large biomolecular structures. *Nucleic Acids Research* 49(W1), W431–W437
|
|
129
|
+
> (2021). [doi:10.1093/nar/gkab314](https://doi.org/10.1093/nar/gkab314)
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT. The bundled Mol* viewer is © Mol* contributors, also MIT —
|
|
134
|
+
see [`LICENSE.molstar`](molstar_cli/static/molstar/LICENSE.molstar).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
molstar_cli/__init__.py,sha256=sMxEbRUcBzF7kqOixi0DvM-t9_dabRqW_5OoPfknmu8,460
|
|
2
|
+
molstar_cli/__main__.py,sha256=E6Gls0DNz8GQK2K-kOUIx8cYhgANW_CH54VKrfCfs14,52
|
|
3
|
+
molstar_cli/_version.py,sha256=8OsTLsIVB9D0HdPTmt5rVwyVUBe9xTVGkRslXicxzkM,520
|
|
4
|
+
molstar_cli/cli.py,sha256=4BUYVInHdVW7ZmTK1uKHC4El_zr7gHly80ynpT6XyV4,2664
|
|
5
|
+
molstar_cli/server.py,sha256=acmdma-_IHt-TtWyKmoovdyoPojVj2qefuePnRPjfSU,4647
|
|
6
|
+
molstar_cli/static/open.html,sha256=cXQBQYgI2zY42LYoDOYCRW_3OIGJk3w0w0RGqBVC1iU,1515
|
|
7
|
+
molstar_cli/static/molstar/LICENSE.molstar,sha256=6r0YMe1gWinPnX5gIhwBnBvAJq3YHjwGhs5fJLPU1QA,1108
|
|
8
|
+
molstar_cli/static/molstar/VERSION,sha256=tPDATlj3wGfm5bwQkb3Qa2rhm4Gi1iK_Kdvl6ywm2Gw,7
|
|
9
|
+
molstar_cli/static/molstar/favicon.ico,sha256=07KJihLehWN14KxsU5oTmZMr-x9Smh9P6fHm720yjCA,15406
|
|
10
|
+
molstar_cli/static/molstar/molstar.css,sha256=W2jOttNkJUm06bLAceWOQbmKU1CuJpGAWHs52oaSXVU,72842
|
|
11
|
+
molstar_cli/static/molstar/molstar.js,sha256=f61VYcdLyQCTD7V9arAo0ar92oIiOpAb-TKxCY6E8fM,5027864
|
|
12
|
+
molstar_cli/static/molstar/images/cells.jpg,sha256=V1OG0vSrrhbt0YHELZk2q7Fdhyx2TOW0EqaKDVP6tIE,185455
|
|
13
|
+
molstar_cli/static/molstar/images/nebula_back6.jpg,sha256=HJ2GFblncKeFPrZGyUsPmFhXCw3bZkveinWQyj0xLGU,59432
|
|
14
|
+
molstar_cli/static/molstar/images/nebula_bottom4.jpg,sha256=3EHjoAS56UEO_77lb4MpXZSf1Rv1hZT87i9gHNr-Lpg,74470
|
|
15
|
+
molstar_cli/static/molstar/images/nebula_front5.jpg,sha256=ncswawWkrfX6MXKaM1g_0KhDSrYdLaU0urAaRE97gDE,72077
|
|
16
|
+
molstar_cli/static/molstar/images/nebula_left2.jpg,sha256=FhzVXDdTET-WwpUL0zhxjdWQaJaMdlEGtXaUyxw9f7k,56638
|
|
17
|
+
molstar_cli/static/molstar/images/nebula_right1.jpg,sha256=bbzGDJl8HX_GkKanJ97wmGGuL95ckU178UCarfmXnHA,80909
|
|
18
|
+
molstar_cli/static/molstar/images/nebula_top3.jpg,sha256=C8d5kwKRSPBpG4HRhBqfYD-BJRpmWqehG5iEGMkBeig,91432
|
|
19
|
+
molstar_cli/static/molstar/theme/blue.css,sha256=F_fVTNBT_aNBUYofiDeYlt7cFMMFRnwx-2MD0bZ3JKw,71476
|
|
20
|
+
molstar_cli/static/molstar/theme/blue.js,sha256=hmnwSKDppdR9xlcwYQmrQ32maDrZJfvWpFGu9yVCp4c,25
|
|
21
|
+
molstar_cli/static/molstar/theme/dark.css,sha256=lhaCgwj6ftArVBA7GSOYathq_iO5bodh5mKJWNJ4o7g,72627
|
|
22
|
+
molstar_cli/static/molstar/theme/dark.js,sha256=hmnwSKDppdR9xlcwYQmrQ32maDrZJfvWpFGu9yVCp4c,25
|
|
23
|
+
molstar_cli/static/molstar/theme/light.css,sha256=lSWF_0TLCVT3gX7ofV9ATgvD_TfUT4-EOVTOScLST4Q,72802
|
|
24
|
+
molstar_cli/static/molstar/theme/light.js,sha256=hmnwSKDppdR9xlcwYQmrQ32maDrZJfvWpFGu9yVCp4c,25
|
|
25
|
+
molstar_cli-0.0.1.dist-info/METADATA,sha256=zqJGadLI5mpl69RECyg94m2eQoWFTiaKT20JgtnZ_ZM,4972
|
|
26
|
+
molstar_cli-0.0.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
27
|
+
molstar_cli-0.0.1.dist-info/entry_points.txt,sha256=ePDYEaeLcT7fQCSBhKhtKEdNS9g6nP9a9Or_Tz2t0sY,49
|
|
28
|
+
molstar_cli-0.0.1.dist-info/licenses/LICENSE,sha256=uJp5CZh75pWRbDoIz7klDs9ZWA43pWr0OkcR89tLXoE,1072
|
|
29
|
+
molstar_cli-0.0.1.dist-info/licenses/molstar_cli/static/molstar/LICENSE.molstar,sha256=6r0YMe1gWinPnX5gIhwBnBvAJq3YHjwGhs5fJLPU1QA,1108
|
|
30
|
+
molstar_cli-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arthur Zalevsky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 - now, Mol* contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|