@kent-tokyo/chematic 1.2.8 → 1.2.9
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/chematic_wasm.d.ts +108 -0
- package/chematic_wasm.js +393 -0
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/chematic_wasm.d.ts
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A molecule with properties, conformers, S-groups and source indices that
|
|
6
|
+
* survive every graph edit (including identity renumbering, where RDKit
|
|
7
|
+
* drops molecule properties and S-groups).
|
|
8
|
+
*/
|
|
9
|
+
export class AnnotatedMolHandle {
|
|
10
|
+
free(): void;
|
|
11
|
+
[Symbol.dispose](): void;
|
|
12
|
+
/**
|
|
13
|
+
* Add a conformer from flat `[x0, y0, z0, x1, ...]` coordinates.
|
|
14
|
+
* Returns its index.
|
|
15
|
+
*/
|
|
16
|
+
add_conformer(xyz: Float64Array | number[], is_3d: boolean): number;
|
|
17
|
+
/**
|
|
18
|
+
* Add an S-group from `{"kind", "atoms", "bonds", "parent", "fields"}`
|
|
19
|
+
* (`fields` is `[[key, value], ...]`; a parent must be an earlier
|
|
20
|
+
* S-group). Returns its index.
|
|
21
|
+
*/
|
|
22
|
+
add_sgroup_json(sgroup: string): number;
|
|
23
|
+
atom_count(): number;
|
|
24
|
+
atom_properties_json(idx: number): string;
|
|
25
|
+
bond_count(): number;
|
|
26
|
+
bond_properties_json(idx: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Conformers as `[{"is_3d": bool, "points": [[x, y, z], ...]}, ...]`.
|
|
29
|
+
*/
|
|
30
|
+
conformers_json(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Induced sub-graph on `atoms`, in that order.
|
|
33
|
+
*/
|
|
34
|
+
extract_atoms(atoms: Uint32Array | number[]): AnnotatedMolHandle;
|
|
35
|
+
/**
|
|
36
|
+
* Append `other` as a disjoint fragment. `last_edit_json()` maps
|
|
37
|
+
* `other`'s indices.
|
|
38
|
+
*/
|
|
39
|
+
insert_molecule(other: AnnotatedMolHandle): AnnotatedMolHandle;
|
|
40
|
+
/**
|
|
41
|
+
* Index maps of the edit that produced this handle:
|
|
42
|
+
* `{"atom_map": [new | null, ...], "bond_map": [...], "dropped_sgroups": [...]}`,
|
|
43
|
+
* or `null` for a handle not produced by an edit.
|
|
44
|
+
*/
|
|
45
|
+
last_edit_json(): string;
|
|
46
|
+
/**
|
|
47
|
+
* The graph as an ordinary molecule handle.
|
|
48
|
+
*/
|
|
49
|
+
molecule(): MolHandle;
|
|
50
|
+
/**
|
|
51
|
+
* Wrap a molecule. Every atom and bond gets the source `[input, index]`.
|
|
52
|
+
*/
|
|
53
|
+
constructor(mol: MolHandle, input: number);
|
|
54
|
+
/**
|
|
55
|
+
* Molecule properties as `[[key, value], ...]` in insertion order.
|
|
56
|
+
*/
|
|
57
|
+
properties_json(): string;
|
|
58
|
+
property(key: string): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Remove atoms and the bonds touching them.
|
|
61
|
+
*/
|
|
62
|
+
remove_atoms(atoms: Uint32Array | number[]): AnnotatedMolHandle;
|
|
63
|
+
/**
|
|
64
|
+
* Remove bonds; atoms are untouched.
|
|
65
|
+
*/
|
|
66
|
+
remove_bonds(bonds: Uint32Array | number[]): AnnotatedMolHandle;
|
|
67
|
+
/**
|
|
68
|
+
* Reorder atoms with `order[new] = old`.
|
|
69
|
+
*/
|
|
70
|
+
renumber_atoms(order: Uint32Array | number[]): AnnotatedMolHandle;
|
|
71
|
+
/**
|
|
72
|
+
* Change atom `idx`'s element, keeping its index and every annotation.
|
|
73
|
+
*/
|
|
74
|
+
replace_atom_element(idx: number, symbol: string): AnnotatedMolHandle;
|
|
75
|
+
set_atom_property(idx: number, key: string, value: string): void;
|
|
76
|
+
set_bond_property(idx: number, key: string, value: string): void;
|
|
77
|
+
set_property(key: string, value: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* S-groups in the same shape `add_sgroup_json` accepts.
|
|
80
|
+
*/
|
|
81
|
+
sgroups_json(): string;
|
|
82
|
+
/**
|
|
83
|
+
* `{"atoms": [[input, index] | null, ...], "bonds": [...]}`.
|
|
84
|
+
*/
|
|
85
|
+
sources_json(): string;
|
|
86
|
+
}
|
|
87
|
+
|
|
4
88
|
/**
|
|
5
89
|
* A conformer ensemble: one molecule geometry with multiple 3D coordinate sets.
|
|
6
90
|
*
|
|
@@ -3852,6 +3936,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
3852
3936
|
|
|
3853
3937
|
export interface InitOutput {
|
|
3854
3938
|
readonly memory: WebAssembly.Memory;
|
|
3939
|
+
readonly __wbg_annotatedmolhandle_free: (a: number, b: number) => void;
|
|
3855
3940
|
readonly __wbg_conformerhandle_free: (a: number, b: number) => void;
|
|
3856
3941
|
readonly __wbg_depictoptions_free: (a: number, b: number) => void;
|
|
3857
3942
|
readonly __wbg_mhfplshhandle_free: (a: number, b: number) => void;
|
|
@@ -3863,6 +3948,29 @@ export interface InitOutput {
|
|
|
3863
3948
|
readonly __wbg_tetrahedralcleanupresult_free: (a: number, b: number) => void;
|
|
3864
3949
|
readonly add_hydrogens: (a: number) => number;
|
|
3865
3950
|
readonly admet_profile_json: (a: number, b: number) => [number, number];
|
|
3951
|
+
readonly annotatedmolhandle_add_conformer: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
3952
|
+
readonly annotatedmolhandle_add_sgroup_json: (a: number, b: number, c: number) => [number, number, number];
|
|
3953
|
+
readonly annotatedmolhandle_atom_count: (a: number) => number;
|
|
3954
|
+
readonly annotatedmolhandle_atom_properties_json: (a: number, b: number) => [number, number, number, number];
|
|
3955
|
+
readonly annotatedmolhandle_bond_count: (a: number) => number;
|
|
3956
|
+
readonly annotatedmolhandle_bond_properties_json: (a: number, b: number) => [number, number, number, number];
|
|
3957
|
+
readonly annotatedmolhandle_conformers_json: (a: number) => [number, number];
|
|
3958
|
+
readonly annotatedmolhandle_extract_atoms: (a: number, b: number, c: number) => [number, number, number];
|
|
3959
|
+
readonly annotatedmolhandle_insert_molecule: (a: number, b: number) => [number, number, number];
|
|
3960
|
+
readonly annotatedmolhandle_last_edit_json: (a: number) => [number, number];
|
|
3961
|
+
readonly annotatedmolhandle_molecule: (a: number) => number;
|
|
3962
|
+
readonly annotatedmolhandle_new: (a: number, b: number) => number;
|
|
3963
|
+
readonly annotatedmolhandle_properties_json: (a: number) => [number, number];
|
|
3964
|
+
readonly annotatedmolhandle_property: (a: number, b: number, c: number) => [number, number];
|
|
3965
|
+
readonly annotatedmolhandle_remove_atoms: (a: number, b: number, c: number) => [number, number, number];
|
|
3966
|
+
readonly annotatedmolhandle_remove_bonds: (a: number, b: number, c: number) => [number, number, number];
|
|
3967
|
+
readonly annotatedmolhandle_renumber_atoms: (a: number, b: number, c: number) => [number, number, number];
|
|
3968
|
+
readonly annotatedmolhandle_replace_atom_element: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
3969
|
+
readonly annotatedmolhandle_set_atom_property: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
3970
|
+
readonly annotatedmolhandle_set_bond_property: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
3971
|
+
readonly annotatedmolhandle_set_property: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3972
|
+
readonly annotatedmolhandle_sgroups_json: (a: number) => [number, number];
|
|
3973
|
+
readonly annotatedmolhandle_sources_json: (a: number) => [number, number];
|
|
3866
3974
|
readonly atom_pair_bitvec: (a: number) => [number, number];
|
|
3867
3975
|
readonly autocorr_2d_json: (a: number) => [number, number];
|
|
3868
3976
|
readonly autocorr_3d_json: (a: number) => [number, number];
|
package/chematic_wasm.js
CHANGED
|
@@ -1,5 +1,388 @@
|
|
|
1
1
|
/* @ts-self-types="./chematic_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A molecule with properties, conformers, S-groups and source indices that
|
|
5
|
+
* survive every graph edit (including identity renumbering, where RDKit
|
|
6
|
+
* drops molecule properties and S-groups).
|
|
7
|
+
*/
|
|
8
|
+
export class AnnotatedMolHandle {
|
|
9
|
+
static __wrap(ptr) {
|
|
10
|
+
const obj = Object.create(AnnotatedMolHandle.prototype);
|
|
11
|
+
obj.__wbg_ptr = ptr;
|
|
12
|
+
AnnotatedMolHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
__destroy_into_raw() {
|
|
16
|
+
const ptr = this.__wbg_ptr;
|
|
17
|
+
this.__wbg_ptr = 0;
|
|
18
|
+
AnnotatedMolHandleFinalization.unregister(this);
|
|
19
|
+
return ptr;
|
|
20
|
+
}
|
|
21
|
+
free() {
|
|
22
|
+
const ptr = this.__destroy_into_raw();
|
|
23
|
+
wasm.__wbg_annotatedmolhandle_free(ptr, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add a conformer from flat `[x0, y0, z0, x1, ...]` coordinates.
|
|
27
|
+
* Returns its index.
|
|
28
|
+
* @param {Float64Array | number[]} xyz
|
|
29
|
+
* @param {boolean} is_3d
|
|
30
|
+
* @returns {number}
|
|
31
|
+
*/
|
|
32
|
+
add_conformer(xyz, is_3d) {
|
|
33
|
+
const val2 = +is_3d;
|
|
34
|
+
const ptr0 = passArrayF64ToWasm0(xyz, wasm.__wbindgen_malloc);
|
|
35
|
+
const len0 = WASM_VECTOR_LEN;
|
|
36
|
+
const ret = wasm.annotatedmolhandle_add_conformer(this.__wbg_ptr, ptr0, len0, val2);
|
|
37
|
+
if (ret[2]) {
|
|
38
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
39
|
+
}
|
|
40
|
+
return ret[0] >>> 0;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Add an S-group from `{"kind", "atoms", "bonds", "parent", "fields"}`
|
|
44
|
+
* (`fields` is `[[key, value], ...]`; a parent must be an earlier
|
|
45
|
+
* S-group). Returns its index.
|
|
46
|
+
* @param {string} sgroup
|
|
47
|
+
* @returns {number}
|
|
48
|
+
*/
|
|
49
|
+
add_sgroup_json(sgroup) {
|
|
50
|
+
const ptr0 = passStringToWasm0(sgroup, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
51
|
+
const len0 = WASM_VECTOR_LEN;
|
|
52
|
+
const ret = wasm.annotatedmolhandle_add_sgroup_json(this.__wbg_ptr, ptr0, len0);
|
|
53
|
+
if (ret[2]) {
|
|
54
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
55
|
+
}
|
|
56
|
+
return ret[0] >>> 0;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @returns {number}
|
|
60
|
+
*/
|
|
61
|
+
atom_count() {
|
|
62
|
+
const ret = wasm.annotatedmolhandle_atom_count(this.__wbg_ptr);
|
|
63
|
+
return ret >>> 0;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param {number} idx
|
|
67
|
+
* @returns {string}
|
|
68
|
+
*/
|
|
69
|
+
atom_properties_json(idx) {
|
|
70
|
+
let deferred2_0;
|
|
71
|
+
let deferred2_1;
|
|
72
|
+
try {
|
|
73
|
+
const ret = wasm.annotatedmolhandle_atom_properties_json(this.__wbg_ptr, idx);
|
|
74
|
+
var ptr1 = ret[0];
|
|
75
|
+
var len1 = ret[1];
|
|
76
|
+
if (ret[3]) {
|
|
77
|
+
ptr1 = 0; len1 = 0;
|
|
78
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
79
|
+
}
|
|
80
|
+
deferred2_0 = ptr1;
|
|
81
|
+
deferred2_1 = len1;
|
|
82
|
+
return getStringFromWasm0(ptr1, len1);
|
|
83
|
+
} finally {
|
|
84
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @returns {number}
|
|
89
|
+
*/
|
|
90
|
+
bond_count() {
|
|
91
|
+
const ret = wasm.annotatedmolhandle_bond_count(this.__wbg_ptr);
|
|
92
|
+
return ret >>> 0;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @param {number} idx
|
|
96
|
+
* @returns {string}
|
|
97
|
+
*/
|
|
98
|
+
bond_properties_json(idx) {
|
|
99
|
+
let deferred2_0;
|
|
100
|
+
let deferred2_1;
|
|
101
|
+
try {
|
|
102
|
+
const ret = wasm.annotatedmolhandle_bond_properties_json(this.__wbg_ptr, idx);
|
|
103
|
+
var ptr1 = ret[0];
|
|
104
|
+
var len1 = ret[1];
|
|
105
|
+
if (ret[3]) {
|
|
106
|
+
ptr1 = 0; len1 = 0;
|
|
107
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
108
|
+
}
|
|
109
|
+
deferred2_0 = ptr1;
|
|
110
|
+
deferred2_1 = len1;
|
|
111
|
+
return getStringFromWasm0(ptr1, len1);
|
|
112
|
+
} finally {
|
|
113
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Conformers as `[{"is_3d": bool, "points": [[x, y, z], ...]}, ...]`.
|
|
118
|
+
* @returns {string}
|
|
119
|
+
*/
|
|
120
|
+
conformers_json() {
|
|
121
|
+
let deferred1_0;
|
|
122
|
+
let deferred1_1;
|
|
123
|
+
try {
|
|
124
|
+
const ret = wasm.annotatedmolhandle_conformers_json(this.__wbg_ptr);
|
|
125
|
+
deferred1_0 = ret[0];
|
|
126
|
+
deferred1_1 = ret[1];
|
|
127
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
128
|
+
} finally {
|
|
129
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Induced sub-graph on `atoms`, in that order.
|
|
134
|
+
* @param {Uint32Array | number[]} atoms
|
|
135
|
+
* @returns {AnnotatedMolHandle}
|
|
136
|
+
*/
|
|
137
|
+
extract_atoms(atoms) {
|
|
138
|
+
const ptr0 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
|
|
139
|
+
const len0 = WASM_VECTOR_LEN;
|
|
140
|
+
const ret = wasm.annotatedmolhandle_extract_atoms(this.__wbg_ptr, ptr0, len0);
|
|
141
|
+
if (ret[2]) {
|
|
142
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
143
|
+
}
|
|
144
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Append `other` as a disjoint fragment. `last_edit_json()` maps
|
|
148
|
+
* `other`'s indices.
|
|
149
|
+
* @param {AnnotatedMolHandle} other
|
|
150
|
+
* @returns {AnnotatedMolHandle}
|
|
151
|
+
*/
|
|
152
|
+
insert_molecule(other) {
|
|
153
|
+
_assertClass(other, AnnotatedMolHandle);
|
|
154
|
+
const ret = wasm.annotatedmolhandle_insert_molecule(this.__wbg_ptr, other.__wbg_ptr);
|
|
155
|
+
if (ret[2]) {
|
|
156
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
157
|
+
}
|
|
158
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Index maps of the edit that produced this handle:
|
|
162
|
+
* `{"atom_map": [new | null, ...], "bond_map": [...], "dropped_sgroups": [...]}`,
|
|
163
|
+
* or `null` for a handle not produced by an edit.
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
166
|
+
last_edit_json() {
|
|
167
|
+
let deferred1_0;
|
|
168
|
+
let deferred1_1;
|
|
169
|
+
try {
|
|
170
|
+
const ret = wasm.annotatedmolhandle_last_edit_json(this.__wbg_ptr);
|
|
171
|
+
deferred1_0 = ret[0];
|
|
172
|
+
deferred1_1 = ret[1];
|
|
173
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
174
|
+
} finally {
|
|
175
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The graph as an ordinary molecule handle.
|
|
180
|
+
* @returns {MolHandle}
|
|
181
|
+
*/
|
|
182
|
+
molecule() {
|
|
183
|
+
const ret = wasm.annotatedmolhandle_molecule(this.__wbg_ptr);
|
|
184
|
+
return MolHandle.__wrap(ret);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Wrap a molecule. Every atom and bond gets the source `[input, index]`.
|
|
188
|
+
* @param {MolHandle} mol
|
|
189
|
+
* @param {number} input
|
|
190
|
+
*/
|
|
191
|
+
constructor(mol, input) {
|
|
192
|
+
_assertClass(mol, MolHandle);
|
|
193
|
+
const ret = wasm.annotatedmolhandle_new(mol.__wbg_ptr, input);
|
|
194
|
+
this.__wbg_ptr = ret;
|
|
195
|
+
AnnotatedMolHandleFinalization.register(this, this.__wbg_ptr, this);
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Molecule properties as `[[key, value], ...]` in insertion order.
|
|
200
|
+
* @returns {string}
|
|
201
|
+
*/
|
|
202
|
+
properties_json() {
|
|
203
|
+
let deferred1_0;
|
|
204
|
+
let deferred1_1;
|
|
205
|
+
try {
|
|
206
|
+
const ret = wasm.annotatedmolhandle_properties_json(this.__wbg_ptr);
|
|
207
|
+
deferred1_0 = ret[0];
|
|
208
|
+
deferred1_1 = ret[1];
|
|
209
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
210
|
+
} finally {
|
|
211
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @param {string} key
|
|
216
|
+
* @returns {string | undefined}
|
|
217
|
+
*/
|
|
218
|
+
property(key) {
|
|
219
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ret = wasm.annotatedmolhandle_property(this.__wbg_ptr, ptr0, len0);
|
|
222
|
+
let v2;
|
|
223
|
+
if (ret[0] !== 0) {
|
|
224
|
+
v2 = getStringFromWasm0(ret[0], ret[1]);
|
|
225
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
226
|
+
}
|
|
227
|
+
return v2;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Remove atoms and the bonds touching them.
|
|
231
|
+
* @param {Uint32Array | number[]} atoms
|
|
232
|
+
* @returns {AnnotatedMolHandle}
|
|
233
|
+
*/
|
|
234
|
+
remove_atoms(atoms) {
|
|
235
|
+
const ptr0 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
|
|
236
|
+
const len0 = WASM_VECTOR_LEN;
|
|
237
|
+
const ret = wasm.annotatedmolhandle_remove_atoms(this.__wbg_ptr, ptr0, len0);
|
|
238
|
+
if (ret[2]) {
|
|
239
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
240
|
+
}
|
|
241
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Remove bonds; atoms are untouched.
|
|
245
|
+
* @param {Uint32Array | number[]} bonds
|
|
246
|
+
* @returns {AnnotatedMolHandle}
|
|
247
|
+
*/
|
|
248
|
+
remove_bonds(bonds) {
|
|
249
|
+
const ptr0 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ret = wasm.annotatedmolhandle_remove_bonds(this.__wbg_ptr, ptr0, len0);
|
|
252
|
+
if (ret[2]) {
|
|
253
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
254
|
+
}
|
|
255
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Reorder atoms with `order[new] = old`.
|
|
259
|
+
* @param {Uint32Array | number[]} order
|
|
260
|
+
* @returns {AnnotatedMolHandle}
|
|
261
|
+
*/
|
|
262
|
+
renumber_atoms(order) {
|
|
263
|
+
const ptr0 = passArray32ToWasm0(order, wasm.__wbindgen_malloc);
|
|
264
|
+
const len0 = WASM_VECTOR_LEN;
|
|
265
|
+
const ret = wasm.annotatedmolhandle_renumber_atoms(this.__wbg_ptr, ptr0, len0);
|
|
266
|
+
if (ret[2]) {
|
|
267
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
268
|
+
}
|
|
269
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Change atom `idx`'s element, keeping its index and every annotation.
|
|
273
|
+
* @param {number} idx
|
|
274
|
+
* @param {string} symbol
|
|
275
|
+
* @returns {AnnotatedMolHandle}
|
|
276
|
+
*/
|
|
277
|
+
replace_atom_element(idx, symbol) {
|
|
278
|
+
const val2 = +idx;
|
|
279
|
+
const ptr0 = passStringToWasm0(symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
281
|
+
const ret = wasm.annotatedmolhandle_replace_atom_element(this.__wbg_ptr, val2, ptr0, len0);
|
|
282
|
+
if (ret[2]) {
|
|
283
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
284
|
+
}
|
|
285
|
+
return AnnotatedMolHandle.__wrap(ret[0]);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* @param {number} idx
|
|
289
|
+
* @param {string} key
|
|
290
|
+
* @param {string} value
|
|
291
|
+
*/
|
|
292
|
+
set_atom_property(idx, key, value) {
|
|
293
|
+
const val3 = +idx;
|
|
294
|
+
let ptr0, len0, ptr1, len1;
|
|
295
|
+
try {
|
|
296
|
+
ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
|
+
len0 = WASM_VECTOR_LEN;
|
|
298
|
+
ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
299
|
+
len1 = WASM_VECTOR_LEN;
|
|
300
|
+
} catch (e) {
|
|
301
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
302
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
303
|
+
throw e;
|
|
304
|
+
}
|
|
305
|
+
const ret = wasm.annotatedmolhandle_set_atom_property(this.__wbg_ptr, val3, ptr0, len0, ptr1, len1);
|
|
306
|
+
if (ret[1]) {
|
|
307
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* @param {number} idx
|
|
312
|
+
* @param {string} key
|
|
313
|
+
* @param {string} value
|
|
314
|
+
*/
|
|
315
|
+
set_bond_property(idx, key, value) {
|
|
316
|
+
const val3 = +idx;
|
|
317
|
+
let ptr0, len0, ptr1, len1;
|
|
318
|
+
try {
|
|
319
|
+
ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
320
|
+
len0 = WASM_VECTOR_LEN;
|
|
321
|
+
ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
|
+
len1 = WASM_VECTOR_LEN;
|
|
323
|
+
} catch (e) {
|
|
324
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
325
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
326
|
+
throw e;
|
|
327
|
+
}
|
|
328
|
+
const ret = wasm.annotatedmolhandle_set_bond_property(this.__wbg_ptr, val3, ptr0, len0, ptr1, len1);
|
|
329
|
+
if (ret[1]) {
|
|
330
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @param {string} key
|
|
335
|
+
* @param {string} value
|
|
336
|
+
*/
|
|
337
|
+
set_property(key, value) {
|
|
338
|
+
let ptr0, len0, ptr1, len1;
|
|
339
|
+
try {
|
|
340
|
+
ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
341
|
+
len0 = WASM_VECTOR_LEN;
|
|
342
|
+
ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
len1 = WASM_VECTOR_LEN;
|
|
344
|
+
} catch (e) {
|
|
345
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
346
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
347
|
+
throw e;
|
|
348
|
+
}
|
|
349
|
+
wasm.annotatedmolhandle_set_property(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* S-groups in the same shape `add_sgroup_json` accepts.
|
|
353
|
+
* @returns {string}
|
|
354
|
+
*/
|
|
355
|
+
sgroups_json() {
|
|
356
|
+
let deferred1_0;
|
|
357
|
+
let deferred1_1;
|
|
358
|
+
try {
|
|
359
|
+
const ret = wasm.annotatedmolhandle_sgroups_json(this.__wbg_ptr);
|
|
360
|
+
deferred1_0 = ret[0];
|
|
361
|
+
deferred1_1 = ret[1];
|
|
362
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
363
|
+
} finally {
|
|
364
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* `{"atoms": [[input, index] | null, ...], "bonds": [...]}`.
|
|
369
|
+
* @returns {string}
|
|
370
|
+
*/
|
|
371
|
+
sources_json() {
|
|
372
|
+
let deferred1_0;
|
|
373
|
+
let deferred1_1;
|
|
374
|
+
try {
|
|
375
|
+
const ret = wasm.annotatedmolhandle_sources_json(this.__wbg_ptr);
|
|
376
|
+
deferred1_0 = ret[0];
|
|
377
|
+
deferred1_1 = ret[1];
|
|
378
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
379
|
+
} finally {
|
|
380
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (Symbol.dispose) AnnotatedMolHandle.prototype[Symbol.dispose] = AnnotatedMolHandle.prototype.free;
|
|
385
|
+
|
|
3
386
|
/**
|
|
4
387
|
* A conformer ensemble: one molecule geometry with multiple 3D coordinate sets.
|
|
5
388
|
*
|
|
@@ -12059,6 +12442,9 @@ function __wbg_get_imports() {
|
|
|
12059
12442
|
};
|
|
12060
12443
|
}
|
|
12061
12444
|
|
|
12445
|
+
const AnnotatedMolHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
12446
|
+
? { register: () => {}, unregister: () => {} }
|
|
12447
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_annotatedmolhandle_free(ptr, 1));
|
|
12062
12448
|
const ConformerHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
12063
12449
|
? { register: () => {}, unregister: () => {} }
|
|
12064
12450
|
: new FinalizationRegistry(ptr => wasm.__wbg_conformerhandle_free(ptr, 1));
|
|
@@ -12180,6 +12566,13 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
12180
12566
|
return ptr;
|
|
12181
12567
|
}
|
|
12182
12568
|
|
|
12569
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
12570
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
12571
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
12572
|
+
WASM_VECTOR_LEN = arg.length;
|
|
12573
|
+
return ptr;
|
|
12574
|
+
}
|
|
12575
|
+
|
|
12183
12576
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
12184
12577
|
if (realloc === undefined) {
|
|
12185
12578
|
const buf = cachedTextEncoder.encode(arg);
|
package/chematic_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.9",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|