moorhen 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -69
- package/baby-gru/CootWorker.ts +1 -1
- package/baby-gru/moorhen.css +0 -1
- package/baby-gru/wasm/moorhen.js +1 -1
- package/baby-gru/wasm/moorhen.wasm +0 -0
- package/baby-gru/wasm/web_example.js +1 -1
- package/baby-gru/wasm/web_example.wasm +0 -0
- package/moorhen.js +8 -8
- package/package.json +3 -1
- package/types/gemmi.d.ts +3 -2
- package/types/libcoot.d.ts +31 -2
- package/types/main.d.ts +11 -6
- package/types/mgWebGL.d.ts +3 -1
- package/types/moorhen.d.ts +22 -37
package/README.md
CHANGED
|
@@ -1,70 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Moorhen
|
|
2
|
+
|
|
3
|
+
Moorhen is a web browser molecular graphics program based on the Coot desktop program.
|
|
4
|
+
It is developed by porting some [CCP4](https://www.ccp4.ac.uk/) libraries and programs, [Coot](https://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/), [FFTW2](https://www.fftw.org/), [Privateer](https://github.com/glycojones/privateer) and the [Gnu Scientific Library](https://www.gnu.org/software/gsl/) to Web Assembly.
|
|
5
|
+
|
|
6
|
+
Also contained are examples of using the generated JS/Web Assembly:
|
|
7
|
+
|
|
8
|
+
* A command line example which offers some of the functionality of the CCP4 program `superpose`.
|
|
9
|
+
* A command line example which does a structure factor calculation with `clipper`.
|
|
10
|
+
|
|
11
|
+
The emscripten suite of tools is required to do the
|
|
12
|
+
compilation.
|
|
13
|
+
|
|
14
|
+
The sources of CCP4, Coot, Privateer, FFTW, and GSL are not included. They are downloaded and (possibly) patched by the running
|
|
15
|
+
the `get_sources` script, which is part of the build process of this project.
|
|
16
|
+
|
|
17
|
+
The following libraries/programs are compiled to Web Assembly:
|
|
18
|
+
* libccp4 (bzr)
|
|
19
|
+
* clipper (bzr)
|
|
20
|
+
* ssm (bzr)
|
|
21
|
+
* mmdb2 (bzr)
|
|
22
|
+
* ccp4srs (bzr)
|
|
23
|
+
* gemmi 0.5.8
|
|
24
|
+
* rvapi (bzr)
|
|
25
|
+
* gesamt (bzr)
|
|
26
|
+
* ccp4mg (partial) (bzr)
|
|
27
|
+
* privateer MKIV
|
|
28
|
+
* Coot 1.0 ('gtk3' git branch)
|
|
29
|
+
* fftw 2.1.5
|
|
30
|
+
* gsl 2.7.1
|
|
31
|
+
* Boost 1.83.0
|
|
32
|
+
* glm 0.9.9.8
|
|
33
|
+
* RDKit 2023_09_1
|
|
34
|
+
|
|
35
|
+
Moorhen is available to use at [https://moorhen.org](https://moorhen.org).
|
|
36
|
+
|
|
37
|
+
Further information can be found in our [wiki pages](https://moorhen-coot.github.io/wiki/) and our [dev. docs](https://moorhen-coot.github.io/Moorhen/).
|
|
38
|
+
|
|
39
|
+
## **Binaries**
|
|
40
|
+
|
|
41
|
+
Binaries are available on the releases page. Please read the instructions there before using.
|
|
42
|
+
|
|
43
|
+
## **Compilation instructions**
|
|
44
|
+
|
|
45
|
+
**Requirements**
|
|
46
|
+
|
|
47
|
+
* A Bourne-like shell
|
|
48
|
+
* bzr
|
|
49
|
+
* git
|
|
50
|
+
* curl
|
|
51
|
+
* patch
|
|
52
|
+
* emsdk (Steps 1 and 2 below)
|
|
53
|
+
* cmake
|
|
54
|
+
* A *native* C++ compiler. (This is required for part of the `boost` build system).
|
|
55
|
+
* `autoconf`,`autotools`
|
|
56
|
+
* `libtool`
|
|
57
|
+
|
|
58
|
+
1. Install emscripten (following [https://emscripten.org/docs/getting_started/downloads.html](https://emscripten.org/docs/getting_started/downloads.html)):
|
|
59
|
+
`git clone https://github.com/emscripten-core/emsdk.git`
|
|
60
|
+
`cd emsdk`
|
|
61
|
+
`git pull`
|
|
62
|
+
`./emsdk install latest`
|
|
63
|
+
`./emsdk activate latest`
|
|
64
|
+
|
|
65
|
+
2. Each time you want to use emscripten:
|
|
66
|
+
`source ./emsdk_env.sh`
|
|
67
|
+
|
|
68
|
+
3. Get the sources:
|
|
69
|
+
`git clone https://github.com/moorhen-coot/Moorhen.git`
|
|
70
|
+
`cd Moorhen`
|
|
71
|
+
`./get_sources`
|
|
72
|
+
|
|
73
|
+
5. Build gsl, Boost, RDKIt, Coot, the CCP4 libraries and examples:
|
|
74
|
+
<br>In this branch, it is intended that you do the build in the source directory.
|
|
75
|
+
<br/>After first checkout you should run the following script to build:
|
|
76
|
+
`./initial_build.sh`
|
|
77
|
+
This should build all dependencies and then `Moorhen`.
|
|
78
|
+
|
|
79
|
+
6. To run the Moorhen molecular graphics application:
|
|
80
|
+
`cd baby-gru`
|
|
81
|
+
`npm start`
|
|
82
|
+
And then point a web browser at `http://localhost:3000/` .
|
|
83
|
+
|
|
84
|
+
## **Updating**
|
|
85
|
+
|
|
86
|
+
1. When you wish to update the application from this git repository and the `Coot` git repository, do the following steps:
|
|
87
|
+
1. `git pull`
|
|
88
|
+
2. `cd checkout/coot-1.0`
|
|
89
|
+
3. `git pull`
|
|
90
|
+
4. `cd ../..`
|
|
91
|
+
5. `cd CCP4_WASM_BUILD/moorhen_build`
|
|
92
|
+
6. `make install` (or e.g. `make -j8 install` to build on 8 processors).
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
*The Moorhen WebGL application*
|
|
96
|
+
|
|
97
|
+
## **What else can do with the compiled libraries?**
|
|
98
|
+
|
|
99
|
+
See `example/example.cc` or `checkout/privateer-MKIV/src/privateer.cpp` to see how to create a command line (node) program. The
|
|
100
|
+
latter is quite long and a patched version of the original privateer code. It might be more helpful to look at the patch file
|
|
101
|
+
`patches/privateer-emscripten.patch`. This should show how to patch an existing command line program which reads files to one
|
|
102
|
+
that will work within node.
|
|
103
|
+
|
|
104
|
+
See `coot/moorhen-wrappers.cc` to see use of `EMSCRIPTEN_BINDINGS` to expose Coot methods to the web browser.
|
|
105
|
+
|
|
106
|
+
Any program you write, which uses the *subset* of Coot, Clipper, Privateer code which this project compiles to WASM, can
|
|
107
|
+
itself be compiled to WASM and used within node or Web Browser. Studying the examples should show you to do I/O, which is
|
|
108
|
+
different in the 2 cases. If you require more classes or methods from the libraries to be exposed to JavaScript, then changes need to be made to
|
|
109
|
+
`coot/moorhen-wrappers.cc`. This should only be necessary for browser usage - in node your whole program can be written in C++.
|
|
110
|
+
|
|
111
|
+
## **References**
|
|
112
|
+
|
|
113
|
+
* Emscripten
|
|
114
|
+
* [https://emscripten.org/](https://emscripten.org/)
|
|
115
|
+
* [Emscripten: An LLVM-to-JavaScript Compiler](https://github.com/emscripten-core/emscripten/blob/main/docs/paper.pdf)
|
|
116
|
+
* Coot
|
|
117
|
+
* P. Emsley; B. Lohkamp; W.G. Scott; Cowtan (2010). *Features and Development of Coot*, Acta Crystallographica. **D66 (4)** p486–501.
|
|
118
|
+
* Privateer
|
|
119
|
+
* Agirre, J., Iglesias-Fernández, J., Rovira, C., Davies, G.J., Wilson, K.S. and Cowtan, K.D., (2015), *Privateer: software for the conformational validation of carbohydrate structures*, Nature Structural and Molecular Biology **22(11)**, p.833.
|
|
120
|
+
* Bagdonas, H., Ungar, D. and Agirre, J., (2020), *Leveraging glycomics data in glycoprotein 3D structure validation with Privateer*, Beilstein Journal of Organic Chemistry, **16(1)**, p2523-2533.
|
|
121
|
+
* Clipper
|
|
122
|
+
* Cowtan K (2003), *The Clipper C++ libraries for X‐ray crystallography*, IUCr Comput Comm Newslett **2**, p4–9
|
|
123
|
+
* CCP4
|
|
124
|
+
* Winn MD, Ballard CC, Cowtan KD, Dodson EJ, Emsley P, Evans PR, Keegan RM, Krissinel EB, Leslie AGW, McCoy A, McNicholas SJ, Murshudov GN, Pannu NS, Potterton EA, Powell HR, Read RJ, Vagin A, Wilson KS (2011), *Overview of the CCP4 suite and current developments*, Acta Cryst **D67**, p235–242.
|
|
125
|
+
* Gemmi
|
|
126
|
+
* [https://github.com/project-gemmi/gemmi](https://github.com/project-gemmi/gemmi)
|
|
127
|
+
* Gesamt
|
|
128
|
+
* Krissinel E. (2012), *Enhanced fold recognition using efficient short fragment clustering*, Journal of molecular biochemistry, **1(2)**, p76–85.
|
|
129
|
+
* ProSMART
|
|
130
|
+
* R.A. Nicholls, M. Fischer, S. McNicholas and G.N. Murshudov (2014) *Conformation-Independent Structural Comparison of Macromolecules with ProSMART.* Acta Cryst. **D70**, p2487-2499.
|
|
131
|
+
* GSL
|
|
132
|
+
* M. Galassi et al, GNU Scientific Library Reference Manual (3rd Ed.), ISBN 0954612078
|
|
133
|
+
* https://www.gnu.org/software/gsl/
|
|
134
|
+
* FFTW
|
|
135
|
+
* Frigo, Matteo and Johnson, Steven G. (2005), *The Design and Implementation of FFTW3*, Proceedings of the IEEE **93(2)**, p216-231.
|
|
136
|
+
* RDKit
|
|
137
|
+
* RDKit: Open-source cheminformatics [https://www.rdkit.org](https://www.rdkit.org)
|
|
138
|
+
* Boost
|
|
139
|
+
* Boost C++ libraries [https://www.boost.org/users/license.html](https://www.boost.org/users/license.html)
|
|
140
|
+
* GLM
|
|
141
|
+
* Open GL Mathematics [https://github.com/g-truc/glm](https://github.com/g-truc/glm)
|
|
2
142
|
|
|
3
|
-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
4
|
-
|
|
5
|
-
## Available Scripts
|
|
6
|
-
|
|
7
|
-
In the project directory, you can run:
|
|
8
|
-
|
|
9
|
-
### `npm start`
|
|
10
|
-
|
|
11
|
-
Runs the app in the development mode.\
|
|
12
|
-
Open [http://localhost:5173](http://localhost:5173) to view it in your browser.
|
|
13
|
-
|
|
14
|
-
The page will reload when you make changes.\
|
|
15
|
-
You may also see any lint errors in the console.
|
|
16
|
-
|
|
17
|
-
### `npm test`
|
|
18
|
-
|
|
19
|
-
Launches the test runner in the interactive watch mode.\
|
|
20
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
21
|
-
|
|
22
|
-
### `npm run build`
|
|
23
|
-
|
|
24
|
-
Builds the app for production to the `build` folder.\
|
|
25
|
-
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
26
|
-
|
|
27
|
-
The build is minified and the filenames include the hashes.\
|
|
28
|
-
Your app is ready to be deployed!
|
|
29
|
-
|
|
30
|
-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
31
|
-
|
|
32
|
-
### `npm run eject`
|
|
33
|
-
|
|
34
|
-
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
|
|
35
|
-
|
|
36
|
-
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
|
37
|
-
|
|
38
|
-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
|
|
39
|
-
|
|
40
|
-
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
|
|
41
|
-
|
|
42
|
-
## Learn More
|
|
43
|
-
|
|
44
|
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
45
|
-
|
|
46
|
-
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
47
|
-
|
|
48
|
-
### Code Splitting
|
|
49
|
-
|
|
50
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
|
51
|
-
|
|
52
|
-
### Analyzing the Bundle Size
|
|
53
|
-
|
|
54
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
|
55
|
-
|
|
56
|
-
### Making a Progressive Web App
|
|
57
|
-
|
|
58
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
|
59
|
-
|
|
60
|
-
### Advanced Configuration
|
|
61
|
-
|
|
62
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
|
63
|
-
|
|
64
|
-
### Deployment
|
|
65
|
-
|
|
66
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
|
67
|
-
|
|
68
|
-
### `npm run build` fails to minify
|
|
69
|
-
|
|
70
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
package/baby-gru/CootWorker.ts
CHANGED
|
@@ -423,7 +423,7 @@ const symmetryToJSData = (symmetryDataPair: libcootApi.PairType<libcootApi.Symme
|
|
|
423
423
|
return result
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
const mmrrccStatsToJSArray = (mmrrccStats: libcootApi.PairType<emscriptem.map<libcootApi.DensityCorrelationStatsInfoT, libcootApi.ResidueSpecT>, emscriptem.map<libcootApi.DensityCorrelationStatsInfoT, libcootApi.ResidueSpecT>>) => {
|
|
426
|
+
const mmrrccStatsToJSArray = (mmrrccStats: libcootApi.PairType<emscriptem.map<libcootApi.DensityCorrelationStatsInfoT, libcootApi.ResidueSpecT>, emscriptem.map<libcootApi.DensityCorrelationStatsInfoT, libcootApi.ResidueSpecT>>): libcootApi.MMRCCStatsJS => {
|
|
427
427
|
const parseStats = (stats: emscriptem.map<libcootApi.DensityCorrelationStatsInfoT, libcootApi.ResidueSpecT>) => {
|
|
428
428
|
let result: {resNum: number; insCode: string; modelNumber: number; chainId: string; n: number; correlation: number; }[] = []
|
|
429
429
|
const residueSpecs = stats.keys()
|