moorhen 0.0.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.
Files changed (43) hide show
  1. package/README.md +142 -0
  2. package/baby-gru/CootWorker.js +1 -1071
  3. package/baby-gru/CootWorker.ts +1064 -0
  4. package/baby-gru/monomers/h/HIS.cif +5 -5
  5. package/baby-gru/moorhen.css +280 -0
  6. package/baby-gru/pixmaps/{map.svg → map-grey.svg} +38 -28
  7. package/baby-gru/pixmaps/moorhen-ligand.svg +213 -0
  8. package/baby-gru/pixmaps/secondary-structure-grey.svg +158 -0
  9. package/baby-gru/wasm/RDKit_minimal.js +1 -21
  10. package/baby-gru/wasm/RDKit_minimal.wasm +0 -0
  11. package/baby-gru/wasm/cif_pdb_worker.js +1 -33
  12. package/baby-gru/wasm/coot_env_web.js +1 -5
  13. package/baby-gru/wasm/crystallography_worker.js +1 -610
  14. package/baby-gru/wasm/mini_rsr_worker.js +1 -72
  15. package/baby-gru/wasm/monid_to_pdb_worker.js +1 -253
  16. package/baby-gru/wasm/moorhen.data +2580 -739
  17. package/baby-gru/wasm/moorhen.js +1 -21
  18. package/baby-gru/wasm/moorhen.wasm +0 -0
  19. package/baby-gru/wasm/moorhen.worker.js +1 -1
  20. package/baby-gru/wasm/mtz_arraybuffer_worker.js +1 -59
  21. package/baby-gru/wasm/mtz_worker.js +1 -45
  22. package/baby-gru/wasm/nma_worker.js +1 -103
  23. package/baby-gru/wasm/papaparse.min.js +2 -7
  24. package/baby-gru/wasm/papaparse.min.js.LICENSE.txt +6 -0
  25. package/baby-gru/wasm/pdb_worker.js +1 -282
  26. package/baby-gru/wasm/smiles_to_pdb_worker.js +1 -252
  27. package/baby-gru/wasm/superpose_worker.js +1 -144
  28. package/baby-gru/wasm/web_example.js +1 -21
  29. package/baby-gru/wasm/web_example.wasm +0 -0
  30. package/moorhen.css +1 -276
  31. package/moorhen.js +86 -0
  32. package/moorhen.js.LICENSE.txt +101 -0
  33. package/package.json +72 -51
  34. package/types/emscriptem.d.ts +25 -0
  35. package/types/gemmi.d.ts +115 -0
  36. package/types/index.d.ts +18 -0
  37. package/types/libcoot.d.ts +450 -0
  38. package/types/main.d.ts +428 -0
  39. package/types/mgWebGL.d.ts +398 -0
  40. package/types/moorhen.d.ts +815 -0
  41. package/baby-gru/pixmaps/diff-map.png +0 -0
  42. package/baby-gru/tutorials/legend.html +0 -3
  43. /package/baby-gru/{keyboard-blank.svg → pixmaps/keyboard-blank.svg} +0 -0
package/README.md ADDED
@@ -0,0 +1,142 @@
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
+ ![Moorhen](web_example/baby_gru.png)
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)
142
+