@kent-tokyo/chematic 1.2.0 → 1.2.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 +6 -5
- package/chematic_wasm.d.ts +383 -33
- package/chematic_wasm.js +2562 -709
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/chematic_wasm.js
CHANGED
|
@@ -183,9 +183,10 @@ export class DepictOptions {
|
|
|
183
183
|
* @param {string} color
|
|
184
184
|
*/
|
|
185
185
|
set_atom_color(idx, color) {
|
|
186
|
+
const val2 = +idx;
|
|
186
187
|
const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
187
188
|
const len0 = WASM_VECTOR_LEN;
|
|
188
|
-
wasm.depictoptions_set_atom_color(this.__wbg_ptr,
|
|
189
|
+
wasm.depictoptions_set_atom_color(this.__wbg_ptr, val2, ptr0, len0);
|
|
189
190
|
}
|
|
190
191
|
/**
|
|
191
192
|
* @param {boolean} v
|
|
@@ -214,7 +215,7 @@ export class DepictOptions {
|
|
|
214
215
|
wasm.depictoptions_set_height(this.__wbg_ptr, h);
|
|
215
216
|
}
|
|
216
217
|
/**
|
|
217
|
-
* @param {Uint32Array} atoms
|
|
218
|
+
* @param {Uint32Array | number[]} atoms
|
|
218
219
|
*/
|
|
219
220
|
set_highlight_atoms(atoms) {
|
|
220
221
|
const ptr0 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
|
|
@@ -222,7 +223,7 @@ export class DepictOptions {
|
|
|
222
223
|
wasm.depictoptions_set_highlight_atoms(this.__wbg_ptr, ptr0, len0);
|
|
223
224
|
}
|
|
224
225
|
/**
|
|
225
|
-
* @param {Uint32Array} bonds
|
|
226
|
+
* @param {Uint32Array | number[]} bonds
|
|
226
227
|
*/
|
|
227
228
|
set_highlight_bonds(bonds) {
|
|
228
229
|
const ptr0 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
|
|
@@ -327,23 +328,24 @@ export class MhfpLshHandle {
|
|
|
327
328
|
* @returns {string}
|
|
328
329
|
*/
|
|
329
330
|
query_json(query_smiles, threshold) {
|
|
330
|
-
let
|
|
331
|
-
let
|
|
331
|
+
let deferred4_0;
|
|
332
|
+
let deferred4_1;
|
|
332
333
|
try {
|
|
334
|
+
const val2 = +threshold;
|
|
333
335
|
const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
334
336
|
const len0 = WASM_VECTOR_LEN;
|
|
335
|
-
const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0,
|
|
336
|
-
var
|
|
337
|
-
var
|
|
337
|
+
const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0, val2);
|
|
338
|
+
var ptr3 = ret[0];
|
|
339
|
+
var len3 = ret[1];
|
|
338
340
|
if (ret[3]) {
|
|
339
|
-
|
|
341
|
+
ptr3 = 0; len3 = 0;
|
|
340
342
|
throw takeFromExternrefTable0(ret[2]);
|
|
341
343
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return getStringFromWasm0(
|
|
344
|
+
deferred4_0 = ptr3;
|
|
345
|
+
deferred4_1 = len3;
|
|
346
|
+
return getStringFromWasm0(ptr3, len3);
|
|
345
347
|
} finally {
|
|
346
|
-
wasm.__wbindgen_free(
|
|
348
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
347
349
|
}
|
|
348
350
|
}
|
|
349
351
|
}
|
|
@@ -694,6 +696,23 @@ export class MolHandle {
|
|
|
694
696
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
695
697
|
}
|
|
696
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Total formula with explicit isotope labels, hydrogens and net charge.
|
|
701
|
+
* D/T use [2H]/[3H]; maps/stereo and isotope locations are not encoded.
|
|
702
|
+
* @returns {string}
|
|
703
|
+
*/
|
|
704
|
+
formula_with_isotopes() {
|
|
705
|
+
let deferred1_0;
|
|
706
|
+
let deferred1_1;
|
|
707
|
+
try {
|
|
708
|
+
const ret = wasm.molhandle_formula_with_isotopes(this.__wbg_ptr);
|
|
709
|
+
deferred1_0 = ret[0];
|
|
710
|
+
deferred1_1 = ret[1];
|
|
711
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
712
|
+
} finally {
|
|
713
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
697
716
|
/**
|
|
698
717
|
* Fraction of sp3 carbons (Fsp3).
|
|
699
718
|
* @returns {number}
|
|
@@ -1067,29 +1086,40 @@ export class MolHandle {
|
|
|
1067
1086
|
* @returns {string}
|
|
1068
1087
|
*/
|
|
1069
1088
|
rdkit_align_json(probe_coords_json, reference_coords_json, atom_map_json, weights_json, reflect, max_iterations) {
|
|
1070
|
-
let
|
|
1071
|
-
let
|
|
1089
|
+
let deferred8_0;
|
|
1090
|
+
let deferred8_1;
|
|
1072
1091
|
try {
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1092
|
+
const val5 = +reflect;
|
|
1093
|
+
const val6 = +max_iterations;
|
|
1094
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
1095
|
+
try {
|
|
1096
|
+
ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1097
|
+
len0 = WASM_VECTOR_LEN;
|
|
1098
|
+
ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1099
|
+
len1 = WASM_VECTOR_LEN;
|
|
1100
|
+
ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1101
|
+
len2 = WASM_VECTOR_LEN;
|
|
1102
|
+
ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1103
|
+
len3 = WASM_VECTOR_LEN;
|
|
1104
|
+
} catch (e) {
|
|
1105
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
1106
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
1107
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1108
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1109
|
+
throw e;
|
|
1110
|
+
}
|
|
1111
|
+
const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5, val6);
|
|
1112
|
+
var ptr7 = ret[0];
|
|
1113
|
+
var len7 = ret[1];
|
|
1084
1114
|
if (ret[3]) {
|
|
1085
|
-
|
|
1115
|
+
ptr7 = 0; len7 = 0;
|
|
1086
1116
|
throw takeFromExternrefTable0(ret[2]);
|
|
1087
1117
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
return getStringFromWasm0(
|
|
1118
|
+
deferred8_0 = ptr7;
|
|
1119
|
+
deferred8_1 = len7;
|
|
1120
|
+
return getStringFromWasm0(ptr7, len7);
|
|
1091
1121
|
} finally {
|
|
1092
|
-
wasm.__wbindgen_free(
|
|
1122
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
1093
1123
|
}
|
|
1094
1124
|
}
|
|
1095
1125
|
/**
|
|
@@ -1103,25 +1133,34 @@ export class MolHandle {
|
|
|
1103
1133
|
* @returns {string}
|
|
1104
1134
|
*/
|
|
1105
1135
|
rdkit_all_conformer_best_rms_json(conformers_json, max_matches, symmetrize, weights_json) {
|
|
1106
|
-
let
|
|
1107
|
-
let
|
|
1136
|
+
let deferred6_0;
|
|
1137
|
+
let deferred6_1;
|
|
1108
1138
|
try {
|
|
1109
|
-
const
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1139
|
+
const val3 = +max_matches;
|
|
1140
|
+
const val4 = +symmetrize;
|
|
1141
|
+
let ptr0, len0, ptr1, len1;
|
|
1142
|
+
try {
|
|
1143
|
+
ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1144
|
+
len0 = WASM_VECTOR_LEN;
|
|
1145
|
+
ptr1 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1146
|
+
len1 = WASM_VECTOR_LEN;
|
|
1147
|
+
} catch (e) {
|
|
1148
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1149
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1150
|
+
throw e;
|
|
1151
|
+
}
|
|
1152
|
+
const ret = wasm.molhandle_rdkit_all_conformer_best_rms_json(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1);
|
|
1153
|
+
var ptr5 = ret[0];
|
|
1154
|
+
var len5 = ret[1];
|
|
1116
1155
|
if (ret[3]) {
|
|
1117
|
-
|
|
1156
|
+
ptr5 = 0; len5 = 0;
|
|
1118
1157
|
throw takeFromExternrefTable0(ret[2]);
|
|
1119
1158
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
return getStringFromWasm0(
|
|
1159
|
+
deferred6_0 = ptr5;
|
|
1160
|
+
deferred6_1 = len5;
|
|
1161
|
+
return getStringFromWasm0(ptr5, len5);
|
|
1123
1162
|
} finally {
|
|
1124
|
-
wasm.__wbindgen_free(
|
|
1163
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
1125
1164
|
}
|
|
1126
1165
|
}
|
|
1127
1166
|
/**
|
|
@@ -1137,28 +1176,38 @@ export class MolHandle {
|
|
|
1137
1176
|
* @returns {string}
|
|
1138
1177
|
*/
|
|
1139
1178
|
rdkit_all_conformer_best_rms_to_reference_json(reference, probe_conformers_json, reference_conformers_json, max_matches, symmetrize, weights_json) {
|
|
1140
|
-
let
|
|
1141
|
-
let
|
|
1179
|
+
let deferred7_0;
|
|
1180
|
+
let deferred7_1;
|
|
1142
1181
|
try {
|
|
1143
1182
|
_assertClass(reference, MolHandle);
|
|
1144
|
-
const
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1183
|
+
const val4 = +max_matches;
|
|
1184
|
+
const val5 = +symmetrize;
|
|
1185
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
1186
|
+
try {
|
|
1187
|
+
ptr0 = passStringToWasm0(probe_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1188
|
+
len0 = WASM_VECTOR_LEN;
|
|
1189
|
+
ptr1 = passStringToWasm0(reference_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1190
|
+
len1 = WASM_VECTOR_LEN;
|
|
1191
|
+
ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1192
|
+
len2 = WASM_VECTOR_LEN;
|
|
1193
|
+
} catch (e) {
|
|
1194
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
1195
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1196
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1197
|
+
throw e;
|
|
1198
|
+
}
|
|
1199
|
+
const ret = wasm.molhandle_rdkit_all_conformer_best_rms_to_reference_json(this.__wbg_ptr, reference.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
|
|
1200
|
+
var ptr6 = ret[0];
|
|
1201
|
+
var len6 = ret[1];
|
|
1153
1202
|
if (ret[3]) {
|
|
1154
|
-
|
|
1203
|
+
ptr6 = 0; len6 = 0;
|
|
1155
1204
|
throw takeFromExternrefTable0(ret[2]);
|
|
1156
1205
|
}
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
return getStringFromWasm0(
|
|
1206
|
+
deferred7_0 = ptr6;
|
|
1207
|
+
deferred7_1 = len6;
|
|
1208
|
+
return getStringFromWasm0(ptr6, len6);
|
|
1160
1209
|
} finally {
|
|
1161
|
-
wasm.__wbindgen_free(
|
|
1210
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
1162
1211
|
}
|
|
1163
1212
|
}
|
|
1164
1213
|
/**
|
|
@@ -1171,27 +1220,37 @@ export class MolHandle {
|
|
|
1171
1220
|
* @returns {string}
|
|
1172
1221
|
*/
|
|
1173
1222
|
rdkit_best_alignment_json(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1174
|
-
let
|
|
1175
|
-
let
|
|
1223
|
+
let deferred7_0;
|
|
1224
|
+
let deferred7_1;
|
|
1176
1225
|
try {
|
|
1177
|
-
const
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1226
|
+
const val4 = +max_matches;
|
|
1227
|
+
const val5 = +symmetrize;
|
|
1228
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
1229
|
+
try {
|
|
1230
|
+
ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1231
|
+
len0 = WASM_VECTOR_LEN;
|
|
1232
|
+
ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1233
|
+
len1 = WASM_VECTOR_LEN;
|
|
1234
|
+
ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1235
|
+
len2 = WASM_VECTOR_LEN;
|
|
1236
|
+
} catch (e) {
|
|
1237
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
1238
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1239
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1240
|
+
throw e;
|
|
1241
|
+
}
|
|
1242
|
+
const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
|
|
1243
|
+
var ptr6 = ret[0];
|
|
1244
|
+
var len6 = ret[1];
|
|
1186
1245
|
if (ret[3]) {
|
|
1187
|
-
|
|
1246
|
+
ptr6 = 0; len6 = 0;
|
|
1188
1247
|
throw takeFromExternrefTable0(ret[2]);
|
|
1189
1248
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
return getStringFromWasm0(
|
|
1249
|
+
deferred7_0 = ptr6;
|
|
1250
|
+
deferred7_1 = len6;
|
|
1251
|
+
return getStringFromWasm0(ptr6, len6);
|
|
1193
1252
|
} finally {
|
|
1194
|
-
wasm.__wbindgen_free(
|
|
1253
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
1195
1254
|
}
|
|
1196
1255
|
}
|
|
1197
1256
|
/**
|
|
@@ -1204,13 +1263,23 @@ export class MolHandle {
|
|
|
1204
1263
|
* @returns {number}
|
|
1205
1264
|
*/
|
|
1206
1265
|
rdkit_best_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1207
|
-
const
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1266
|
+
const val4 = +max_matches;
|
|
1267
|
+
const val5 = +symmetrize;
|
|
1268
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
1269
|
+
try {
|
|
1270
|
+
ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1271
|
+
len0 = WASM_VECTOR_LEN;
|
|
1272
|
+
ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1273
|
+
len1 = WASM_VECTOR_LEN;
|
|
1274
|
+
ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1275
|
+
len2 = WASM_VECTOR_LEN;
|
|
1276
|
+
} catch (e) {
|
|
1277
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
1278
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1279
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1280
|
+
throw e;
|
|
1281
|
+
}
|
|
1282
|
+
const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
|
|
1214
1283
|
if (ret[2]) {
|
|
1215
1284
|
throw takeFromExternrefTable0(ret[1]);
|
|
1216
1285
|
}
|
|
@@ -1257,23 +1326,26 @@ export class MolHandle {
|
|
|
1257
1326
|
* @returns {string}
|
|
1258
1327
|
*/
|
|
1259
1328
|
rdkit_bounds_matrix_with_constraints_json(constraints_json, set15bounds, do_triangle_smoothing, use_macrocycle_14_config) {
|
|
1260
|
-
let
|
|
1261
|
-
let
|
|
1329
|
+
let deferred6_0;
|
|
1330
|
+
let deferred6_1;
|
|
1262
1331
|
try {
|
|
1332
|
+
const val2 = +set15bounds;
|
|
1333
|
+
const val3 = +do_triangle_smoothing;
|
|
1334
|
+
const val4 = +use_macrocycle_14_config;
|
|
1263
1335
|
const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1264
1336
|
const len0 = WASM_VECTOR_LEN;
|
|
1265
|
-
const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0,
|
|
1266
|
-
var
|
|
1267
|
-
var
|
|
1337
|
+
const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3, val4);
|
|
1338
|
+
var ptr5 = ret[0];
|
|
1339
|
+
var len5 = ret[1];
|
|
1268
1340
|
if (ret[3]) {
|
|
1269
|
-
|
|
1341
|
+
ptr5 = 0; len5 = 0;
|
|
1270
1342
|
throw takeFromExternrefTable0(ret[2]);
|
|
1271
1343
|
}
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
return getStringFromWasm0(
|
|
1344
|
+
deferred6_0 = ptr5;
|
|
1345
|
+
deferred6_1 = len5;
|
|
1346
|
+
return getStringFromWasm0(ptr5, len5);
|
|
1275
1347
|
} finally {
|
|
1276
|
-
wasm.__wbindgen_free(
|
|
1348
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
1277
1349
|
}
|
|
1278
1350
|
}
|
|
1279
1351
|
/**
|
|
@@ -1286,13 +1358,23 @@ export class MolHandle {
|
|
|
1286
1358
|
* @returns {number}
|
|
1287
1359
|
*/
|
|
1288
1360
|
rdkit_calc_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
|
|
1289
|
-
const
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1361
|
+
const val4 = +max_matches;
|
|
1362
|
+
const val5 = +symmetrize;
|
|
1363
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
1364
|
+
try {
|
|
1365
|
+
ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1366
|
+
len0 = WASM_VECTOR_LEN;
|
|
1367
|
+
ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1368
|
+
len1 = WASM_VECTOR_LEN;
|
|
1369
|
+
ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1370
|
+
len2 = WASM_VECTOR_LEN;
|
|
1371
|
+
} catch (e) {
|
|
1372
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
1373
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
1374
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
1375
|
+
throw e;
|
|
1376
|
+
}
|
|
1377
|
+
const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
|
|
1296
1378
|
if (ret[2]) {
|
|
1297
1379
|
throw takeFromExternrefTable0(ret[1]);
|
|
1298
1380
|
}
|
|
@@ -1351,23 +1433,24 @@ export class MolHandle {
|
|
|
1351
1433
|
* @returns {string}
|
|
1352
1434
|
*/
|
|
1353
1435
|
rdkit_distance_matrix_3d_checked_json(coords_json, use_atom_wts) {
|
|
1354
|
-
let
|
|
1355
|
-
let
|
|
1436
|
+
let deferred4_0;
|
|
1437
|
+
let deferred4_1;
|
|
1356
1438
|
try {
|
|
1439
|
+
const val2 = +use_atom_wts;
|
|
1357
1440
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1358
1441
|
const len0 = WASM_VECTOR_LEN;
|
|
1359
|
-
const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0,
|
|
1360
|
-
var
|
|
1361
|
-
var
|
|
1442
|
+
const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0, val2);
|
|
1443
|
+
var ptr3 = ret[0];
|
|
1444
|
+
var len3 = ret[1];
|
|
1362
1445
|
if (ret[3]) {
|
|
1363
|
-
|
|
1446
|
+
ptr3 = 0; len3 = 0;
|
|
1364
1447
|
throw takeFromExternrefTable0(ret[2]);
|
|
1365
1448
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
return getStringFromWasm0(
|
|
1449
|
+
deferred4_0 = ptr3;
|
|
1450
|
+
deferred4_1 = len3;
|
|
1451
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1369
1452
|
} finally {
|
|
1370
|
-
wasm.__wbindgen_free(
|
|
1453
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1371
1454
|
}
|
|
1372
1455
|
}
|
|
1373
1456
|
/**
|
|
@@ -1404,23 +1487,25 @@ export class MolHandle {
|
|
|
1404
1487
|
* @returns {string}
|
|
1405
1488
|
*/
|
|
1406
1489
|
rdkit_embed_with_constraints_json(constraints_json, random_seed, max_iterations) {
|
|
1407
|
-
let
|
|
1408
|
-
let
|
|
1490
|
+
let deferred5_0;
|
|
1491
|
+
let deferred5_1;
|
|
1409
1492
|
try {
|
|
1493
|
+
const val2 = +random_seed;
|
|
1494
|
+
const val3 = +max_iterations;
|
|
1410
1495
|
const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1411
1496
|
const len0 = WASM_VECTOR_LEN;
|
|
1412
|
-
const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0,
|
|
1413
|
-
var
|
|
1414
|
-
var
|
|
1497
|
+
const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
1498
|
+
var ptr4 = ret[0];
|
|
1499
|
+
var len4 = ret[1];
|
|
1415
1500
|
if (ret[3]) {
|
|
1416
|
-
|
|
1501
|
+
ptr4 = 0; len4 = 0;
|
|
1417
1502
|
throw takeFromExternrefTable0(ret[2]);
|
|
1418
1503
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
return getStringFromWasm0(
|
|
1504
|
+
deferred5_0 = ptr4;
|
|
1505
|
+
deferred5_1 = len4;
|
|
1506
|
+
return getStringFromWasm0(ptr4, len4);
|
|
1422
1507
|
} finally {
|
|
1423
|
-
wasm.__wbindgen_free(
|
|
1508
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
1424
1509
|
}
|
|
1425
1510
|
}
|
|
1426
1511
|
/**
|
|
@@ -1430,23 +1515,24 @@ export class MolHandle {
|
|
|
1430
1515
|
* @returns {string}
|
|
1431
1516
|
*/
|
|
1432
1517
|
rdkit_mol_hash(_function, use_cx_smiles) {
|
|
1433
|
-
let
|
|
1434
|
-
let
|
|
1518
|
+
let deferred4_0;
|
|
1519
|
+
let deferred4_1;
|
|
1435
1520
|
try {
|
|
1521
|
+
const val2 = +use_cx_smiles;
|
|
1436
1522
|
const ptr0 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1437
1523
|
const len0 = WASM_VECTOR_LEN;
|
|
1438
|
-
const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0,
|
|
1439
|
-
var
|
|
1440
|
-
var
|
|
1524
|
+
const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, val2);
|
|
1525
|
+
var ptr3 = ret[0];
|
|
1526
|
+
var len3 = ret[1];
|
|
1441
1527
|
if (ret[3]) {
|
|
1442
|
-
|
|
1528
|
+
ptr3 = 0; len3 = 0;
|
|
1443
1529
|
throw takeFromExternrefTable0(ret[2]);
|
|
1444
1530
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
return getStringFromWasm0(
|
|
1531
|
+
deferred4_0 = ptr3;
|
|
1532
|
+
deferred4_1 = len3;
|
|
1533
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1448
1534
|
} finally {
|
|
1449
|
-
wasm.__wbindgen_free(
|
|
1535
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1450
1536
|
}
|
|
1451
1537
|
}
|
|
1452
1538
|
/**
|
|
@@ -1496,6 +1582,19 @@ export class MolHandle {
|
|
|
1496
1582
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1497
1583
|
}
|
|
1498
1584
|
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Copy the molecule with RDKit's SMILES reader conventions, including
|
|
1587
|
+
* its stereo tags and hydrogen suppression. Throws when conversion
|
|
1588
|
+
* cannot represent the input.
|
|
1589
|
+
* @returns {MolHandle}
|
|
1590
|
+
*/
|
|
1591
|
+
rdkit_parsed() {
|
|
1592
|
+
const ret = wasm.molhandle_rdkit_parsed(this.__wbg_ptr);
|
|
1593
|
+
if (ret[2]) {
|
|
1594
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1595
|
+
}
|
|
1596
|
+
return MolHandle.__wrap(ret[0]);
|
|
1597
|
+
}
|
|
1499
1598
|
/**
|
|
1500
1599
|
* RDKit-compatible PDB block. Optional coordinates are a JSON array in
|
|
1501
1600
|
* zero-based molecule atom order; omit them to write zero coordinates.
|
|
@@ -1906,17 +2005,18 @@ export class RdkitSearchIndex {
|
|
|
1906
2005
|
* @returns {string}
|
|
1907
2006
|
*/
|
|
1908
2007
|
search_json(query_smiles, k) {
|
|
1909
|
-
let
|
|
1910
|
-
let
|
|
2008
|
+
let deferred3_0;
|
|
2009
|
+
let deferred3_1;
|
|
1911
2010
|
try {
|
|
2011
|
+
const val2 = +k;
|
|
1912
2012
|
const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1913
2013
|
const len0 = WASM_VECTOR_LEN;
|
|
1914
|
-
const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0,
|
|
1915
|
-
|
|
1916
|
-
|
|
2014
|
+
const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0, val2);
|
|
2015
|
+
deferred3_0 = ret[0];
|
|
2016
|
+
deferred3_1 = ret[1];
|
|
1917
2017
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
1918
2018
|
} finally {
|
|
1919
|
-
wasm.__wbindgen_free(
|
|
2019
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1920
2020
|
}
|
|
1921
2021
|
}
|
|
1922
2022
|
/**
|
|
@@ -1930,17 +2030,18 @@ export class RdkitSearchIndex {
|
|
|
1930
2030
|
* @returns {string}
|
|
1931
2031
|
*/
|
|
1932
2032
|
search_json_precise(query_smiles, k) {
|
|
1933
|
-
let
|
|
1934
|
-
let
|
|
2033
|
+
let deferred3_0;
|
|
2034
|
+
let deferred3_1;
|
|
1935
2035
|
try {
|
|
2036
|
+
const val2 = +k;
|
|
1936
2037
|
const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1937
2038
|
const len0 = WASM_VECTOR_LEN;
|
|
1938
|
-
const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0,
|
|
1939
|
-
|
|
1940
|
-
|
|
2039
|
+
const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0, val2);
|
|
2040
|
+
deferred3_0 = ret[0];
|
|
2041
|
+
deferred3_1 = ret[1];
|
|
1941
2042
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
1942
2043
|
} finally {
|
|
1943
|
-
wasm.__wbindgen_free(
|
|
2044
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1944
2045
|
}
|
|
1945
2046
|
}
|
|
1946
2047
|
/**
|
|
@@ -1952,17 +2053,19 @@ export class RdkitSearchIndex {
|
|
|
1952
2053
|
* @returns {string}
|
|
1953
2054
|
*/
|
|
1954
2055
|
search_json_threshold_precise(query_smiles, threshold, k) {
|
|
1955
|
-
let
|
|
1956
|
-
let
|
|
2056
|
+
let deferred4_0;
|
|
2057
|
+
let deferred4_1;
|
|
1957
2058
|
try {
|
|
2059
|
+
const val2 = +threshold;
|
|
2060
|
+
const val3 = +k;
|
|
1958
2061
|
const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1959
2062
|
const len0 = WASM_VECTOR_LEN;
|
|
1960
|
-
const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0,
|
|
1961
|
-
|
|
1962
|
-
|
|
2063
|
+
const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
2064
|
+
deferred4_0 = ret[0];
|
|
2065
|
+
deferred4_1 = ret[1];
|
|
1963
2066
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
1964
2067
|
} finally {
|
|
1965
|
-
wasm.__wbindgen_free(
|
|
2068
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1966
2069
|
}
|
|
1967
2070
|
}
|
|
1968
2071
|
}
|
|
@@ -2304,6 +2407,56 @@ export function batch_report_html(smiles_lines) {
|
|
|
2304
2407
|
}
|
|
2305
2408
|
}
|
|
2306
2409
|
|
|
2410
|
+
/**
|
|
2411
|
+
* @param {string} json
|
|
2412
|
+
* @returns {string}
|
|
2413
|
+
*/
|
|
2414
|
+
export function bgf_from_record_json(json) {
|
|
2415
|
+
let deferred3_0;
|
|
2416
|
+
let deferred3_1;
|
|
2417
|
+
try {
|
|
2418
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2419
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2420
|
+
const ret = wasm.bgf_from_record_json(ptr0, len0);
|
|
2421
|
+
var ptr2 = ret[0];
|
|
2422
|
+
var len2 = ret[1];
|
|
2423
|
+
if (ret[3]) {
|
|
2424
|
+
ptr2 = 0; len2 = 0;
|
|
2425
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2426
|
+
}
|
|
2427
|
+
deferred3_0 = ptr2;
|
|
2428
|
+
deferred3_1 = len2;
|
|
2429
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2430
|
+
} finally {
|
|
2431
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
/**
|
|
2436
|
+
* @param {string} text
|
|
2437
|
+
* @returns {string}
|
|
2438
|
+
*/
|
|
2439
|
+
export function bgf_record_json(text) {
|
|
2440
|
+
let deferred3_0;
|
|
2441
|
+
let deferred3_1;
|
|
2442
|
+
try {
|
|
2443
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2444
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2445
|
+
const ret = wasm.bgf_record_json(ptr0, len0);
|
|
2446
|
+
var ptr2 = ret[0];
|
|
2447
|
+
var len2 = ret[1];
|
|
2448
|
+
if (ret[3]) {
|
|
2449
|
+
ptr2 = 0; len2 = 0;
|
|
2450
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2451
|
+
}
|
|
2452
|
+
deferred3_0 = ptr2;
|
|
2453
|
+
deferred3_1 = len2;
|
|
2454
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2455
|
+
} finally {
|
|
2456
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2307
2460
|
/**
|
|
2308
2461
|
* Predict GI absorption and BBB penetration using the BOILED-Egg method
|
|
2309
2462
|
* (Daina & Zoete 2016).
|
|
@@ -2431,23 +2584,24 @@ export function brics_fragments_json(mol) {
|
|
|
2431
2584
|
* @returns {string}
|
|
2432
2585
|
*/
|
|
2433
2586
|
export function butina_cluster_ecfp4_json(smiles_json, cutoff) {
|
|
2434
|
-
let
|
|
2435
|
-
let
|
|
2587
|
+
let deferred4_0;
|
|
2588
|
+
let deferred4_1;
|
|
2436
2589
|
try {
|
|
2590
|
+
const val2 = +cutoff;
|
|
2437
2591
|
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2438
2592
|
const len0 = WASM_VECTOR_LEN;
|
|
2439
|
-
const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0,
|
|
2440
|
-
var
|
|
2441
|
-
var
|
|
2593
|
+
const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0, val2);
|
|
2594
|
+
var ptr3 = ret[0];
|
|
2595
|
+
var len3 = ret[1];
|
|
2442
2596
|
if (ret[3]) {
|
|
2443
|
-
|
|
2597
|
+
ptr3 = 0; len3 = 0;
|
|
2444
2598
|
throw takeFromExternrefTable0(ret[2]);
|
|
2445
2599
|
}
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
return getStringFromWasm0(
|
|
2600
|
+
deferred4_0 = ptr3;
|
|
2601
|
+
deferred4_1 = len3;
|
|
2602
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2449
2603
|
} finally {
|
|
2450
|
-
wasm.__wbindgen_free(
|
|
2604
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2451
2605
|
}
|
|
2452
2606
|
}
|
|
2453
2607
|
|
|
@@ -2503,26 +2657,35 @@ export function canonical_tautomer_with_blocked_atoms_json(mol, blocked_atom_ind
|
|
|
2503
2657
|
* @returns {string}
|
|
2504
2658
|
*/
|
|
2505
2659
|
export function canonicalize_conformer_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
|
|
2506
|
-
let
|
|
2507
|
-
let
|
|
2660
|
+
let deferred6_0;
|
|
2661
|
+
let deferred6_1;
|
|
2508
2662
|
try {
|
|
2509
2663
|
_assertClass(mol, MolHandle);
|
|
2510
|
-
const
|
|
2511
|
-
const
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2664
|
+
const val3 = +normalize_covar;
|
|
2665
|
+
const val4 = +ignore_hs;
|
|
2666
|
+
let ptr0, len0, ptr1, len1;
|
|
2667
|
+
try {
|
|
2668
|
+
ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2669
|
+
len0 = WASM_VECTOR_LEN;
|
|
2670
|
+
ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2671
|
+
len1 = WASM_VECTOR_LEN;
|
|
2672
|
+
} catch (e) {
|
|
2673
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
2674
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
2675
|
+
throw e;
|
|
2676
|
+
}
|
|
2677
|
+
const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
|
|
2678
|
+
var ptr5 = ret[0];
|
|
2679
|
+
var len5 = ret[1];
|
|
2517
2680
|
if (ret[3]) {
|
|
2518
|
-
|
|
2681
|
+
ptr5 = 0; len5 = 0;
|
|
2519
2682
|
throw takeFromExternrefTable0(ret[2]);
|
|
2520
2683
|
}
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
return getStringFromWasm0(
|
|
2684
|
+
deferred6_0 = ptr5;
|
|
2685
|
+
deferred6_1 = len5;
|
|
2686
|
+
return getStringFromWasm0(ptr5, len5);
|
|
2524
2687
|
} finally {
|
|
2525
|
-
wasm.__wbindgen_free(
|
|
2688
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
2526
2689
|
}
|
|
2527
2690
|
}
|
|
2528
2691
|
|
|
@@ -2542,10 +2705,17 @@ export function canonicalize_smiles_batch_json(smiles_batch, delimiter) {
|
|
|
2542
2705
|
let deferred4_0;
|
|
2543
2706
|
let deferred4_1;
|
|
2544
2707
|
try {
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2708
|
+
let ptr0, len0, ptr1, len1;
|
|
2709
|
+
try {
|
|
2710
|
+
ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2711
|
+
len0 = WASM_VECTOR_LEN;
|
|
2712
|
+
ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2713
|
+
len1 = WASM_VECTOR_LEN;
|
|
2714
|
+
} catch (e) {
|
|
2715
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
2716
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
2717
|
+
throw e;
|
|
2718
|
+
}
|
|
2549
2719
|
const ret = wasm.canonicalize_smiles_batch_json(ptr0, len0, ptr1, len1);
|
|
2550
2720
|
var ptr3 = ret[0];
|
|
2551
2721
|
var len3 = ret[1];
|
|
@@ -2713,23 +2883,24 @@ export function cdxml_to_smiles_json(cdxml) {
|
|
|
2713
2883
|
* @returns {string}
|
|
2714
2884
|
*/
|
|
2715
2885
|
export function cdxml_to_smiles_json_with_options(cdxml, infer_nondirectional_stereo) {
|
|
2716
|
-
let
|
|
2717
|
-
let
|
|
2886
|
+
let deferred4_0;
|
|
2887
|
+
let deferred4_1;
|
|
2718
2888
|
try {
|
|
2889
|
+
const val2 = +infer_nondirectional_stereo;
|
|
2719
2890
|
const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2720
2891
|
const len0 = WASM_VECTOR_LEN;
|
|
2721
|
-
const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0,
|
|
2722
|
-
var
|
|
2723
|
-
var
|
|
2892
|
+
const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0, val2);
|
|
2893
|
+
var ptr3 = ret[0];
|
|
2894
|
+
var len3 = ret[1];
|
|
2724
2895
|
if (ret[3]) {
|
|
2725
|
-
|
|
2896
|
+
ptr3 = 0; len3 = 0;
|
|
2726
2897
|
throw takeFromExternrefTable0(ret[2]);
|
|
2727
2898
|
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
return getStringFromWasm0(
|
|
2899
|
+
deferred4_0 = ptr3;
|
|
2900
|
+
deferred4_1 = len3;
|
|
2901
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2731
2902
|
} finally {
|
|
2732
|
-
wasm.__wbindgen_free(
|
|
2903
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2733
2904
|
}
|
|
2734
2905
|
}
|
|
2735
2906
|
|
|
@@ -2776,31 +2947,39 @@ export function chematic_version() {
|
|
|
2776
2947
|
/**
|
|
2777
2948
|
* Exact source bytes, projected XML, fragment coordinates and CDX omission tags.
|
|
2778
2949
|
* CDXML uses the existing graph projection; omissions lists CDX tags only.
|
|
2779
|
-
* @param {Uint8Array} data
|
|
2950
|
+
* @param {Uint8Array | number[]} data
|
|
2780
2951
|
* @param {string} format
|
|
2781
2952
|
* @param {boolean} allow_metadata_loss
|
|
2782
2953
|
* @returns {string}
|
|
2783
2954
|
*/
|
|
2784
2955
|
export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
|
|
2785
|
-
let
|
|
2786
|
-
let
|
|
2956
|
+
let deferred5_0;
|
|
2957
|
+
let deferred5_1;
|
|
2787
2958
|
try {
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2959
|
+
const val3 = +allow_metadata_loss;
|
|
2960
|
+
let ptr0, len0, ptr1, len1;
|
|
2961
|
+
try {
|
|
2962
|
+
ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
2963
|
+
len0 = WASM_VECTOR_LEN;
|
|
2964
|
+
ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2965
|
+
len1 = WASM_VECTOR_LEN;
|
|
2966
|
+
} catch (e) {
|
|
2967
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
2968
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
2969
|
+
throw e;
|
|
2970
|
+
}
|
|
2971
|
+
const ret = wasm.chemdraw_block_report_json(ptr0, len0, ptr1, len1, val3);
|
|
2972
|
+
var ptr4 = ret[0];
|
|
2973
|
+
var len4 = ret[1];
|
|
2795
2974
|
if (ret[3]) {
|
|
2796
|
-
|
|
2975
|
+
ptr4 = 0; len4 = 0;
|
|
2797
2976
|
throw takeFromExternrefTable0(ret[2]);
|
|
2798
2977
|
}
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
return getStringFromWasm0(
|
|
2978
|
+
deferred5_0 = ptr4;
|
|
2979
|
+
deferred5_1 = len4;
|
|
2980
|
+
return getStringFromWasm0(ptr4, len4);
|
|
2802
2981
|
} finally {
|
|
2803
|
-
wasm.__wbindgen_free(
|
|
2982
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
2804
2983
|
}
|
|
2805
2984
|
}
|
|
2806
2985
|
|
|
@@ -2813,9 +2992,9 @@ export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
|
|
|
2813
2992
|
* [`cip_unresolved_json`] -- never a silently-guessed label. A phosphorus on an
|
|
2814
2993
|
* unsaturated ring (cyclophosphazene) gets RDKit's CIPLabeler label, which flips
|
|
2815
2994
|
* with the ring's Kekulé spelling; its object carries `"kekuleDependent": true`.
|
|
2816
|
-
*
|
|
2817
|
-
*
|
|
2818
|
-
*
|
|
2995
|
+
* `seqCis` and `seqTrans` entries carry `bondIdx` and `bondAtoms`.
|
|
2996
|
+
* Configured odd cumulenes carry the full path as `cumuleneAtoms`, from `atomIdx`.
|
|
2997
|
+
* Saturated ring lone-pair centres use the molecule's recorded ligand order.
|
|
2819
2998
|
* Returns `"null"` on an internal engine error (budget-independent computations
|
|
2820
2999
|
* should not normally hit this).
|
|
2821
3000
|
* @param {MolHandle} mol
|
|
@@ -2880,6 +3059,17 @@ export function cip_unresolved_json(mol) {
|
|
|
2880
3059
|
}
|
|
2881
3060
|
}
|
|
2882
3061
|
|
|
3062
|
+
/**
|
|
3063
|
+
* Apply Cleanup and return a new molecule with all fragments retained.
|
|
3064
|
+
* @param {MolHandle} mol
|
|
3065
|
+
* @returns {MolHandle}
|
|
3066
|
+
*/
|
|
3067
|
+
export function cleanup_mol(mol) {
|
|
3068
|
+
_assertClass(mol, MolHandle);
|
|
3069
|
+
const ret = wasm.cleanup_mol(mol.__wbg_ptr);
|
|
3070
|
+
return MolHandle.__wrap(ret);
|
|
3071
|
+
}
|
|
3072
|
+
|
|
2883
3073
|
/**
|
|
2884
3074
|
* Compare multiple SMILES strings (up to 256 by default).
|
|
2885
3075
|
* Accepts a delimiter-separated list (e.g., newline or comma).
|
|
@@ -2900,10 +3090,17 @@ export function compare_molecules_batch_json(smiles_batch, delimiter) {
|
|
|
2900
3090
|
let deferred4_0;
|
|
2901
3091
|
let deferred4_1;
|
|
2902
3092
|
try {
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
3093
|
+
let ptr0, len0, ptr1, len1;
|
|
3094
|
+
try {
|
|
3095
|
+
ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3096
|
+
len0 = WASM_VECTOR_LEN;
|
|
3097
|
+
ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3098
|
+
len1 = WASM_VECTOR_LEN;
|
|
3099
|
+
} catch (e) {
|
|
3100
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3101
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3102
|
+
throw e;
|
|
3103
|
+
}
|
|
2907
3104
|
const ret = wasm.compare_molecules_batch_json(ptr0, len0, ptr1, len1);
|
|
2908
3105
|
var ptr3 = ret[0];
|
|
2909
3106
|
var len3 = ret[1];
|
|
@@ -2937,10 +3134,17 @@ export function compare_molecules_json(smiles1, smiles2) {
|
|
|
2937
3134
|
let deferred4_0;
|
|
2938
3135
|
let deferred4_1;
|
|
2939
3136
|
try {
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
3137
|
+
let ptr0, len0, ptr1, len1;
|
|
3138
|
+
try {
|
|
3139
|
+
ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3140
|
+
len0 = WASM_VECTOR_LEN;
|
|
3141
|
+
ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3142
|
+
len1 = WASM_VECTOR_LEN;
|
|
3143
|
+
} catch (e) {
|
|
3144
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3145
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3146
|
+
throw e;
|
|
3147
|
+
}
|
|
2944
3148
|
const ret = wasm.compare_molecules_json(ptr0, len0, ptr1, len1);
|
|
2945
3149
|
var ptr3 = ret[0];
|
|
2946
3150
|
var len3 = ret[1];
|
|
@@ -2969,26 +3173,35 @@ export function compare_molecules_json(smiles1, smiles2) {
|
|
|
2969
3173
|
* @returns {string}
|
|
2970
3174
|
*/
|
|
2971
3175
|
export function compute_canonical_transform_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
|
|
2972
|
-
let
|
|
2973
|
-
let
|
|
3176
|
+
let deferred6_0;
|
|
3177
|
+
let deferred6_1;
|
|
2974
3178
|
try {
|
|
2975
3179
|
_assertClass(mol, MolHandle);
|
|
2976
|
-
const
|
|
2977
|
-
const
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
3180
|
+
const val3 = +normalize_covar;
|
|
3181
|
+
const val4 = +ignore_hs;
|
|
3182
|
+
let ptr0, len0, ptr1, len1;
|
|
3183
|
+
try {
|
|
3184
|
+
ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3185
|
+
len0 = WASM_VECTOR_LEN;
|
|
3186
|
+
ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3187
|
+
len1 = WASM_VECTOR_LEN;
|
|
3188
|
+
} catch (e) {
|
|
3189
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3190
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3191
|
+
throw e;
|
|
3192
|
+
}
|
|
3193
|
+
const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
|
|
3194
|
+
var ptr5 = ret[0];
|
|
3195
|
+
var len5 = ret[1];
|
|
2983
3196
|
if (ret[3]) {
|
|
2984
|
-
|
|
3197
|
+
ptr5 = 0; len5 = 0;
|
|
2985
3198
|
throw takeFromExternrefTable0(ret[2]);
|
|
2986
3199
|
}
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
return getStringFromWasm0(
|
|
3200
|
+
deferred6_0 = ptr5;
|
|
3201
|
+
deferred6_1 = len5;
|
|
3202
|
+
return getStringFromWasm0(ptr5, len5);
|
|
2990
3203
|
} finally {
|
|
2991
|
-
wasm.__wbindgen_free(
|
|
3204
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
2992
3205
|
}
|
|
2993
3206
|
}
|
|
2994
3207
|
|
|
@@ -3019,8 +3232,35 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
|
|
|
3019
3232
|
*
|
|
3020
3233
|
* This is the WASM counterpart of Python's `convert_format`. It supports
|
|
3021
3234
|
* SMILES, MOL/SDF, MOL V3000, MOL2, CML, ChemicalJSON, MolJSON, and CDXML.
|
|
3022
|
-
* MOL2-to-MOL2
|
|
3235
|
+
* MOL2-to-MOL2, CJSON-to-CJSON, and V3000-to-V3000 validate and retain exact source.
|
|
3236
|
+
* GJF/COM supports only
|
|
3237
|
+
* same-format retention of a bounded single Cartesian job, including opaque
|
|
3238
|
+
* job sections (not a Gaussian job validator).
|
|
3239
|
+
* V2000/V3000-to-CJSON also
|
|
3240
|
+
* CJSON-to-CML retains the local indexed graph, source XYZ and name after reparse;
|
|
3241
|
+
* opaque fields/stereo/unit cells, partial charges and conflicting names throw.
|
|
3242
|
+
* Source chemistry and coordinate-derived stereo are not validated.
|
|
3243
|
+
* V2000/V3000-to-CJSON also
|
|
3244
|
+
* carries source-order x/y/z values; it does not retain opaque metadata or
|
|
3245
|
+
* verify cross-format stereo.
|
|
3246
|
+
* MOL2-to-CJSON checks
|
|
3247
|
+
* graph/xyz/name/complete declared partial charges on reparse and refuses
|
|
3248
|
+
* incomplete or undeclared charge columns. Other MOL2 metadata and stereo
|
|
3249
|
+
* are not retained or verified; use convert_with_report_json for losses.
|
|
3250
|
+
* NO_CHARGES zero placeholders are omitted as explicitly unassigned values.
|
|
3251
|
+
* Other conversions use
|
|
3023
3252
|
* the topology-only bridge and do not carry format-specific metadata.
|
|
3253
|
+
* CML-to-CML retains one bounded XML 1.0 CML-namespace molecule document exactly;
|
|
3254
|
+
* chemistry/references/stereo remain opaque, with no edits or validation promised.
|
|
3255
|
+
* SDF-to-SDF retains every validated source record. Other MOL/SDF input routes
|
|
3256
|
+
* require exactly one CTAB and omit SD fields; SDF output is one framed record.
|
|
3257
|
+
* CML-to-CJSON verifies a bounded graph/Cartesian/name profile on reparse,
|
|
3258
|
+
* including inferred H counts, and refuses unrepresented payload (2D, stereo,
|
|
3259
|
+
* aromatic/query/zero bonds, unknown attributes/elements).
|
|
3260
|
+
* Molecule/atom/bond IDs are document-local references; their spelling and
|
|
3261
|
+
* lexical XML are omitted.
|
|
3262
|
+
* Graph-projected CJSON output refuses in-memory properties outside the local
|
|
3263
|
+
* profile. MOL2 projection and exact CJSON retention keep separate contracts.
|
|
3024
3264
|
* @param {string} text
|
|
3025
3265
|
* @param {string} input_format
|
|
3026
3266
|
* @param {string} output_format
|
|
@@ -3030,12 +3270,20 @@ export function convert_common_format(text, input_format, output_format) {
|
|
|
3030
3270
|
let deferred5_0;
|
|
3031
3271
|
let deferred5_1;
|
|
3032
3272
|
try {
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3273
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
3274
|
+
try {
|
|
3275
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3276
|
+
len0 = WASM_VECTOR_LEN;
|
|
3277
|
+
ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3278
|
+
len1 = WASM_VECTOR_LEN;
|
|
3279
|
+
ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3280
|
+
len2 = WASM_VECTOR_LEN;
|
|
3281
|
+
} catch (e) {
|
|
3282
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
3283
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3284
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3285
|
+
throw e;
|
|
3286
|
+
}
|
|
3039
3287
|
const ret = wasm.convert_common_format(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
3040
3288
|
var ptr4 = ret[0];
|
|
3041
3289
|
var len4 = ret[1];
|
|
@@ -3052,7 +3300,7 @@ export function convert_common_format(text, input_format, output_format) {
|
|
|
3052
3300
|
}
|
|
3053
3301
|
|
|
3054
3302
|
/**
|
|
3055
|
-
* Checked MOL2/CJSON conversion using the shared report schema.
|
|
3303
|
+
* Checked MOL2/CJSON/CML conversion using the shared report schema.
|
|
3056
3304
|
* @param {string} text
|
|
3057
3305
|
* @param {string} input_format
|
|
3058
3306
|
* @param {string} output_format
|
|
@@ -3063,14 +3311,23 @@ export function convert_with_report_json(text, input_format, output_format, poli
|
|
|
3063
3311
|
let deferred6_0;
|
|
3064
3312
|
let deferred6_1;
|
|
3065
3313
|
try {
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3314
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
3315
|
+
try {
|
|
3316
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3317
|
+
len0 = WASM_VECTOR_LEN;
|
|
3318
|
+
ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3319
|
+
len1 = WASM_VECTOR_LEN;
|
|
3320
|
+
ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3321
|
+
len2 = WASM_VECTOR_LEN;
|
|
3322
|
+
ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3323
|
+
len3 = WASM_VECTOR_LEN;
|
|
3324
|
+
} catch (e) {
|
|
3325
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
3326
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
3327
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3328
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3329
|
+
throw e;
|
|
3330
|
+
}
|
|
3074
3331
|
const ret = wasm.convert_with_report_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
3075
3332
|
var ptr5 = ret[0];
|
|
3076
3333
|
var len5 = ret[1];
|
|
@@ -3278,17 +3535,18 @@ export function depict_reaction_svg(rxn_smiles) {
|
|
|
3278
3535
|
* @returns {string}
|
|
3279
3536
|
*/
|
|
3280
3537
|
export function depict_svg_grid(smiles_block, cols) {
|
|
3281
|
-
let
|
|
3282
|
-
let
|
|
3538
|
+
let deferred3_0;
|
|
3539
|
+
let deferred3_1;
|
|
3283
3540
|
try {
|
|
3541
|
+
const val2 = +cols;
|
|
3284
3542
|
const ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3285
3543
|
const len0 = WASM_VECTOR_LEN;
|
|
3286
|
-
const ret = wasm.depict_svg_grid(ptr0, len0,
|
|
3287
|
-
|
|
3288
|
-
|
|
3544
|
+
const ret = wasm.depict_svg_grid(ptr0, len0, val2);
|
|
3545
|
+
deferred3_0 = ret[0];
|
|
3546
|
+
deferred3_1 = ret[1];
|
|
3289
3547
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
3290
3548
|
} finally {
|
|
3291
|
-
wasm.__wbindgen_free(
|
|
3549
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3292
3550
|
}
|
|
3293
3551
|
}
|
|
3294
3552
|
|
|
@@ -3311,19 +3569,27 @@ export function depict_svg_grid(smiles_block, cols) {
|
|
|
3311
3569
|
* @returns {string}
|
|
3312
3570
|
*/
|
|
3313
3571
|
export function depict_svg_grid_highlighted(smiles_block, cols, match_smarts) {
|
|
3314
|
-
let
|
|
3315
|
-
let
|
|
3572
|
+
let deferred4_0;
|
|
3573
|
+
let deferred4_1;
|
|
3316
3574
|
try {
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3575
|
+
const val3 = +cols;
|
|
3576
|
+
let ptr0, len0, ptr1, len1;
|
|
3577
|
+
try {
|
|
3578
|
+
ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3579
|
+
len0 = WASM_VECTOR_LEN;
|
|
3580
|
+
ptr1 = passStringToWasm0(match_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3581
|
+
len1 = WASM_VECTOR_LEN;
|
|
3582
|
+
} catch (e) {
|
|
3583
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3584
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3585
|
+
throw e;
|
|
3586
|
+
}
|
|
3587
|
+
const ret = wasm.depict_svg_grid_highlighted(ptr0, len0, val3, ptr1, len1);
|
|
3588
|
+
deferred4_0 = ret[0];
|
|
3589
|
+
deferred4_1 = ret[1];
|
|
3324
3590
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
3325
3591
|
} finally {
|
|
3326
|
-
wasm.__wbindgen_free(
|
|
3592
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3327
3593
|
}
|
|
3328
3594
|
}
|
|
3329
3595
|
|
|
@@ -3390,6 +3656,106 @@ export function dice_maccs(a, b) {
|
|
|
3390
3656
|
return ret;
|
|
3391
3657
|
}
|
|
3392
3658
|
|
|
3659
|
+
/**
|
|
3660
|
+
* @param {string} json
|
|
3661
|
+
* @returns {string}
|
|
3662
|
+
*/
|
|
3663
|
+
export function dlpoly_config_from_record_json(json) {
|
|
3664
|
+
let deferred3_0;
|
|
3665
|
+
let deferred3_1;
|
|
3666
|
+
try {
|
|
3667
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3668
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3669
|
+
const ret = wasm.dlpoly_config_from_record_json(ptr0, len0);
|
|
3670
|
+
var ptr2 = ret[0];
|
|
3671
|
+
var len2 = ret[1];
|
|
3672
|
+
if (ret[3]) {
|
|
3673
|
+
ptr2 = 0; len2 = 0;
|
|
3674
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3675
|
+
}
|
|
3676
|
+
deferred3_0 = ptr2;
|
|
3677
|
+
deferred3_1 = len2;
|
|
3678
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3679
|
+
} finally {
|
|
3680
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
|
|
3684
|
+
/**
|
|
3685
|
+
* @param {string} text
|
|
3686
|
+
* @returns {string}
|
|
3687
|
+
*/
|
|
3688
|
+
export function dlpoly_config_record_json(text) {
|
|
3689
|
+
let deferred3_0;
|
|
3690
|
+
let deferred3_1;
|
|
3691
|
+
try {
|
|
3692
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3693
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3694
|
+
const ret = wasm.dlpoly_config_record_json(ptr0, len0);
|
|
3695
|
+
var ptr2 = ret[0];
|
|
3696
|
+
var len2 = ret[1];
|
|
3697
|
+
if (ret[3]) {
|
|
3698
|
+
ptr2 = 0; len2 = 0;
|
|
3699
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3700
|
+
}
|
|
3701
|
+
deferred3_0 = ptr2;
|
|
3702
|
+
deferred3_1 = len2;
|
|
3703
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3704
|
+
} finally {
|
|
3705
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
/**
|
|
3710
|
+
* @param {string} json
|
|
3711
|
+
* @returns {string}
|
|
3712
|
+
*/
|
|
3713
|
+
export function dlpoly_history_from_json(json) {
|
|
3714
|
+
let deferred3_0;
|
|
3715
|
+
let deferred3_1;
|
|
3716
|
+
try {
|
|
3717
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3718
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3719
|
+
const ret = wasm.dlpoly_history_from_json(ptr0, len0);
|
|
3720
|
+
var ptr2 = ret[0];
|
|
3721
|
+
var len2 = ret[1];
|
|
3722
|
+
if (ret[3]) {
|
|
3723
|
+
ptr2 = 0; len2 = 0;
|
|
3724
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3725
|
+
}
|
|
3726
|
+
deferred3_0 = ptr2;
|
|
3727
|
+
deferred3_1 = len2;
|
|
3728
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3729
|
+
} finally {
|
|
3730
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
/**
|
|
3735
|
+
* @param {string} text
|
|
3736
|
+
* @returns {string}
|
|
3737
|
+
*/
|
|
3738
|
+
export function dlpoly_history_json(text) {
|
|
3739
|
+
let deferred3_0;
|
|
3740
|
+
let deferred3_1;
|
|
3741
|
+
try {
|
|
3742
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3743
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3744
|
+
const ret = wasm.dlpoly_history_json(ptr0, len0);
|
|
3745
|
+
var ptr2 = ret[0];
|
|
3746
|
+
var len2 = ret[1];
|
|
3747
|
+
if (ret[3]) {
|
|
3748
|
+
ptr2 = 0; len2 = 0;
|
|
3749
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3750
|
+
}
|
|
3751
|
+
deferred3_0 = ptr2;
|
|
3752
|
+
deferred3_1 = len2;
|
|
3753
|
+
return getStringFromWasm0(ptr2, len2);
|
|
3754
|
+
} finally {
|
|
3755
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3393
3759
|
/**
|
|
3394
3760
|
* Compute the ECFP4 fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
|
|
3395
3761
|
* @param {MolHandle} mol
|
|
@@ -3491,10 +3857,17 @@ export function edit_cdxml_document_json(cdxml, edit_json) {
|
|
|
3491
3857
|
let deferred4_0;
|
|
3492
3858
|
let deferred4_1;
|
|
3493
3859
|
try {
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3860
|
+
let ptr0, len0, ptr1, len1;
|
|
3861
|
+
try {
|
|
3862
|
+
ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3863
|
+
len0 = WASM_VECTOR_LEN;
|
|
3864
|
+
ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3865
|
+
len1 = WASM_VECTOR_LEN;
|
|
3866
|
+
} catch (e) {
|
|
3867
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3868
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3869
|
+
throw e;
|
|
3870
|
+
}
|
|
3498
3871
|
const ret = wasm.edit_cdxml_document_json(ptr0, len0, ptr1, len1);
|
|
3499
3872
|
var ptr3 = ret[0];
|
|
3500
3873
|
var len3 = ret[1];
|
|
@@ -3522,10 +3895,17 @@ export function edit_cdxml_document_json_v1(document_json, edit_json) {
|
|
|
3522
3895
|
let deferred4_0;
|
|
3523
3896
|
let deferred4_1;
|
|
3524
3897
|
try {
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3898
|
+
let ptr0, len0, ptr1, len1;
|
|
3899
|
+
try {
|
|
3900
|
+
ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3901
|
+
len0 = WASM_VECTOR_LEN;
|
|
3902
|
+
ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3903
|
+
len1 = WASM_VECTOR_LEN;
|
|
3904
|
+
} catch (e) {
|
|
3905
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3906
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3907
|
+
throw e;
|
|
3908
|
+
}
|
|
3529
3909
|
const ret = wasm.edit_cdxml_document_json_v1(ptr0, len0, ptr1, len1);
|
|
3530
3910
|
var ptr3 = ret[0];
|
|
3531
3911
|
var len3 = ret[1];
|
|
@@ -3551,10 +3931,17 @@ export function edit_reaction_document_json_v1(document_json, edit_json) {
|
|
|
3551
3931
|
let deferred4_0;
|
|
3552
3932
|
let deferred4_1;
|
|
3553
3933
|
try {
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3934
|
+
let ptr0, len0, ptr1, len1;
|
|
3935
|
+
try {
|
|
3936
|
+
ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3937
|
+
len0 = WASM_VECTOR_LEN;
|
|
3938
|
+
ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3939
|
+
len1 = WASM_VECTOR_LEN;
|
|
3940
|
+
} catch (e) {
|
|
3941
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
3942
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
3943
|
+
throw e;
|
|
3944
|
+
}
|
|
3558
3945
|
const ret = wasm.edit_reaction_document_json_v1(ptr0, len0, ptr1, len1);
|
|
3559
3946
|
var ptr3 = ret[0];
|
|
3560
3947
|
var len3 = ret[1];
|
|
@@ -3686,12 +4073,20 @@ export function enumerate_library_2way(template, scaffolds_smiles, building_bloc
|
|
|
3686
4073
|
let deferred5_0;
|
|
3687
4074
|
let deferred5_1;
|
|
3688
4075
|
try {
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
4076
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
4077
|
+
try {
|
|
4078
|
+
ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4079
|
+
len0 = WASM_VECTOR_LEN;
|
|
4080
|
+
ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4081
|
+
len1 = WASM_VECTOR_LEN;
|
|
4082
|
+
ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4083
|
+
len2 = WASM_VECTOR_LEN;
|
|
4084
|
+
} catch (e) {
|
|
4085
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
4086
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
4087
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
4088
|
+
throw e;
|
|
4089
|
+
}
|
|
3695
4090
|
const ret = wasm.enumerate_library_2way(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
3696
4091
|
var ptr4 = ret[0];
|
|
3697
4092
|
var len4 = ret[1];
|
|
@@ -3831,23 +4226,24 @@ export function explain_rdkit_atom_code_json(code) {
|
|
|
3831
4226
|
* @returns {string}
|
|
3832
4227
|
*/
|
|
3833
4228
|
export function explain_rdkit_topological_torsion_code_json(code_decimal, size) {
|
|
3834
|
-
let
|
|
3835
|
-
let
|
|
4229
|
+
let deferred4_0;
|
|
4230
|
+
let deferred4_1;
|
|
3836
4231
|
try {
|
|
4232
|
+
const val2 = +size;
|
|
3837
4233
|
const ptr0 = passStringToWasm0(code_decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3838
4234
|
const len0 = WASM_VECTOR_LEN;
|
|
3839
|
-
const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0,
|
|
3840
|
-
var
|
|
3841
|
-
var
|
|
4235
|
+
const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0, val2);
|
|
4236
|
+
var ptr3 = ret[0];
|
|
4237
|
+
var len3 = ret[1];
|
|
3842
4238
|
if (ret[3]) {
|
|
3843
|
-
|
|
4239
|
+
ptr3 = 0; len3 = 0;
|
|
3844
4240
|
throw takeFromExternrefTable0(ret[2]);
|
|
3845
4241
|
}
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
return getStringFromWasm0(
|
|
4242
|
+
deferred4_0 = ptr3;
|
|
4243
|
+
deferred4_1 = len3;
|
|
4244
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3849
4245
|
} finally {
|
|
3850
|
-
wasm.__wbindgen_free(
|
|
4246
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3851
4247
|
}
|
|
3852
4248
|
}
|
|
3853
4249
|
|
|
@@ -3864,7 +4260,8 @@ export function explain_rdkit_topological_torsion_code_json(code_decimal, size)
|
|
|
3864
4260
|
* "info":{"key":"value", ...}}`.
|
|
3865
4261
|
*
|
|
3866
4262
|
* Returns a JS error on parse failure or if the frame exceeds the WASM
|
|
3867
|
-
* atom-count limit.
|
|
4263
|
+
* atom-count limit. Coordinates, cell entries and R atom data must be finite;
|
|
4264
|
+
* nonzero decimals that round to binary64 zero are refused.
|
|
3868
4265
|
* @param {string} text
|
|
3869
4266
|
* @returns {string}
|
|
3870
4267
|
*/
|
|
@@ -3898,23 +4295,25 @@ export function extxyz_frame_json(text) {
|
|
|
3898
4295
|
* @returns {string}
|
|
3899
4296
|
*/
|
|
3900
4297
|
export function extxyz_frames_batch_json(text, offset, batch_size) {
|
|
3901
|
-
let
|
|
3902
|
-
let
|
|
3903
|
-
try {
|
|
4298
|
+
let deferred5_0;
|
|
4299
|
+
let deferred5_1;
|
|
4300
|
+
try {
|
|
4301
|
+
const val2 = +offset;
|
|
4302
|
+
const val3 = +batch_size;
|
|
3904
4303
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3905
4304
|
const len0 = WASM_VECTOR_LEN;
|
|
3906
|
-
const ret = wasm.extxyz_frames_batch_json(ptr0, len0,
|
|
3907
|
-
var
|
|
3908
|
-
var
|
|
4305
|
+
const ret = wasm.extxyz_frames_batch_json(ptr0, len0, val2, val3);
|
|
4306
|
+
var ptr4 = ret[0];
|
|
4307
|
+
var len4 = ret[1];
|
|
3909
4308
|
if (ret[3]) {
|
|
3910
|
-
|
|
4309
|
+
ptr4 = 0; len4 = 0;
|
|
3911
4310
|
throw takeFromExternrefTable0(ret[2]);
|
|
3912
4311
|
}
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
return getStringFromWasm0(
|
|
4312
|
+
deferred5_0 = ptr4;
|
|
4313
|
+
deferred5_1 = len4;
|
|
4314
|
+
return getStringFromWasm0(ptr4, len4);
|
|
3916
4315
|
} finally {
|
|
3917
|
-
wasm.__wbindgen_free(
|
|
4316
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
3918
4317
|
}
|
|
3919
4318
|
}
|
|
3920
4319
|
|
|
@@ -4254,9 +4653,12 @@ export function get_atom_info(mol, idx) {
|
|
|
4254
4653
|
*/
|
|
4255
4654
|
export function get_bond_angle_from_coords_json(mol, coords_json, i, j, k) {
|
|
4256
4655
|
_assertClass(mol, MolHandle);
|
|
4656
|
+
const val2 = +i;
|
|
4657
|
+
const val3 = +j;
|
|
4658
|
+
const val4 = +k;
|
|
4257
4659
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4258
4660
|
const len0 = WASM_VECTOR_LEN;
|
|
4259
|
-
const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
4661
|
+
const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
|
|
4260
4662
|
if (ret[2]) {
|
|
4261
4663
|
throw takeFromExternrefTable0(ret[1]);
|
|
4262
4664
|
}
|
|
@@ -4329,9 +4731,11 @@ export function get_bond_info(mol, idx) {
|
|
|
4329
4731
|
*/
|
|
4330
4732
|
export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
|
|
4331
4733
|
_assertClass(mol, MolHandle);
|
|
4734
|
+
const val2 = +i;
|
|
4735
|
+
const val3 = +j;
|
|
4332
4736
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4333
4737
|
const len0 = WASM_VECTOR_LEN;
|
|
4334
|
-
const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
4738
|
+
const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
|
|
4335
4739
|
if (ret[2]) {
|
|
4336
4740
|
throw takeFromExternrefTable0(ret[1]);
|
|
4337
4741
|
}
|
|
@@ -4357,9 +4761,11 @@ export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
|
|
|
4357
4761
|
* @returns {number}
|
|
4358
4762
|
*/
|
|
4359
4763
|
export function get_bond_length_json(smiles, a, b) {
|
|
4764
|
+
const val2 = +a;
|
|
4765
|
+
const val3 = +b;
|
|
4360
4766
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4361
4767
|
const len0 = WASM_VECTOR_LEN;
|
|
4362
|
-
const ret = wasm.get_bond_length_json(ptr0, len0,
|
|
4768
|
+
const ret = wasm.get_bond_length_json(ptr0, len0, val2, val3);
|
|
4363
4769
|
return ret;
|
|
4364
4770
|
}
|
|
4365
4771
|
|
|
@@ -4397,9 +4803,13 @@ export function get_descriptors_json(mol) {
|
|
|
4397
4803
|
*/
|
|
4398
4804
|
export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
|
|
4399
4805
|
_assertClass(mol, MolHandle);
|
|
4806
|
+
const val2 = +i;
|
|
4807
|
+
const val3 = +j;
|
|
4808
|
+
const val4 = +k;
|
|
4809
|
+
const val5 = +l;
|
|
4400
4810
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4401
4811
|
const len0 = WASM_VECTOR_LEN;
|
|
4402
|
-
const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
4812
|
+
const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
|
|
4403
4813
|
if (ret[2]) {
|
|
4404
4814
|
throw takeFromExternrefTable0(ret[1]);
|
|
4405
4815
|
}
|
|
@@ -4426,9 +4836,13 @@ export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
|
|
|
4426
4836
|
* @returns {any}
|
|
4427
4837
|
*/
|
|
4428
4838
|
export function get_dihedral_json(smiles, a, b, c, d) {
|
|
4839
|
+
const val2 = +a;
|
|
4840
|
+
const val3 = +b;
|
|
4841
|
+
const val4 = +c;
|
|
4842
|
+
const val5 = +d;
|
|
4429
4843
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4430
4844
|
const len0 = WASM_VECTOR_LEN;
|
|
4431
|
-
const ret = wasm.get_dihedral_json(ptr0, len0,
|
|
4845
|
+
const ret = wasm.get_dihedral_json(ptr0, len0, val2, val3, val4, val5);
|
|
4432
4846
|
return ret;
|
|
4433
4847
|
}
|
|
4434
4848
|
|
|
@@ -4484,6 +4898,32 @@ export function getaway_descriptors_json(mol) {
|
|
|
4484
4898
|
}
|
|
4485
4899
|
}
|
|
4486
4900
|
|
|
4901
|
+
/**
|
|
4902
|
+
* Explicit checked binary64 Angstrom positions; raw parse/write is independent.
|
|
4903
|
+
* @param {string} text
|
|
4904
|
+
* @returns {string}
|
|
4905
|
+
*/
|
|
4906
|
+
export function gromos96_geometry_angstrom_json(text) {
|
|
4907
|
+
let deferred3_0;
|
|
4908
|
+
let deferred3_1;
|
|
4909
|
+
try {
|
|
4910
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4911
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4912
|
+
const ret = wasm.gromos96_geometry_angstrom_json(ptr0, len0);
|
|
4913
|
+
var ptr2 = ret[0];
|
|
4914
|
+
var len2 = ret[1];
|
|
4915
|
+
if (ret[3]) {
|
|
4916
|
+
ptr2 = 0; len2 = 0;
|
|
4917
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4918
|
+
}
|
|
4919
|
+
deferred3_0 = ptr2;
|
|
4920
|
+
deferred3_1 = len2;
|
|
4921
|
+
return getStringFromWasm0(ptr2, len2);
|
|
4922
|
+
} finally {
|
|
4923
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
4924
|
+
}
|
|
4925
|
+
}
|
|
4926
|
+
|
|
4487
4927
|
/**
|
|
4488
4928
|
* Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
|
|
4489
4929
|
*
|
|
@@ -4706,10 +5146,17 @@ export function lammps_data_to_json(text, atom_style) {
|
|
|
4706
5146
|
let deferred4_0;
|
|
4707
5147
|
let deferred4_1;
|
|
4708
5148
|
try {
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
5149
|
+
let ptr0, len0, ptr1, len1;
|
|
5150
|
+
try {
|
|
5151
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5152
|
+
len0 = WASM_VECTOR_LEN;
|
|
5153
|
+
ptr1 = passStringToWasm0(atom_style, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5154
|
+
len1 = WASM_VECTOR_LEN;
|
|
5155
|
+
} catch (e) {
|
|
5156
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
5157
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5158
|
+
throw e;
|
|
5159
|
+
}
|
|
4713
5160
|
const ret = wasm.lammps_data_to_json(ptr0, len0, ptr1, len1);
|
|
4714
5161
|
var ptr3 = ret[0];
|
|
4715
5162
|
var len3 = ret[1];
|
|
@@ -4927,6 +5374,32 @@ export function logp_per_atom_json(mol) {
|
|
|
4927
5374
|
}
|
|
4928
5375
|
}
|
|
4929
5376
|
|
|
5377
|
+
/**
|
|
5378
|
+
* Explicit checked binary64 Angstrom positions; raw parse/write is independent.
|
|
5379
|
+
* @param {string} text
|
|
5380
|
+
* @returns {string}
|
|
5381
|
+
*/
|
|
5382
|
+
export function lpmd_positions_angstrom_json(text) {
|
|
5383
|
+
let deferred3_0;
|
|
5384
|
+
let deferred3_1;
|
|
5385
|
+
try {
|
|
5386
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5387
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5388
|
+
const ret = wasm.lpmd_positions_angstrom_json(ptr0, len0);
|
|
5389
|
+
var ptr2 = ret[0];
|
|
5390
|
+
var len2 = ret[1];
|
|
5391
|
+
if (ret[3]) {
|
|
5392
|
+
ptr2 = 0; len2 = 0;
|
|
5393
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
5394
|
+
}
|
|
5395
|
+
deferred3_0 = ptr2;
|
|
5396
|
+
deferred3_1 = len2;
|
|
5397
|
+
return getStringFromWasm0(ptr2, len2);
|
|
5398
|
+
} finally {
|
|
5399
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5402
|
+
|
|
4930
5403
|
/**
|
|
4931
5404
|
* MACCS 166-bit structural keys fingerprint as a byte array (21 bytes, LSB-first).
|
|
4932
5405
|
*
|
|
@@ -4956,10 +5429,17 @@ export function match_smarts_smiles(smiles, smarts) {
|
|
|
4956
5429
|
let deferred4_0;
|
|
4957
5430
|
let deferred4_1;
|
|
4958
5431
|
try {
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
5432
|
+
let ptr0, len0, ptr1, len1;
|
|
5433
|
+
try {
|
|
5434
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5435
|
+
len0 = WASM_VECTOR_LEN;
|
|
5436
|
+
ptr1 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5437
|
+
len1 = WASM_VECTOR_LEN;
|
|
5438
|
+
} catch (e) {
|
|
5439
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
5440
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5441
|
+
throw e;
|
|
5442
|
+
}
|
|
4963
5443
|
const ret = wasm.match_smarts_smiles(ptr0, len0, ptr1, len1);
|
|
4964
5444
|
var ptr3 = ret[0];
|
|
4965
5445
|
var len3 = ret[1];
|
|
@@ -4986,23 +5466,66 @@ export function match_smarts_smiles(smiles, smarts) {
|
|
|
4986
5466
|
* @returns {string}
|
|
4987
5467
|
*/
|
|
4988
5468
|
export function maxmin_picks_ecfp4_json(smiles_json, n) {
|
|
4989
|
-
let
|
|
4990
|
-
let
|
|
5469
|
+
let deferred4_0;
|
|
5470
|
+
let deferred4_1;
|
|
4991
5471
|
try {
|
|
5472
|
+
const val2 = +n;
|
|
4992
5473
|
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4993
5474
|
const len0 = WASM_VECTOR_LEN;
|
|
4994
|
-
const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0,
|
|
4995
|
-
var
|
|
4996
|
-
var
|
|
5475
|
+
const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0, val2);
|
|
5476
|
+
var ptr3 = ret[0];
|
|
5477
|
+
var len3 = ret[1];
|
|
4997
5478
|
if (ret[3]) {
|
|
4998
|
-
|
|
5479
|
+
ptr3 = 0; len3 = 0;
|
|
4999
5480
|
throw takeFromExternrefTable0(ret[2]);
|
|
5000
5481
|
}
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
return getStringFromWasm0(
|
|
5482
|
+
deferred4_0 = ptr3;
|
|
5483
|
+
deferred4_1 = len3;
|
|
5484
|
+
return getStringFromWasm0(ptr3, len3);
|
|
5004
5485
|
} finally {
|
|
5005
|
-
wasm.__wbindgen_free(
|
|
5486
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
|
|
5490
|
+
/**
|
|
5491
|
+
* MCS SMARTS with status, preserving atom and bond query alternatives.
|
|
5492
|
+
*
|
|
5493
|
+
* Uses the same JSON input and configuration as `mcs_smiles_json_with_config`.
|
|
5494
|
+
* Set `bondCountFirst` to maximize bonds first, then atoms.
|
|
5495
|
+
* Charge and isotope predicates are preserved. `matchChiralTag` retains
|
|
5496
|
+
* absolute tetrahedral orientation with at least three common bonds and
|
|
5497
|
+
* chirality presence on smaller frames. Other stereo raises a serialization error.
|
|
5498
|
+
* @param {string} smiles_json
|
|
5499
|
+
* @param {string} config_json
|
|
5500
|
+
* @returns {string}
|
|
5501
|
+
*/
|
|
5502
|
+
export function mcs_smarts_json_with_config(smiles_json, config_json) {
|
|
5503
|
+
let deferred4_0;
|
|
5504
|
+
let deferred4_1;
|
|
5505
|
+
try {
|
|
5506
|
+
let ptr0, len0, ptr1, len1;
|
|
5507
|
+
try {
|
|
5508
|
+
ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5509
|
+
len0 = WASM_VECTOR_LEN;
|
|
5510
|
+
ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5511
|
+
len1 = WASM_VECTOR_LEN;
|
|
5512
|
+
} catch (e) {
|
|
5513
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
5514
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5515
|
+
throw e;
|
|
5516
|
+
}
|
|
5517
|
+
const ret = wasm.mcs_smarts_json_with_config(ptr0, len0, ptr1, len1);
|
|
5518
|
+
var ptr3 = ret[0];
|
|
5519
|
+
var len3 = ret[1];
|
|
5520
|
+
if (ret[3]) {
|
|
5521
|
+
ptr3 = 0; len3 = 0;
|
|
5522
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
5523
|
+
}
|
|
5524
|
+
deferred4_0 = ptr3;
|
|
5525
|
+
deferred4_1 = len3;
|
|
5526
|
+
return getStringFromWasm0(ptr3, len3);
|
|
5527
|
+
} finally {
|
|
5528
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
5006
5529
|
}
|
|
5007
5530
|
}
|
|
5008
5531
|
|
|
@@ -5044,14 +5567,16 @@ export function mcs_smiles_json(smiles_json) {
|
|
|
5044
5567
|
* (camelCase keys, all optional, defaulting to `McsConfig::default()`):
|
|
5045
5568
|
* `matchBonds`, `minAtoms`, `timeoutMs`, `ringMatchesRingOnly`,
|
|
5046
5569
|
* `completeRingsOnly`, `atomCompare` (`"elements"` | `"any_heavy_atom"` |
|
|
5570
|
+
* `"rdkit_any_heavy_atom"` |
|
|
5047
5571
|
* `"any"`), `bondCompare` (`"order_or_aromatic"` | `"any"`),
|
|
5048
|
-
* `matchChiralTag`, `matchCharge`, `matchIsotope`, `maximizeBonds
|
|
5049
|
-
*
|
|
5050
|
-
*
|
|
5051
|
-
*
|
|
5052
|
-
* `
|
|
5053
|
-
*
|
|
5054
|
-
*
|
|
5572
|
+
* `matchChiralTag`, `matchCharge`, `matchIsotope`, `maximizeBonds`, and
|
|
5573
|
+
* `maxSearchNodes`.
|
|
5574
|
+
*
|
|
5575
|
+
* Returns a JSON object with `smiles`, `wasTimedOut`, and
|
|
5576
|
+
* `wasResourceLimited`. `smiles` is `null` when there is no common
|
|
5577
|
+
* substructure; the two status fields distinguish deadline expiry from a
|
|
5578
|
+
* configured input/search limit. A returned partial result is not proven
|
|
5579
|
+
* optimal when either status is true.
|
|
5055
5580
|
* @param {string} smiles_json
|
|
5056
5581
|
* @param {string} config_json
|
|
5057
5582
|
* @returns {string}
|
|
@@ -5060,10 +5585,17 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
|
|
|
5060
5585
|
let deferred4_0;
|
|
5061
5586
|
let deferred4_1;
|
|
5062
5587
|
try {
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5588
|
+
let ptr0, len0, ptr1, len1;
|
|
5589
|
+
try {
|
|
5590
|
+
ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5591
|
+
len0 = WASM_VECTOR_LEN;
|
|
5592
|
+
ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5593
|
+
len1 = WASM_VECTOR_LEN;
|
|
5594
|
+
} catch (e) {
|
|
5595
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
5596
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5597
|
+
throw e;
|
|
5598
|
+
}
|
|
5067
5599
|
const ret = wasm.mcs_smiles_json_with_config(ptr0, len0, ptr1, len1);
|
|
5068
5600
|
var ptr3 = ret[0];
|
|
5069
5601
|
var len3 = ret[1];
|
|
@@ -5092,23 +5624,25 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
|
|
|
5092
5624
|
* @returns {string}
|
|
5093
5625
|
*/
|
|
5094
5626
|
export function mcs_smiles_json_with_ring_config(smiles_json, ring_matches_ring_only, complete_rings_only) {
|
|
5095
|
-
let
|
|
5096
|
-
let
|
|
5627
|
+
let deferred5_0;
|
|
5628
|
+
let deferred5_1;
|
|
5097
5629
|
try {
|
|
5630
|
+
const val2 = +ring_matches_ring_only;
|
|
5631
|
+
const val3 = +complete_rings_only;
|
|
5098
5632
|
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5099
5633
|
const len0 = WASM_VECTOR_LEN;
|
|
5100
|
-
const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0,
|
|
5101
|
-
var
|
|
5102
|
-
var
|
|
5634
|
+
const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, val2, val3);
|
|
5635
|
+
var ptr4 = ret[0];
|
|
5636
|
+
var len4 = ret[1];
|
|
5103
5637
|
if (ret[3]) {
|
|
5104
|
-
|
|
5638
|
+
ptr4 = 0; len4 = 0;
|
|
5105
5639
|
throw takeFromExternrefTable0(ret[2]);
|
|
5106
5640
|
}
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
return getStringFromWasm0(
|
|
5641
|
+
deferred5_0 = ptr4;
|
|
5642
|
+
deferred5_1 = len4;
|
|
5643
|
+
return getStringFromWasm0(ptr4, len4);
|
|
5110
5644
|
} finally {
|
|
5111
|
-
wasm.__wbindgen_free(
|
|
5645
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
5112
5646
|
}
|
|
5113
5647
|
}
|
|
5114
5648
|
|
|
@@ -5224,19 +5758,27 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
|
|
|
5224
5758
|
* @returns {string}
|
|
5225
5759
|
*/
|
|
5226
5760
|
export function minimize_uff_json(smiles, coords_json, max_iter) {
|
|
5227
|
-
let
|
|
5228
|
-
let
|
|
5761
|
+
let deferred4_0;
|
|
5762
|
+
let deferred4_1;
|
|
5229
5763
|
try {
|
|
5230
|
-
const
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5764
|
+
const val3 = +max_iter;
|
|
5765
|
+
let ptr0, len0, ptr1, len1;
|
|
5766
|
+
try {
|
|
5767
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5768
|
+
len0 = WASM_VECTOR_LEN;
|
|
5769
|
+
ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5770
|
+
len1 = WASM_VECTOR_LEN;
|
|
5771
|
+
} catch (e) {
|
|
5772
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
5773
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
5774
|
+
throw e;
|
|
5775
|
+
}
|
|
5776
|
+
const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, val3);
|
|
5777
|
+
deferred4_0 = ret[0];
|
|
5778
|
+
deferred4_1 = ret[1];
|
|
5237
5779
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
5238
5780
|
} finally {
|
|
5239
|
-
wasm.__wbindgen_free(
|
|
5781
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
5240
5782
|
}
|
|
5241
5783
|
}
|
|
5242
5784
|
|
|
@@ -5417,18 +5959,19 @@ export function mmff94_energy_breakdown_from_coords_json(mol, coords_json) {
|
|
|
5417
5959
|
* @returns {string}
|
|
5418
5960
|
*/
|
|
5419
5961
|
export function mmff94_energy_breakdown_from_coords_json_with_options(mol, coords_json, ignore_interfrag_interactions) {
|
|
5420
|
-
let
|
|
5421
|
-
let
|
|
5962
|
+
let deferred3_0;
|
|
5963
|
+
let deferred3_1;
|
|
5422
5964
|
try {
|
|
5423
5965
|
_assertClass(mol, MolHandle);
|
|
5966
|
+
const val2 = +ignore_interfrag_interactions;
|
|
5424
5967
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5425
5968
|
const len0 = WASM_VECTOR_LEN;
|
|
5426
|
-
const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0,
|
|
5427
|
-
|
|
5428
|
-
|
|
5969
|
+
const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0, val2);
|
|
5970
|
+
deferred3_0 = ret[0];
|
|
5971
|
+
deferred3_1 = ret[1];
|
|
5429
5972
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
5430
5973
|
} finally {
|
|
5431
|
-
wasm.__wbindgen_free(
|
|
5974
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
5432
5975
|
}
|
|
5433
5976
|
}
|
|
5434
5977
|
|
|
@@ -5662,9 +6205,10 @@ export function mol_block_stereo_loss_json(mol) {
|
|
|
5662
6205
|
* @returns {MolHandle}
|
|
5663
6206
|
*/
|
|
5664
6207
|
export function mol_from_ccd(text, allow_stereo_loss) {
|
|
6208
|
+
const val2 = +allow_stereo_loss;
|
|
5665
6209
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5666
6210
|
const len0 = WASM_VECTOR_LEN;
|
|
5667
|
-
const ret = wasm.mol_from_ccd(ptr0, len0,
|
|
6211
|
+
const ret = wasm.mol_from_ccd(ptr0, len0, val2);
|
|
5668
6212
|
if (ret[2]) {
|
|
5669
6213
|
throw takeFromExternrefTable0(ret[1]);
|
|
5670
6214
|
}
|
|
@@ -5696,9 +6240,10 @@ export function mol_from_cdxml(cdxml) {
|
|
|
5696
6240
|
* @returns {MolHandle}
|
|
5697
6241
|
*/
|
|
5698
6242
|
export function mol_from_cdxml_with_options(cdxml, infer_nondirectional_stereo) {
|
|
6243
|
+
const val2 = +infer_nondirectional_stereo;
|
|
5699
6244
|
const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5700
6245
|
const len0 = WASM_VECTOR_LEN;
|
|
5701
|
-
const ret = wasm.mol_from_cdxml_with_options(ptr0, len0,
|
|
6246
|
+
const ret = wasm.mol_from_cdxml_with_options(ptr0, len0, val2);
|
|
5702
6247
|
if (ret[2]) {
|
|
5703
6248
|
throw takeFromExternrefTable0(ret[1]);
|
|
5704
6249
|
}
|
|
@@ -5786,7 +6331,8 @@ export function mol_from_cube(text) {
|
|
|
5786
6331
|
* too. Only the first frame of a multi-frame file is read.
|
|
5787
6332
|
*
|
|
5788
6333
|
* Returns a JS error on parse failure or if the frame exceeds the WASM
|
|
5789
|
-
* atom-count limit.
|
|
6334
|
+
* atom-count limit. Coordinates, cell entries and R atom data must be finite;
|
|
6335
|
+
* nonzero decimals that round to binary64 zero are refused.
|
|
5790
6336
|
* @param {string} text
|
|
5791
6337
|
* @returns {MolHandle}
|
|
5792
6338
|
*/
|
|
@@ -5820,10 +6366,10 @@ export function mol_from_mmcif(text) {
|
|
|
5820
6366
|
}
|
|
5821
6367
|
|
|
5822
6368
|
/**
|
|
5823
|
-
* Parse
|
|
5824
|
-
*
|
|
5825
|
-
*
|
|
5826
|
-
*
|
|
6369
|
+
* Parse chematic's atom-record MolJSON graph dialect, not oxpig MolJSON.
|
|
6370
|
+
* Range/type checks, exact bond orders (4 = quadruple), unique keys/IDs and
|
|
6371
|
+
* valid nonduplicate bonds are enforced. Throws on invalid input; source
|
|
6372
|
+
* metadata and stereochemistry are outside this graph profile.
|
|
5827
6373
|
* @param {string} json
|
|
5828
6374
|
* @returns {MolHandle}
|
|
5829
6375
|
*/
|
|
@@ -5885,9 +6431,10 @@ export function mol_from_pdb(pdb) {
|
|
|
5885
6431
|
* @returns {MolHandle}
|
|
5886
6432
|
*/
|
|
5887
6433
|
export function mol_from_pdb_conect(input, allow_extended_targets) {
|
|
6434
|
+
const val2 = +allow_extended_targets;
|
|
5888
6435
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
5889
6436
|
const len0 = WASM_VECTOR_LEN;
|
|
5890
|
-
const ret = wasm.mol_from_pdb_conect(ptr0, len0,
|
|
6437
|
+
const ret = wasm.mol_from_pdb_conect(ptr0, len0, val2);
|
|
5891
6438
|
if (ret[2]) {
|
|
5892
6439
|
throw takeFromExternrefTable0(ret[1]);
|
|
5893
6440
|
}
|
|
@@ -5913,9 +6460,9 @@ export function mol_from_pdb_strict(pdb) {
|
|
|
5913
6460
|
/**
|
|
5914
6461
|
* Parse an AutoDock PDBQT block into a topology handle.
|
|
5915
6462
|
*
|
|
5916
|
-
* Coordinates and partial charges are
|
|
5917
|
-
*
|
|
5918
|
-
*
|
|
6463
|
+
* Coordinates and partial charges are discarded; use `pdbqt_atom_data_json`
|
|
6464
|
+
* when those arrays are needed. No bonds are inferred. Invalid records
|
|
6465
|
+
* return a JS error instead of a partial molecule.
|
|
5919
6466
|
* @param {string} pdbqt
|
|
5920
6467
|
* @returns {MolHandle}
|
|
5921
6468
|
*/
|
|
@@ -6004,7 +6551,9 @@ export function mol_from_v3000_block(block) {
|
|
|
6004
6551
|
/**
|
|
6005
6552
|
* Parse an XYZ file and return a `MolHandle` (topology only; coordinates are discarded).
|
|
6006
6553
|
*
|
|
6007
|
-
* Returns a JS error on parse failure
|
|
6554
|
+
* Returns a JS error on parse failure, nonfinite coordinates or a nonzero
|
|
6555
|
+
* decimal coordinate that rounds to binary64 zero. Literal signed zero and
|
|
6556
|
+
* finite subnormals remain valid.
|
|
6008
6557
|
* @param {string} xyz
|
|
6009
6558
|
* @returns {MolHandle}
|
|
6010
6559
|
*/
|
|
@@ -6106,9 +6655,10 @@ export function mol_with_atom_charge(mol, idx, charge) {
|
|
|
6106
6655
|
*/
|
|
6107
6656
|
export function mol_with_atom_element(mol, idx, element_symbol) {
|
|
6108
6657
|
_assertClass(mol, MolHandle);
|
|
6658
|
+
const val2 = +idx;
|
|
6109
6659
|
const ptr0 = passStringToWasm0(element_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6110
6660
|
const len0 = WASM_VECTOR_LEN;
|
|
6111
|
-
const ret = wasm.mol_with_atom_element(mol.__wbg_ptr,
|
|
6661
|
+
const ret = wasm.mol_with_atom_element(mol.__wbg_ptr, val2, ptr0, len0);
|
|
6112
6662
|
if (ret[2]) {
|
|
6113
6663
|
throw takeFromExternrefTable0(ret[1]);
|
|
6114
6664
|
}
|
|
@@ -6124,9 +6674,10 @@ export function mol_with_atom_element(mol, idx, element_symbol) {
|
|
|
6124
6674
|
*/
|
|
6125
6675
|
export function mol_with_atom_pseudo_label(mol, idx, label) {
|
|
6126
6676
|
_assertClass(mol, MolHandle);
|
|
6677
|
+
const val2 = +idx;
|
|
6127
6678
|
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6128
6679
|
const len0 = WASM_VECTOR_LEN;
|
|
6129
|
-
const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr,
|
|
6680
|
+
const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr, val2, ptr0, len0);
|
|
6130
6681
|
if (ret[2]) {
|
|
6131
6682
|
throw takeFromExternrefTable0(ret[1]);
|
|
6132
6683
|
}
|
|
@@ -6189,6 +6740,56 @@ export function mol_with_bond_removed(mol, idx) {
|
|
|
6189
6740
|
return MolHandle.__wrap(ret[0]);
|
|
6190
6741
|
}
|
|
6191
6742
|
|
|
6743
|
+
/**
|
|
6744
|
+
* @param {string} json
|
|
6745
|
+
* @returns {string}
|
|
6746
|
+
*/
|
|
6747
|
+
export function molden_from_record_json(json) {
|
|
6748
|
+
let deferred3_0;
|
|
6749
|
+
let deferred3_1;
|
|
6750
|
+
try {
|
|
6751
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6752
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6753
|
+
const ret = wasm.molden_from_record_json(ptr0, len0);
|
|
6754
|
+
var ptr2 = ret[0];
|
|
6755
|
+
var len2 = ret[1];
|
|
6756
|
+
if (ret[3]) {
|
|
6757
|
+
ptr2 = 0; len2 = 0;
|
|
6758
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6759
|
+
}
|
|
6760
|
+
deferred3_0 = ptr2;
|
|
6761
|
+
deferred3_1 = len2;
|
|
6762
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6763
|
+
} finally {
|
|
6764
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6765
|
+
}
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6768
|
+
/**
|
|
6769
|
+
* @param {string} text
|
|
6770
|
+
* @returns {string}
|
|
6771
|
+
*/
|
|
6772
|
+
export function molden_record_json(text) {
|
|
6773
|
+
let deferred3_0;
|
|
6774
|
+
let deferred3_1;
|
|
6775
|
+
try {
|
|
6776
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6777
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6778
|
+
const ret = wasm.molden_record_json(ptr0, len0);
|
|
6779
|
+
var ptr2 = ret[0];
|
|
6780
|
+
var len2 = ret[1];
|
|
6781
|
+
if (ret[3]) {
|
|
6782
|
+
ptr2 = 0; len2 = 0;
|
|
6783
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6784
|
+
}
|
|
6785
|
+
deferred3_0 = ptr2;
|
|
6786
|
+
deferred3_1 = len2;
|
|
6787
|
+
return getStringFromWasm0(ptr2, len2);
|
|
6788
|
+
} finally {
|
|
6789
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
6790
|
+
}
|
|
6791
|
+
}
|
|
6792
|
+
|
|
6192
6793
|
/**
|
|
6193
6794
|
* Generate a complete molecular report (JSON string) from a SMILES.
|
|
6194
6795
|
* Returns the JSON representation of a `MoleculeReport` struct.
|
|
@@ -6225,23 +6826,31 @@ export function molecule_report_json(smiles) {
|
|
|
6225
6826
|
|
|
6226
6827
|
/**
|
|
6227
6828
|
* Concrete CDX/CDXML fragment handles, in source fragment order.
|
|
6228
|
-
* @param {Uint8Array} data
|
|
6829
|
+
* @param {Uint8Array | number[]} data
|
|
6229
6830
|
* @param {string} format
|
|
6230
6831
|
* @param {boolean} allow_metadata_loss
|
|
6231
6832
|
* @returns {MolHandle[]}
|
|
6232
6833
|
*/
|
|
6233
6834
|
export function mols_from_chemdraw_block(data, format, allow_metadata_loss) {
|
|
6234
|
-
const
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6835
|
+
const val3 = +allow_metadata_loss;
|
|
6836
|
+
let ptr0, len0, ptr1, len1;
|
|
6837
|
+
try {
|
|
6838
|
+
ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
6839
|
+
len0 = WASM_VECTOR_LEN;
|
|
6840
|
+
ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6841
|
+
len1 = WASM_VECTOR_LEN;
|
|
6842
|
+
} catch (e) {
|
|
6843
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
6844
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
6845
|
+
throw e;
|
|
6846
|
+
}
|
|
6847
|
+
const ret = wasm.mols_from_chemdraw_block(ptr0, len0, ptr1, len1, val3);
|
|
6239
6848
|
if (ret[3]) {
|
|
6240
6849
|
throw takeFromExternrefTable0(ret[2]);
|
|
6241
6850
|
}
|
|
6242
|
-
var
|
|
6851
|
+
var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
6243
6852
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
6244
|
-
return
|
|
6853
|
+
return v4;
|
|
6245
6854
|
}
|
|
6246
6855
|
|
|
6247
6856
|
/**
|
|
@@ -6307,19 +6916,27 @@ export function murcko_scaffold(mol) {
|
|
|
6307
6916
|
* @returns {string}
|
|
6308
6917
|
*/
|
|
6309
6918
|
export function nearest_neighbors_json(query_smiles, db_smiles_json, k) {
|
|
6310
|
-
let
|
|
6311
|
-
let
|
|
6919
|
+
let deferred4_0;
|
|
6920
|
+
let deferred4_1;
|
|
6312
6921
|
try {
|
|
6313
|
-
const
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6922
|
+
const val3 = +k;
|
|
6923
|
+
let ptr0, len0, ptr1, len1;
|
|
6924
|
+
try {
|
|
6925
|
+
ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6926
|
+
len0 = WASM_VECTOR_LEN;
|
|
6927
|
+
ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6928
|
+
len1 = WASM_VECTOR_LEN;
|
|
6929
|
+
} catch (e) {
|
|
6930
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
6931
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
6932
|
+
throw e;
|
|
6933
|
+
}
|
|
6934
|
+
const ret = wasm.nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
|
|
6935
|
+
deferred4_0 = ret[0];
|
|
6936
|
+
deferred4_1 = ret[1];
|
|
6320
6937
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
6321
6938
|
} finally {
|
|
6322
|
-
wasm.__wbindgen_free(
|
|
6939
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
6323
6940
|
}
|
|
6324
6941
|
}
|
|
6325
6942
|
|
|
@@ -6363,6 +6980,35 @@ export function normalize_cxsmiles(s) {
|
|
|
6363
6980
|
}
|
|
6364
6981
|
}
|
|
6365
6982
|
|
|
6983
|
+
/**
|
|
6984
|
+
* Enhanced-atom-stereo reaction CXSMILES with group indices remapped after
|
|
6985
|
+
* component/atom ordering (RDKit #9732). Other CX fields are rejected.
|
|
6986
|
+
* @param {string} text
|
|
6987
|
+
* @param {boolean} canonical
|
|
6988
|
+
* @returns {string}
|
|
6989
|
+
*/
|
|
6990
|
+
export function normalize_reaction_cxsmiles(text, canonical) {
|
|
6991
|
+
let deferred4_0;
|
|
6992
|
+
let deferred4_1;
|
|
6993
|
+
try {
|
|
6994
|
+
const val2 = +canonical;
|
|
6995
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6996
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6997
|
+
const ret = wasm.normalize_reaction_cxsmiles(ptr0, len0, val2);
|
|
6998
|
+
var ptr3 = ret[0];
|
|
6999
|
+
var len3 = ret[1];
|
|
7000
|
+
if (ret[3]) {
|
|
7001
|
+
ptr3 = 0; len3 = 0;
|
|
7002
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7003
|
+
}
|
|
7004
|
+
deferred4_0 = ptr3;
|
|
7005
|
+
deferred4_1 = len3;
|
|
7006
|
+
return getStringFromWasm0(ptr3, len3);
|
|
7007
|
+
} finally {
|
|
7008
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7009
|
+
}
|
|
7010
|
+
}
|
|
7011
|
+
|
|
6366
7012
|
/**
|
|
6367
7013
|
* Parse and re-serialise a reaction SMILES string, returning the normalised form.
|
|
6368
7014
|
*
|
|
@@ -6403,10 +7049,17 @@ export function nucleic_acid_apply_json_command(document_json, command_json) {
|
|
|
6403
7049
|
let deferred3_0;
|
|
6404
7050
|
let deferred3_1;
|
|
6405
7051
|
try {
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
7052
|
+
let ptr0, len0, ptr1, len1;
|
|
7053
|
+
try {
|
|
7054
|
+
ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7055
|
+
len0 = WASM_VECTOR_LEN;
|
|
7056
|
+
ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7057
|
+
len1 = WASM_VECTOR_LEN;
|
|
7058
|
+
} catch (e) {
|
|
7059
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
7060
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
7061
|
+
throw e;
|
|
7062
|
+
}
|
|
6410
7063
|
const ret = wasm.nucleic_acid_apply_json_command(ptr0, len0, ptr1, len1);
|
|
6411
7064
|
deferred3_0 = ret[0];
|
|
6412
7065
|
deferred3_1 = ret[1];
|
|
@@ -6452,22 +7105,72 @@ export function num_hydrogens(mol) {
|
|
|
6452
7105
|
}
|
|
6453
7106
|
|
|
6454
7107
|
/**
|
|
6455
|
-
*
|
|
6456
|
-
* [`chematic_mol::VolumetricGrid`] as JSON (same shape as
|
|
6457
|
-
* [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
|
|
6458
|
-
* section). No `mol_from_opendx` is provided: an OpenDX grid never carries
|
|
6459
|
-
* atoms, so a `MolHandle` from one would always be empty and is not a
|
|
6460
|
-
* useful binding.
|
|
6461
|
-
* @param {string} text
|
|
7108
|
+
* @param {string} json
|
|
6462
7109
|
* @returns {string}
|
|
6463
7110
|
*/
|
|
6464
|
-
export function
|
|
7111
|
+
export function nwchem_geometry_from_json(json) {
|
|
6465
7112
|
let deferred3_0;
|
|
6466
7113
|
let deferred3_1;
|
|
6467
7114
|
try {
|
|
6468
|
-
const ptr0 = passStringToWasm0(
|
|
7115
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6469
7116
|
const len0 = WASM_VECTOR_LEN;
|
|
6470
|
-
const ret = wasm.
|
|
7117
|
+
const ret = wasm.nwchem_geometry_from_json(ptr0, len0);
|
|
7118
|
+
var ptr2 = ret[0];
|
|
7119
|
+
var len2 = ret[1];
|
|
7120
|
+
if (ret[3]) {
|
|
7121
|
+
ptr2 = 0; len2 = 0;
|
|
7122
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7123
|
+
}
|
|
7124
|
+
deferred3_0 = ptr2;
|
|
7125
|
+
deferred3_1 = len2;
|
|
7126
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7127
|
+
} finally {
|
|
7128
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7129
|
+
}
|
|
7130
|
+
}
|
|
7131
|
+
|
|
7132
|
+
/**
|
|
7133
|
+
* @param {string} text
|
|
7134
|
+
* @returns {string}
|
|
7135
|
+
*/
|
|
7136
|
+
export function nwchem_geometry_json(text) {
|
|
7137
|
+
let deferred3_0;
|
|
7138
|
+
let deferred3_1;
|
|
7139
|
+
try {
|
|
7140
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7141
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7142
|
+
const ret = wasm.nwchem_geometry_json(ptr0, len0);
|
|
7143
|
+
var ptr2 = ret[0];
|
|
7144
|
+
var len2 = ret[1];
|
|
7145
|
+
if (ret[3]) {
|
|
7146
|
+
ptr2 = 0; len2 = 0;
|
|
7147
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7148
|
+
}
|
|
7149
|
+
deferred3_0 = ptr2;
|
|
7150
|
+
deferred3_1 = len2;
|
|
7151
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7152
|
+
} finally {
|
|
7153
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7154
|
+
}
|
|
7155
|
+
}
|
|
7156
|
+
|
|
7157
|
+
/**
|
|
7158
|
+
* Parse an OpenDX (APBS scalar-field subset) file and return its full
|
|
7159
|
+
* [`chematic_mol::VolumetricGrid`] as JSON (same shape as
|
|
7160
|
+
* [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
|
|
7161
|
+
* section). No `mol_from_opendx` is provided: an OpenDX grid never carries
|
|
7162
|
+
* atoms, so a `MolHandle` from one would always be empty and is not a
|
|
7163
|
+
* useful binding.
|
|
7164
|
+
* @param {string} text
|
|
7165
|
+
* @returns {string}
|
|
7166
|
+
*/
|
|
7167
|
+
export function opendx_grid_json(text) {
|
|
7168
|
+
let deferred3_0;
|
|
7169
|
+
let deferred3_1;
|
|
7170
|
+
try {
|
|
7171
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7172
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7173
|
+
const ret = wasm.opendx_grid_json(ptr0, len0);
|
|
6471
7174
|
var ptr2 = ret[0];
|
|
6472
7175
|
var len2 = ret[1];
|
|
6473
7176
|
if (ret[3]) {
|
|
@@ -6513,12 +7216,42 @@ export function opendx_values_f64(text) {
|
|
|
6513
7216
|
return takeFromExternrefTable0(ret[0]);
|
|
6514
7217
|
}
|
|
6515
7218
|
|
|
7219
|
+
/**
|
|
7220
|
+
* Read ordered Cartesian values and explicit Angstrom/Bohr units; no rescaling.
|
|
7221
|
+
* Refuses ambiguous/unsupported unit or coordinate declarations and %coords.
|
|
7222
|
+
* Atom extras remain opaque; no external geometry resources are opened.
|
|
7223
|
+
* @param {string} text
|
|
7224
|
+
* @returns {string}
|
|
7225
|
+
*/
|
|
7226
|
+
export function orca_cartesian_geometry_json(text) {
|
|
7227
|
+
let deferred3_0;
|
|
7228
|
+
let deferred3_1;
|
|
7229
|
+
try {
|
|
7230
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7232
|
+
const ret = wasm.orca_cartesian_geometry_json(ptr0, len0);
|
|
7233
|
+
var ptr2 = ret[0];
|
|
7234
|
+
var len2 = ret[1];
|
|
7235
|
+
if (ret[3]) {
|
|
7236
|
+
ptr2 = 0; len2 = 0;
|
|
7237
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7238
|
+
}
|
|
7239
|
+
deferred3_0 = ptr2;
|
|
7240
|
+
deferred3_1 = len2;
|
|
7241
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7242
|
+
} finally {
|
|
7243
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
|
|
6516
7247
|
/**
|
|
6517
7248
|
* Coordinates + charge + multiplicity from an ORCA input file's embedded
|
|
6518
7249
|
* `* xyz ... *` block, in the SAME atom order [`mol_from_orca_input`]
|
|
6519
7250
|
* returns topology for. Returns JSON
|
|
6520
7251
|
* `{"coords":[[x,y,z],...],"charge":0,"multiplicity":1}`, or a JS error
|
|
6521
7252
|
* under the same conditions as [`mol_from_orca_input`].
|
|
7253
|
+
* This legacy view returns only Angstrom input. Bohr, conflicting units and
|
|
7254
|
+
* %coords overrides are refused; use [`orca_cartesian_geometry_json`] instead.
|
|
6522
7255
|
* @param {string} text
|
|
6523
7256
|
* @returns {string}
|
|
6524
7257
|
*/
|
|
@@ -6740,6 +7473,123 @@ export function parse_cxsmiles_json(s) {
|
|
|
6740
7473
|
}
|
|
6741
7474
|
}
|
|
6742
7475
|
|
|
7476
|
+
/**
|
|
7477
|
+
* Read a bounded fract record as editable JSON. All numeric fields are strings
|
|
7478
|
+
* retaining nominal precision and optional opaque uncertainty digits.
|
|
7479
|
+
* @param {string} text
|
|
7480
|
+
* @returns {string}
|
|
7481
|
+
*/
|
|
7482
|
+
export function parse_fract_json(text) {
|
|
7483
|
+
let deferred3_0;
|
|
7484
|
+
let deferred3_1;
|
|
7485
|
+
try {
|
|
7486
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7487
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7488
|
+
const ret = wasm.parse_fract_json(ptr0, len0);
|
|
7489
|
+
var ptr2 = ret[0];
|
|
7490
|
+
var len2 = ret[1];
|
|
7491
|
+
if (ret[3]) {
|
|
7492
|
+
ptr2 = 0; len2 = 0;
|
|
7493
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7494
|
+
}
|
|
7495
|
+
deferred3_0 = ptr2;
|
|
7496
|
+
deferred3_1 = len2;
|
|
7497
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7498
|
+
} finally {
|
|
7499
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7500
|
+
}
|
|
7501
|
+
}
|
|
7502
|
+
|
|
7503
|
+
/**
|
|
7504
|
+
* Inspect every ordered Cartesian job with UTF-8 byte ranges in the original source.
|
|
7505
|
+
* Coordinate units are unchanged; no inferred bonds or external resource reads.
|
|
7506
|
+
* @param {string} text
|
|
7507
|
+
* @returns {string}
|
|
7508
|
+
*/
|
|
7509
|
+
export function parse_gjf_document_json(text) {
|
|
7510
|
+
let deferred3_0;
|
|
7511
|
+
let deferred3_1;
|
|
7512
|
+
try {
|
|
7513
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7514
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7515
|
+
const ret = wasm.parse_gjf_document_json(ptr0, len0);
|
|
7516
|
+
var ptr2 = ret[0];
|
|
7517
|
+
var len2 = ret[1];
|
|
7518
|
+
if (ret[3]) {
|
|
7519
|
+
ptr2 = 0; len2 = 0;
|
|
7520
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7521
|
+
}
|
|
7522
|
+
deferred3_0 = ptr2;
|
|
7523
|
+
deferred3_1 = len2;
|
|
7524
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7525
|
+
} finally {
|
|
7526
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7527
|
+
}
|
|
7528
|
+
}
|
|
7529
|
+
|
|
7530
|
+
/**
|
|
7531
|
+
* Read gpr 100 / one coordinate set as editable JSON. Coordinates stay in nm;
|
|
7532
|
+
* partial charges and all decimal tokens retain source representation.
|
|
7533
|
+
* @param {string} text
|
|
7534
|
+
* @returns {string}
|
|
7535
|
+
*/
|
|
7536
|
+
export function parse_gpr_json(text) {
|
|
7537
|
+
let deferred3_0;
|
|
7538
|
+
let deferred3_1;
|
|
7539
|
+
try {
|
|
7540
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7541
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7542
|
+
const ret = wasm.parse_gpr_json(ptr0, len0);
|
|
7543
|
+
var ptr2 = ret[0];
|
|
7544
|
+
var len2 = ret[1];
|
|
7545
|
+
if (ret[3]) {
|
|
7546
|
+
ptr2 = 0; len2 = 0;
|
|
7547
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7548
|
+
}
|
|
7549
|
+
deferred3_0 = ptr2;
|
|
7550
|
+
deferred3_1 = len2;
|
|
7551
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7552
|
+
} finally {
|
|
7553
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7554
|
+
}
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
/**
|
|
7558
|
+
* Read geometry as editable JSON, with all blocks, fixed-width payload and caller-owned length-unit context.
|
|
7559
|
+
* @param {string} text
|
|
7560
|
+
* @param {string} length_unit
|
|
7561
|
+
* @returns {string}
|
|
7562
|
+
*/
|
|
7563
|
+
export function parse_gromos96_json(text, length_unit) {
|
|
7564
|
+
let deferred4_0;
|
|
7565
|
+
let deferred4_1;
|
|
7566
|
+
try {
|
|
7567
|
+
let ptr0, len0, ptr1, len1;
|
|
7568
|
+
try {
|
|
7569
|
+
ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7570
|
+
len0 = WASM_VECTOR_LEN;
|
|
7571
|
+
ptr1 = passStringToWasm0(length_unit, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7572
|
+
len1 = WASM_VECTOR_LEN;
|
|
7573
|
+
} catch (e) {
|
|
7574
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
7575
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
7576
|
+
throw e;
|
|
7577
|
+
}
|
|
7578
|
+
const ret = wasm.parse_gromos96_json(ptr0, len0, ptr1, len1);
|
|
7579
|
+
var ptr3 = ret[0];
|
|
7580
|
+
var len3 = ret[1];
|
|
7581
|
+
if (ret[3]) {
|
|
7582
|
+
ptr3 = 0; len3 = 0;
|
|
7583
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7584
|
+
}
|
|
7585
|
+
deferred4_0 = ptr3;
|
|
7586
|
+
deferred4_1 = len3;
|
|
7587
|
+
return getStringFromWasm0(ptr3, len3);
|
|
7588
|
+
} finally {
|
|
7589
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7590
|
+
}
|
|
7591
|
+
}
|
|
7592
|
+
|
|
6743
7593
|
/**
|
|
6744
7594
|
* Inspect the bounded HIN record, including literal aromatic bonds and charges.
|
|
6745
7595
|
* @param {string} text
|
|
@@ -6766,6 +7616,32 @@ export function parse_hin_record_json(text) {
|
|
|
6766
7616
|
}
|
|
6767
7617
|
}
|
|
6768
7618
|
|
|
7619
|
+
/**
|
|
7620
|
+
* Read geometry as editable JSON, with raw decimal fields, all frames and column order.
|
|
7621
|
+
* @param {string} text
|
|
7622
|
+
* @returns {string}
|
|
7623
|
+
*/
|
|
7624
|
+
export function parse_lpmd_json(text) {
|
|
7625
|
+
let deferred3_0;
|
|
7626
|
+
let deferred3_1;
|
|
7627
|
+
try {
|
|
7628
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7630
|
+
const ret = wasm.parse_lpmd_json(ptr0, len0);
|
|
7631
|
+
var ptr2 = ret[0];
|
|
7632
|
+
var len2 = ret[1];
|
|
7633
|
+
if (ret[3]) {
|
|
7634
|
+
ptr2 = 0; len2 = 0;
|
|
7635
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7636
|
+
}
|
|
7637
|
+
deferred3_0 = ptr2;
|
|
7638
|
+
deferred3_1 = len2;
|
|
7639
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7640
|
+
} finally {
|
|
7641
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7642
|
+
}
|
|
7643
|
+
}
|
|
7644
|
+
|
|
6769
7645
|
/**
|
|
6770
7646
|
* Inspect partial charges, atom types and source retention for MOL2.
|
|
6771
7647
|
* @param {string} text
|
|
@@ -6810,19 +7686,18 @@ export function parse_smiles(s) {
|
|
|
6810
7686
|
}
|
|
6811
7687
|
|
|
6812
7688
|
/**
|
|
6813
|
-
*
|
|
6814
|
-
*
|
|
6815
|
-
* @param {string}
|
|
6816
|
-
* @param {boolean} allow_extended_targets
|
|
7689
|
+
* Read a bounded UniChem XYZ record as editable JSON. Coordinate fields are decimal strings
|
|
7690
|
+
* retaining precision and signed zero in Angstrom.
|
|
7691
|
+
* @param {string} text
|
|
6817
7692
|
* @returns {string}
|
|
6818
7693
|
*/
|
|
6819
|
-
export function
|
|
7694
|
+
export function parse_unixyz_json(text) {
|
|
6820
7695
|
let deferred3_0;
|
|
6821
7696
|
let deferred3_1;
|
|
6822
7697
|
try {
|
|
6823
|
-
const ptr0 = passStringToWasm0(
|
|
7698
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6824
7699
|
const len0 = WASM_VECTOR_LEN;
|
|
6825
|
-
const ret = wasm.
|
|
7700
|
+
const ret = wasm.parse_unixyz_json(ptr0, len0);
|
|
6826
7701
|
var ptr2 = ret[0];
|
|
6827
7702
|
var len2 = ret[1];
|
|
6828
7703
|
if (ret[3]) {
|
|
@@ -6837,6 +7712,61 @@ export function pdb_conect_frame_json(input, allow_extended_targets) {
|
|
|
6837
7712
|
}
|
|
6838
7713
|
}
|
|
6839
7714
|
|
|
7715
|
+
/**
|
|
7716
|
+
* Read geometry as editable JSON, with raw factor/coordinate strings and fixed axes.
|
|
7717
|
+
* @param {string} text
|
|
7718
|
+
* @returns {string}
|
|
7719
|
+
*/
|
|
7720
|
+
export function parse_viewmol_json(text) {
|
|
7721
|
+
let deferred3_0;
|
|
7722
|
+
let deferred3_1;
|
|
7723
|
+
try {
|
|
7724
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7725
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7726
|
+
const ret = wasm.parse_viewmol_json(ptr0, len0);
|
|
7727
|
+
var ptr2 = ret[0];
|
|
7728
|
+
var len2 = ret[1];
|
|
7729
|
+
if (ret[3]) {
|
|
7730
|
+
ptr2 = 0; len2 = 0;
|
|
7731
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7732
|
+
}
|
|
7733
|
+
deferred3_0 = ptr2;
|
|
7734
|
+
deferred3_1 = len2;
|
|
7735
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7736
|
+
} finally {
|
|
7737
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7738
|
+
}
|
|
7739
|
+
}
|
|
7740
|
+
|
|
7741
|
+
/**
|
|
7742
|
+
* Indexed atoms/charges, bonds, coordinates and source serials for the same
|
|
7743
|
+
* explicit CONECT projection. Molecular identity and coordinate order agree.
|
|
7744
|
+
* @param {string} input
|
|
7745
|
+
* @param {boolean} allow_extended_targets
|
|
7746
|
+
* @returns {string}
|
|
7747
|
+
*/
|
|
7748
|
+
export function pdb_conect_frame_json(input, allow_extended_targets) {
|
|
7749
|
+
let deferred4_0;
|
|
7750
|
+
let deferred4_1;
|
|
7751
|
+
try {
|
|
7752
|
+
const val2 = +allow_extended_targets;
|
|
7753
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7754
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7755
|
+
const ret = wasm.pdb_conect_frame_json(ptr0, len0, val2);
|
|
7756
|
+
var ptr3 = ret[0];
|
|
7757
|
+
var len3 = ret[1];
|
|
7758
|
+
if (ret[3]) {
|
|
7759
|
+
ptr3 = 0; len3 = 0;
|
|
7760
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7761
|
+
}
|
|
7762
|
+
deferred4_0 = ptr3;
|
|
7763
|
+
deferred4_1 = len3;
|
|
7764
|
+
return getStringFromWasm0(ptr3, len3);
|
|
7765
|
+
} finally {
|
|
7766
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7769
|
+
|
|
6840
7770
|
/**
|
|
6841
7771
|
* Extract the atomic coordinates from a PDB block, in the SAME atom order
|
|
6842
7772
|
* `mol_from_pdb` returns topology for (both read the identical underlying
|
|
@@ -6865,6 +7795,37 @@ export function pdb_coords_json(pdb) {
|
|
|
6865
7795
|
}
|
|
6866
7796
|
}
|
|
6867
7797
|
|
|
7798
|
+
/**
|
|
7799
|
+
* Read PDBQT atom data as JSON {atomic_numbers, coords, partial_charges}.
|
|
7800
|
+
* Arrays share source ATOM/HETATM order. Coordinates are in Å and partial
|
|
7801
|
+
* charges in e; parsed finite binary64 values are not rounded/recalculated.
|
|
7802
|
+
* No bonds or formal charges are inferred. Source atom identities, AutoDock
|
|
7803
|
+
* types, remarks and torsion trees are not retained. Throws on invalid atoms
|
|
7804
|
+
* or WASM size limits. Use mol_from_pdbqt separately for an element-only handle.
|
|
7805
|
+
* @param {string} pdbqt
|
|
7806
|
+
* @returns {string}
|
|
7807
|
+
*/
|
|
7808
|
+
export function pdbqt_atom_data_json(pdbqt) {
|
|
7809
|
+
let deferred3_0;
|
|
7810
|
+
let deferred3_1;
|
|
7811
|
+
try {
|
|
7812
|
+
const ptr0 = passStringToWasm0(pdbqt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7813
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7814
|
+
const ret = wasm.pdbqt_atom_data_json(ptr0, len0);
|
|
7815
|
+
var ptr2 = ret[0];
|
|
7816
|
+
var len2 = ret[1];
|
|
7817
|
+
if (ret[3]) {
|
|
7818
|
+
ptr2 = 0; len2 = 0;
|
|
7819
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7820
|
+
}
|
|
7821
|
+
deferred3_0 = ptr2;
|
|
7822
|
+
deferred3_1 = len2;
|
|
7823
|
+
return getStringFromWasm0(ptr2, len2);
|
|
7824
|
+
} finally {
|
|
7825
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
7826
|
+
}
|
|
7827
|
+
}
|
|
7828
|
+
|
|
6868
7829
|
/**
|
|
6869
7830
|
* PEOE_VSA descriptors (14 bins) as a JSON array.
|
|
6870
7831
|
* @param {MolHandle} mol
|
|
@@ -6895,10 +7856,17 @@ export function periodic_structure_fingerprint_json(json, source) {
|
|
|
6895
7856
|
let deferred3_0;
|
|
6896
7857
|
let deferred3_1;
|
|
6897
7858
|
try {
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
7859
|
+
let ptr0, len0, ptr1, len1;
|
|
7860
|
+
try {
|
|
7861
|
+
ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7862
|
+
len0 = WASM_VECTOR_LEN;
|
|
7863
|
+
ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7864
|
+
len1 = WASM_VECTOR_LEN;
|
|
7865
|
+
} catch (e) {
|
|
7866
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
7867
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
7868
|
+
throw e;
|
|
7869
|
+
}
|
|
6902
7870
|
const ret = wasm.periodic_structure_fingerprint_json(ptr0, len0, ptr1, len1);
|
|
6903
7871
|
deferred3_0 = ret[0];
|
|
6904
7872
|
deferred3_1 = ret[1];
|
|
@@ -6997,10 +7965,17 @@ export function pipeline_v2_stereo_safe_config_json(force_field, ring_torsion_po
|
|
|
6997
7965
|
let deferred3_0;
|
|
6998
7966
|
let deferred3_1;
|
|
6999
7967
|
try {
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7968
|
+
let ptr0, len0, ptr1, len1;
|
|
7969
|
+
try {
|
|
7970
|
+
ptr0 = passStringToWasm0(force_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7971
|
+
len0 = WASM_VECTOR_LEN;
|
|
7972
|
+
ptr1 = passStringToWasm0(ring_torsion_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7973
|
+
len1 = WASM_VECTOR_LEN;
|
|
7974
|
+
} catch (e) {
|
|
7975
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
7976
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
7977
|
+
throw e;
|
|
7978
|
+
}
|
|
7004
7979
|
const ret = wasm.pipeline_v2_stereo_safe_config_json(ptr0, len0, ptr1, len1);
|
|
7005
7980
|
deferred3_0 = ret[0];
|
|
7006
7981
|
deferred3_1 = ret[1];
|
|
@@ -7047,12 +8022,20 @@ export function pqr_coords_json(text) {
|
|
|
7047
8022
|
* @returns {string | undefined}
|
|
7048
8023
|
*/
|
|
7049
8024
|
export function pqr_infer_element(group_pdb, res_name, atom_name) {
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
8025
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
8026
|
+
try {
|
|
8027
|
+
ptr0 = passStringToWasm0(group_pdb, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8028
|
+
len0 = WASM_VECTOR_LEN;
|
|
8029
|
+
ptr1 = passStringToWasm0(res_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8030
|
+
len1 = WASM_VECTOR_LEN;
|
|
8031
|
+
ptr2 = passStringToWasm0(atom_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8032
|
+
len2 = WASM_VECTOR_LEN;
|
|
8033
|
+
} catch (e) {
|
|
8034
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
8035
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
8036
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
8037
|
+
throw e;
|
|
8038
|
+
}
|
|
7056
8039
|
const ret = wasm.pqr_infer_element(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
7057
8040
|
let v4;
|
|
7058
8041
|
if (ret[0] !== 0) {
|
|
@@ -7127,17 +8110,19 @@ export function predict_pka_json(smiles) {
|
|
|
7127
8110
|
* @returns {string}
|
|
7128
8111
|
*/
|
|
7129
8112
|
export function preflight_smiles_json(smiles, width, height) {
|
|
7130
|
-
let
|
|
7131
|
-
let
|
|
8113
|
+
let deferred4_0;
|
|
8114
|
+
let deferred4_1;
|
|
7132
8115
|
try {
|
|
8116
|
+
const val2 = +width;
|
|
8117
|
+
const val3 = +height;
|
|
7133
8118
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7134
8119
|
const len0 = WASM_VECTOR_LEN;
|
|
7135
|
-
const ret = wasm.preflight_smiles_json(ptr0, len0,
|
|
7136
|
-
|
|
7137
|
-
|
|
8120
|
+
const ret = wasm.preflight_smiles_json(ptr0, len0, val2, val3);
|
|
8121
|
+
deferred4_0 = ret[0];
|
|
8122
|
+
deferred4_1 = ret[1];
|
|
7138
8123
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
7139
8124
|
} finally {
|
|
7140
|
-
wasm.__wbindgen_free(
|
|
8125
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7141
8126
|
}
|
|
7142
8127
|
}
|
|
7143
8128
|
|
|
@@ -7156,7 +8141,60 @@ export function prepare_rdkit_ecfp4(mol) {
|
|
|
7156
8141
|
if (ret[2]) {
|
|
7157
8142
|
throw takeFromExternrefTable0(ret[1]);
|
|
7158
8143
|
}
|
|
7159
|
-
return PreparedRdkitEcfp4Handle.__wrap(ret[0]);
|
|
8144
|
+
return PreparedRdkitEcfp4Handle.__wrap(ret[0]);
|
|
8145
|
+
}
|
|
8146
|
+
|
|
8147
|
+
/**
|
|
8148
|
+
* Checked local CJSON graph/Cartesian/name projection; throws on opaque
|
|
8149
|
+
* fields, partial charges or conflicting names. No source chemistry validation.
|
|
8150
|
+
* @param {string} text
|
|
8151
|
+
* @returns {string}
|
|
8152
|
+
*/
|
|
8153
|
+
export function project_cjson_to_cml(text) {
|
|
8154
|
+
let deferred3_0;
|
|
8155
|
+
let deferred3_1;
|
|
8156
|
+
try {
|
|
8157
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8158
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8159
|
+
const ret = wasm.project_cjson_to_cml(ptr0, len0);
|
|
8160
|
+
var ptr2 = ret[0];
|
|
8161
|
+
var len2 = ret[1];
|
|
8162
|
+
if (ret[3]) {
|
|
8163
|
+
ptr2 = 0; len2 = 0;
|
|
8164
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8165
|
+
}
|
|
8166
|
+
deferred3_0 = ptr2;
|
|
8167
|
+
deferred3_1 = len2;
|
|
8168
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8169
|
+
} finally {
|
|
8170
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8171
|
+
}
|
|
8172
|
+
}
|
|
8173
|
+
|
|
8174
|
+
/**
|
|
8175
|
+
* Checked CML graph/Cartesian/name profile; refuses unrepresented payload.
|
|
8176
|
+
* @param {string} text
|
|
8177
|
+
* @returns {string}
|
|
8178
|
+
*/
|
|
8179
|
+
export function project_cml_to_cjson(text) {
|
|
8180
|
+
let deferred3_0;
|
|
8181
|
+
let deferred3_1;
|
|
8182
|
+
try {
|
|
8183
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8184
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8185
|
+
const ret = wasm.project_cml_to_cjson(ptr0, len0);
|
|
8186
|
+
var ptr2 = ret[0];
|
|
8187
|
+
var len2 = ret[1];
|
|
8188
|
+
if (ret[3]) {
|
|
8189
|
+
ptr2 = 0; len2 = 0;
|
|
8190
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8191
|
+
}
|
|
8192
|
+
deferred3_0 = ptr2;
|
|
8193
|
+
deferred3_1 = len2;
|
|
8194
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8195
|
+
} finally {
|
|
8196
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8197
|
+
}
|
|
7160
8198
|
}
|
|
7161
8199
|
|
|
7162
8200
|
/**
|
|
@@ -7324,23 +8362,25 @@ export function qcschema_validate_atomic_result(json) {
|
|
|
7324
8362
|
* @returns {string}
|
|
7325
8363
|
*/
|
|
7326
8364
|
export function random_smiles_json(smiles, count, seed) {
|
|
7327
|
-
let
|
|
7328
|
-
let
|
|
8365
|
+
let deferred5_0;
|
|
8366
|
+
let deferred5_1;
|
|
7329
8367
|
try {
|
|
8368
|
+
const val2 = +count;
|
|
8369
|
+
const val3 = BigInt.asIntN(64, seed);
|
|
7330
8370
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7331
8371
|
const len0 = WASM_VECTOR_LEN;
|
|
7332
|
-
const ret = wasm.random_smiles_json(ptr0, len0,
|
|
7333
|
-
var
|
|
7334
|
-
var
|
|
8372
|
+
const ret = wasm.random_smiles_json(ptr0, len0, val2, val3);
|
|
8373
|
+
var ptr4 = ret[0];
|
|
8374
|
+
var len4 = ret[1];
|
|
7335
8375
|
if (ret[3]) {
|
|
7336
|
-
|
|
8376
|
+
ptr4 = 0; len4 = 0;
|
|
7337
8377
|
throw takeFromExternrefTable0(ret[2]);
|
|
7338
8378
|
}
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
return getStringFromWasm0(
|
|
8379
|
+
deferred5_0 = ptr4;
|
|
8380
|
+
deferred5_1 = len4;
|
|
8381
|
+
return getStringFromWasm0(ptr4, len4);
|
|
7342
8382
|
} finally {
|
|
7343
|
-
wasm.__wbindgen_free(
|
|
8383
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
7344
8384
|
}
|
|
7345
8385
|
}
|
|
7346
8386
|
|
|
@@ -7363,6 +8403,36 @@ export function rdkit_atom_code(mol, atom_index, branch_subtract) {
|
|
|
7363
8403
|
return ret[0] >>> 0;
|
|
7364
8404
|
}
|
|
7365
8405
|
|
|
8406
|
+
/**
|
|
8407
|
+
* Return packed bits, folded counts and unhashed counts for 2D Atom Pair.
|
|
8408
|
+
* The JSON options are optional. Set `countBounds` to null to disable count
|
|
8409
|
+
* simulation. Counts are returned as sorted [identifier, count] arrays.
|
|
8410
|
+
* @param {MolHandle} mol
|
|
8411
|
+
* @param {string} options_json
|
|
8412
|
+
* @returns {string}
|
|
8413
|
+
*/
|
|
8414
|
+
export function rdkit_atom_pair_config_detail_json(mol, options_json) {
|
|
8415
|
+
let deferred3_0;
|
|
8416
|
+
let deferred3_1;
|
|
8417
|
+
try {
|
|
8418
|
+
_assertClass(mol, MolHandle);
|
|
8419
|
+
const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8420
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8421
|
+
const ret = wasm.rdkit_atom_pair_config_detail_json(mol.__wbg_ptr, ptr0, len0);
|
|
8422
|
+
var ptr2 = ret[0];
|
|
8423
|
+
var len2 = ret[1];
|
|
8424
|
+
if (ret[3]) {
|
|
8425
|
+
ptr2 = 0; len2 = 0;
|
|
8426
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8427
|
+
}
|
|
8428
|
+
deferred3_0 = ptr2;
|
|
8429
|
+
deferred3_1 = len2;
|
|
8430
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8431
|
+
} finally {
|
|
8432
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8433
|
+
}
|
|
8434
|
+
}
|
|
8435
|
+
|
|
7366
8436
|
/**
|
|
7367
8437
|
* RDKit-bit-exact ECFP4 (radius=2, 2048 bits, `useChirality=false`, `useBondTypes=true`,
|
|
7368
8438
|
* RDKit's default atom invariant) as a bit-packed byte vector (256 bytes = 2048 bits).
|
|
@@ -7532,9 +8602,12 @@ export function rdkit_ecfp_config_detail_json(mol, radius, nbits) {
|
|
|
7532
8602
|
* @returns {RdkitReadResult}
|
|
7533
8603
|
*/
|
|
7534
8604
|
export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substructures) {
|
|
8605
|
+
const val2 = +sanitize;
|
|
8606
|
+
const val3 = +remove_hs;
|
|
8607
|
+
const val4 = +cleanup_substructures;
|
|
7535
8608
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7536
8609
|
const len0 = WASM_VECTOR_LEN;
|
|
7537
|
-
const ret = wasm.rdkit_from_mol2_block(ptr0, len0,
|
|
8610
|
+
const ret = wasm.rdkit_from_mol2_block(ptr0, len0, val2, val3, val4);
|
|
7538
8611
|
if (ret[2]) {
|
|
7539
8612
|
throw takeFromExternrefTable0(ret[1]);
|
|
7540
8613
|
}
|
|
@@ -7551,9 +8624,13 @@ export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substru
|
|
|
7551
8624
|
* @returns {RdkitReadResult}
|
|
7552
8625
|
*/
|
|
7553
8626
|
export function rdkit_from_pdb_block(text, sanitize, remove_hs, flavor, proximity_bonding) {
|
|
8627
|
+
const val2 = +sanitize;
|
|
8628
|
+
const val3 = +remove_hs;
|
|
8629
|
+
const val4 = +flavor;
|
|
8630
|
+
const val5 = +proximity_bonding;
|
|
7554
8631
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7555
8632
|
const len0 = WASM_VECTOR_LEN;
|
|
7556
|
-
const ret = wasm.rdkit_from_pdb_block(ptr0, len0,
|
|
8633
|
+
const ret = wasm.rdkit_from_pdb_block(ptr0, len0, val2, val3, val4, val5);
|
|
7557
8634
|
if (ret[2]) {
|
|
7558
8635
|
throw takeFromExternrefTable0(ret[1]);
|
|
7559
8636
|
}
|
|
@@ -7575,6 +8652,36 @@ export function rdkit_from_xyz_block(text) {
|
|
|
7575
8652
|
return RdkitReadResult.__wrap(ret[0]);
|
|
7576
8653
|
}
|
|
7577
8654
|
|
|
8655
|
+
/**
|
|
8656
|
+
* Return the configured RDKit Layered fingerprint and per-atom counters as JSON.
|
|
8657
|
+
* Pass `{}` for defaults. `setOnlyBits` is an optional LSB-first packed byte
|
|
8658
|
+
* array, and `atomCounts` optionally seeds the returned u32 counters.
|
|
8659
|
+
* @param {MolHandle} mol
|
|
8660
|
+
* @param {string} options_json
|
|
8661
|
+
* @returns {string}
|
|
8662
|
+
*/
|
|
8663
|
+
export function rdkit_layered_config_detail_json(mol, options_json) {
|
|
8664
|
+
let deferred3_0;
|
|
8665
|
+
let deferred3_1;
|
|
8666
|
+
try {
|
|
8667
|
+
_assertClass(mol, MolHandle);
|
|
8668
|
+
const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8669
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8670
|
+
const ret = wasm.rdkit_layered_config_detail_json(mol.__wbg_ptr, ptr0, len0);
|
|
8671
|
+
var ptr2 = ret[0];
|
|
8672
|
+
var len2 = ret[1];
|
|
8673
|
+
if (ret[3]) {
|
|
8674
|
+
ptr2 = 0; len2 = 0;
|
|
8675
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8676
|
+
}
|
|
8677
|
+
deferred3_0 = ptr2;
|
|
8678
|
+
deferred3_1 = len2;
|
|
8679
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8680
|
+
} finally {
|
|
8681
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8682
|
+
}
|
|
8683
|
+
}
|
|
8684
|
+
|
|
7578
8685
|
/**
|
|
7579
8686
|
* Find the k nearest neighbours using the RDKit-compatible Morgan/ECFP4
|
|
7580
8687
|
* profile. This is intentionally separate from [`nearest_neighbors_json`],
|
|
@@ -7589,19 +8696,27 @@ export function rdkit_from_xyz_block(text) {
|
|
|
7589
8696
|
* @returns {string}
|
|
7590
8697
|
*/
|
|
7591
8698
|
export function rdkit_nearest_neighbors_json(query_smiles, db_smiles_json, k) {
|
|
7592
|
-
let
|
|
7593
|
-
let
|
|
8699
|
+
let deferred4_0;
|
|
8700
|
+
let deferred4_1;
|
|
7594
8701
|
try {
|
|
7595
|
-
const
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
8702
|
+
const val3 = +k;
|
|
8703
|
+
let ptr0, len0, ptr1, len1;
|
|
8704
|
+
try {
|
|
8705
|
+
ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8706
|
+
len0 = WASM_VECTOR_LEN;
|
|
8707
|
+
ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8708
|
+
len1 = WASM_VECTOR_LEN;
|
|
8709
|
+
} catch (e) {
|
|
8710
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
8711
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
8712
|
+
throw e;
|
|
8713
|
+
}
|
|
8714
|
+
const ret = wasm.rdkit_nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
|
|
8715
|
+
deferred4_0 = ret[0];
|
|
8716
|
+
deferred4_1 = ret[1];
|
|
7602
8717
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
7603
8718
|
} finally {
|
|
7604
|
-
wasm.__wbindgen_free(
|
|
8719
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7605
8720
|
}
|
|
7606
8721
|
}
|
|
7607
8722
|
|
|
@@ -7641,7 +8756,7 @@ export function rdkit_rdk_bitvec(mol) {
|
|
|
7641
8756
|
* containing one of `ignored_atoms` is excluded. Invalid indices return a JS
|
|
7642
8757
|
* error; an empty list is bit-identical to [`rdkit_rdk_bitvec`].
|
|
7643
8758
|
* @param {MolHandle} mol
|
|
7644
|
-
* @param {Uint32Array} ignored_atoms
|
|
8759
|
+
* @param {Uint32Array | number[]} ignored_atoms
|
|
7645
8760
|
* @returns {Uint8Array}
|
|
7646
8761
|
*/
|
|
7647
8762
|
export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
|
|
@@ -7657,6 +8772,36 @@ export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
|
|
|
7657
8772
|
return v2;
|
|
7658
8773
|
}
|
|
7659
8774
|
|
|
8775
|
+
/**
|
|
8776
|
+
* Packed RDK bits and folded and sparse counts, using input atom indices.
|
|
8777
|
+
* A supplied `countBounds` array enables count simulation for the bit vector.
|
|
8778
|
+
* Packed bytes are LSB-first and counts are sorted [identifier, count] pairs.
|
|
8779
|
+
* @param {MolHandle} mol
|
|
8780
|
+
* @param {string} options_json
|
|
8781
|
+
* @returns {string}
|
|
8782
|
+
*/
|
|
8783
|
+
export function rdkit_rdk_config_detail_json(mol, options_json) {
|
|
8784
|
+
let deferred3_0;
|
|
8785
|
+
let deferred3_1;
|
|
8786
|
+
try {
|
|
8787
|
+
_assertClass(mol, MolHandle);
|
|
8788
|
+
const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8789
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8790
|
+
const ret = wasm.rdkit_rdk_config_detail_json(mol.__wbg_ptr, ptr0, len0);
|
|
8791
|
+
var ptr2 = ret[0];
|
|
8792
|
+
var len2 = ret[1];
|
|
8793
|
+
if (ret[3]) {
|
|
8794
|
+
ptr2 = 0; len2 = 0;
|
|
8795
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8796
|
+
}
|
|
8797
|
+
deferred3_0 = ptr2;
|
|
8798
|
+
deferred3_1 = len2;
|
|
8799
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8800
|
+
} finally {
|
|
8801
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8802
|
+
}
|
|
8803
|
+
}
|
|
8804
|
+
|
|
7660
8805
|
/**
|
|
7661
8806
|
* Pack a JSON array of atom indices into RDKit's legacy torsion code.
|
|
7662
8807
|
*
|
|
@@ -7703,6 +8848,36 @@ export function rdkit_torsion_bitvec(mol) {
|
|
|
7703
8848
|
return v1;
|
|
7704
8849
|
}
|
|
7705
8850
|
|
|
8851
|
+
/**
|
|
8852
|
+
* Return packed bits, folded counts and unhashed Topological Torsion counts.
|
|
8853
|
+
* Pass JSON options or `{}` for defaults. A null `countBounds` disables
|
|
8854
|
+
* simulation. Sparse identifiers are decimal strings to retain all 64 bits.
|
|
8855
|
+
* @param {MolHandle} mol
|
|
8856
|
+
* @param {string} options_json
|
|
8857
|
+
* @returns {string}
|
|
8858
|
+
*/
|
|
8859
|
+
export function rdkit_torsion_config_detail_json(mol, options_json) {
|
|
8860
|
+
let deferred3_0;
|
|
8861
|
+
let deferred3_1;
|
|
8862
|
+
try {
|
|
8863
|
+
_assertClass(mol, MolHandle);
|
|
8864
|
+
const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8865
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8866
|
+
const ret = wasm.rdkit_torsion_config_detail_json(mol.__wbg_ptr, ptr0, len0);
|
|
8867
|
+
var ptr2 = ret[0];
|
|
8868
|
+
var len2 = ret[1];
|
|
8869
|
+
if (ret[3]) {
|
|
8870
|
+
ptr2 = 0; len2 = 0;
|
|
8871
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
8872
|
+
}
|
|
8873
|
+
deferred3_0 = ptr2;
|
|
8874
|
+
deferred3_1 = len2;
|
|
8875
|
+
return getStringFromWasm0(ptr2, len2);
|
|
8876
|
+
} finally {
|
|
8877
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
8878
|
+
}
|
|
8879
|
+
}
|
|
8880
|
+
|
|
7706
8881
|
/**
|
|
7707
8882
|
* Validate and deterministically serialize a rich reaction document JSON.
|
|
7708
8883
|
*
|
|
@@ -7772,10 +8947,17 @@ export function reaction_document_to_rxn_v1(document_json) {
|
|
|
7772
8947
|
* @returns {boolean}
|
|
7773
8948
|
*/
|
|
7774
8949
|
export function reaction_smarts_match(smarts, reaction_smiles) {
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
8950
|
+
let ptr0, len0, ptr1, len1;
|
|
8951
|
+
try {
|
|
8952
|
+
ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8953
|
+
len0 = WASM_VECTOR_LEN;
|
|
8954
|
+
ptr1 = passStringToWasm0(reaction_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8955
|
+
len1 = WASM_VECTOR_LEN;
|
|
8956
|
+
} catch (e) {
|
|
8957
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
8958
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
8959
|
+
throw e;
|
|
8960
|
+
}
|
|
7779
8961
|
const ret = wasm.reaction_smarts_match(ptr0, len0, ptr1, len1);
|
|
7780
8962
|
if (ret[2]) {
|
|
7781
8963
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -7841,24 +9023,25 @@ export function remove_redundant_tetrahedral_stereo(mol, atom_index, max_visits)
|
|
|
7841
9023
|
* @returns {string}
|
|
7842
9024
|
*/
|
|
7843
9025
|
export function retro_disconnect_json(mol, max_results, reaction_class) {
|
|
7844
|
-
let
|
|
7845
|
-
let
|
|
9026
|
+
let deferred4_0;
|
|
9027
|
+
let deferred4_1;
|
|
7846
9028
|
try {
|
|
7847
9029
|
_assertClass(mol, MolHandle);
|
|
9030
|
+
const val2 = +max_results;
|
|
7848
9031
|
const ptr0 = passStringToWasm0(reaction_class, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7849
9032
|
const len0 = WASM_VECTOR_LEN;
|
|
7850
|
-
const ret = wasm.retro_disconnect_json(mol.__wbg_ptr,
|
|
7851
|
-
var
|
|
7852
|
-
var
|
|
9033
|
+
const ret = wasm.retro_disconnect_json(mol.__wbg_ptr, val2, ptr0, len0);
|
|
9034
|
+
var ptr3 = ret[0];
|
|
9035
|
+
var len3 = ret[1];
|
|
7853
9036
|
if (ret[3]) {
|
|
7854
|
-
|
|
9037
|
+
ptr3 = 0; len3 = 0;
|
|
7855
9038
|
throw takeFromExternrefTable0(ret[2]);
|
|
7856
9039
|
}
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
return getStringFromWasm0(
|
|
9040
|
+
deferred4_0 = ptr3;
|
|
9041
|
+
deferred4_1 = len3;
|
|
9042
|
+
return getStringFromWasm0(ptr3, len3);
|
|
7860
9043
|
} finally {
|
|
7861
|
-
wasm.__wbindgen_free(
|
|
9044
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
7862
9045
|
}
|
|
7863
9046
|
}
|
|
7864
9047
|
|
|
@@ -7879,10 +9062,17 @@ export function rgroup_decompose_columns_json(smiles_json, core_smarts) {
|
|
|
7879
9062
|
let deferred4_0;
|
|
7880
9063
|
let deferred4_1;
|
|
7881
9064
|
try {
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
9065
|
+
let ptr0, len0, ptr1, len1;
|
|
9066
|
+
try {
|
|
9067
|
+
ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9068
|
+
len0 = WASM_VECTOR_LEN;
|
|
9069
|
+
ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9070
|
+
len1 = WASM_VECTOR_LEN;
|
|
9071
|
+
} catch (e) {
|
|
9072
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9073
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9074
|
+
throw e;
|
|
9075
|
+
}
|
|
7886
9076
|
const ret = wasm.rgroup_decompose_columns_json(ptr0, len0, ptr1, len1);
|
|
7887
9077
|
var ptr3 = ret[0];
|
|
7888
9078
|
var len3 = ret[1];
|
|
@@ -7926,10 +9116,17 @@ export function rgroup_decompose_json(smiles_json, core_smarts) {
|
|
|
7926
9116
|
let deferred4_0;
|
|
7927
9117
|
let deferred4_1;
|
|
7928
9118
|
try {
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
9119
|
+
let ptr0, len0, ptr1, len1;
|
|
9120
|
+
try {
|
|
9121
|
+
ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9122
|
+
len0 = WASM_VECTOR_LEN;
|
|
9123
|
+
ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9124
|
+
len1 = WASM_VECTOR_LEN;
|
|
9125
|
+
} catch (e) {
|
|
9126
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9127
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9128
|
+
throw e;
|
|
9129
|
+
}
|
|
7933
9130
|
const ret = wasm.rgroup_decompose_json(ptr0, len0, ptr1, len1);
|
|
7934
9131
|
var ptr3 = ret[0];
|
|
7935
9132
|
var len3 = ret[1];
|
|
@@ -7997,6 +9194,88 @@ export function roundtrip_cjson_record(text) {
|
|
|
7997
9194
|
}
|
|
7998
9195
|
}
|
|
7999
9196
|
|
|
9197
|
+
/**
|
|
9198
|
+
* Exact bounded XML 1.0 CML source retention. Requires one CML-namespace
|
|
9199
|
+
* molecule root; rejects nested molecules/DTDs. Chemistry, references and
|
|
9200
|
+
* stereo remain opaque, with no interpretation or schema validation promised.
|
|
9201
|
+
* @param {string} text
|
|
9202
|
+
* @returns {string}
|
|
9203
|
+
*/
|
|
9204
|
+
export function roundtrip_cml_source(text) {
|
|
9205
|
+
let deferred3_0;
|
|
9206
|
+
let deferred3_1;
|
|
9207
|
+
try {
|
|
9208
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9209
|
+
const len0 = WASM_VECTOR_LEN;
|
|
9210
|
+
const ret = wasm.roundtrip_cml_source(ptr0, len0);
|
|
9211
|
+
var ptr2 = ret[0];
|
|
9212
|
+
var len2 = ret[1];
|
|
9213
|
+
if (ret[3]) {
|
|
9214
|
+
ptr2 = 0; len2 = 0;
|
|
9215
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
9216
|
+
}
|
|
9217
|
+
deferred3_0 = ptr2;
|
|
9218
|
+
deferred3_1 = len2;
|
|
9219
|
+
return getStringFromWasm0(ptr2, len2);
|
|
9220
|
+
} finally {
|
|
9221
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
9222
|
+
}
|
|
9223
|
+
}
|
|
9224
|
+
|
|
9225
|
+
/**
|
|
9226
|
+
* Retain all explicit Cartesian Link1 jobs as exact source; no job selection.
|
|
9227
|
+
* Budgets are cumulative. Opaque sections and external resources are not interpreted.
|
|
9228
|
+
* @param {string} text
|
|
9229
|
+
* @returns {string}
|
|
9230
|
+
*/
|
|
9231
|
+
export function roundtrip_gjf_document(text) {
|
|
9232
|
+
let deferred3_0;
|
|
9233
|
+
let deferred3_1;
|
|
9234
|
+
try {
|
|
9235
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9236
|
+
const len0 = WASM_VECTOR_LEN;
|
|
9237
|
+
const ret = wasm.roundtrip_gjf_document(ptr0, len0);
|
|
9238
|
+
var ptr2 = ret[0];
|
|
9239
|
+
var len2 = ret[1];
|
|
9240
|
+
if (ret[3]) {
|
|
9241
|
+
ptr2 = 0; len2 = 0;
|
|
9242
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
9243
|
+
}
|
|
9244
|
+
deferred3_0 = ptr2;
|
|
9245
|
+
deferred3_1 = len2;
|
|
9246
|
+
return getStringFromWasm0(ptr2, len2);
|
|
9247
|
+
} finally {
|
|
9248
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
9249
|
+
}
|
|
9250
|
+
}
|
|
9251
|
+
|
|
9252
|
+
/**
|
|
9253
|
+
* Retain exact single Cartesian GJF source without regenerating job sections.
|
|
9254
|
+
* Opaque sections are not interpreted; no external files are opened.
|
|
9255
|
+
* @param {string} text
|
|
9256
|
+
* @returns {string}
|
|
9257
|
+
*/
|
|
9258
|
+
export function roundtrip_gjf_record(text) {
|
|
9259
|
+
let deferred3_0;
|
|
9260
|
+
let deferred3_1;
|
|
9261
|
+
try {
|
|
9262
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9263
|
+
const len0 = WASM_VECTOR_LEN;
|
|
9264
|
+
const ret = wasm.roundtrip_gjf_record(ptr0, len0);
|
|
9265
|
+
var ptr2 = ret[0];
|
|
9266
|
+
var len2 = ret[1];
|
|
9267
|
+
if (ret[3]) {
|
|
9268
|
+
ptr2 = 0; len2 = 0;
|
|
9269
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
9270
|
+
}
|
|
9271
|
+
deferred3_0 = ptr2;
|
|
9272
|
+
deferred3_1 = len2;
|
|
9273
|
+
return getStringFromWasm0(ptr2, len2);
|
|
9274
|
+
} finally {
|
|
9275
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
9276
|
+
}
|
|
9277
|
+
}
|
|
9278
|
+
|
|
8000
9279
|
/**
|
|
8001
9280
|
* Validate a single HIN record and retain exact source text and line endings.
|
|
8002
9281
|
* @param {string} text
|
|
@@ -8050,12 +9329,12 @@ export function roundtrip_mol2_record(text) {
|
|
|
8050
9329
|
}
|
|
8051
9330
|
|
|
8052
9331
|
/**
|
|
8053
|
-
*
|
|
9332
|
+
* Validate one V3000 MOL block and return its exact source.
|
|
8054
9333
|
*
|
|
8055
9334
|
* Unlike the topology-only [`mol_from_v3000_block`] + [`to_mol_v3000_block`]
|
|
8056
|
-
* pair, this
|
|
8057
|
-
*
|
|
8058
|
-
*
|
|
9335
|
+
* pair, this retains 3D coordinate tokens, IDs, source ordering and opaque
|
|
9336
|
+
* fields including SGROUP and COLLECTION. No normalization or opaque chemistry
|
|
9337
|
+
* verification is promised. The typed SGroup view remains available through
|
|
8059
9338
|
* [`v3000_sgroups_json`].
|
|
8060
9339
|
* @param {string} block
|
|
8061
9340
|
* @returns {string}
|
|
@@ -8081,6 +9360,34 @@ export function roundtrip_mol_v3000_block(block) {
|
|
|
8081
9360
|
}
|
|
8082
9361
|
}
|
|
8083
9362
|
|
|
9363
|
+
/**
|
|
9364
|
+
* Validate every local-profile SDF record and retain exact UTF-8 source.
|
|
9365
|
+
* No partial output on record/limit failure. Opaque metadata/stereo is not
|
|
9366
|
+
* interpreted or edited. Bounds: 1 MB input/record, 10000 records/total atoms.
|
|
9367
|
+
* @param {string} text
|
|
9368
|
+
* @returns {string}
|
|
9369
|
+
*/
|
|
9370
|
+
export function roundtrip_sdf_source(text) {
|
|
9371
|
+
let deferred3_0;
|
|
9372
|
+
let deferred3_1;
|
|
9373
|
+
try {
|
|
9374
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9375
|
+
const len0 = WASM_VECTOR_LEN;
|
|
9376
|
+
const ret = wasm.roundtrip_sdf_source(ptr0, len0);
|
|
9377
|
+
var ptr2 = ret[0];
|
|
9378
|
+
var len2 = ret[1];
|
|
9379
|
+
if (ret[3]) {
|
|
9380
|
+
ptr2 = 0; len2 = 0;
|
|
9381
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
9382
|
+
}
|
|
9383
|
+
deferred3_0 = ptr2;
|
|
9384
|
+
deferred3_1 = len2;
|
|
9385
|
+
return getStringFromWasm0(ptr2, len2);
|
|
9386
|
+
} finally {
|
|
9387
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
9388
|
+
}
|
|
9389
|
+
}
|
|
9390
|
+
|
|
8084
9391
|
/**
|
|
8085
9392
|
* Apply a SMIRKS reaction template and return product SMILES as a JSON string.
|
|
8086
9393
|
*
|
|
@@ -8097,10 +9404,17 @@ export function run_reactants(smirks, reactants_smiles) {
|
|
|
8097
9404
|
let deferred4_0;
|
|
8098
9405
|
let deferred4_1;
|
|
8099
9406
|
try {
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
9407
|
+
let ptr0, len0, ptr1, len1;
|
|
9408
|
+
try {
|
|
9409
|
+
ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9410
|
+
len0 = WASM_VECTOR_LEN;
|
|
9411
|
+
ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9412
|
+
len1 = WASM_VECTOR_LEN;
|
|
9413
|
+
} catch (e) {
|
|
9414
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9415
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9416
|
+
throw e;
|
|
9417
|
+
}
|
|
8104
9418
|
const ret = wasm.run_reactants(ptr0, len0, ptr1, len1);
|
|
8105
9419
|
var ptr3 = ret[0];
|
|
8106
9420
|
var len3 = ret[1];
|
|
@@ -8140,19 +9454,27 @@ export function run_reactants(smirks, reactants_smiles) {
|
|
|
8140
9454
|
* @returns {string}
|
|
8141
9455
|
*/
|
|
8142
9456
|
export function run_reactants_checked(smirks, reactants_smiles, rdkit_compat) {
|
|
8143
|
-
let
|
|
8144
|
-
let
|
|
9457
|
+
let deferred4_0;
|
|
9458
|
+
let deferred4_1;
|
|
8145
9459
|
try {
|
|
8146
|
-
const
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
9460
|
+
const val3 = +rdkit_compat;
|
|
9461
|
+
let ptr0, len0, ptr1, len1;
|
|
9462
|
+
try {
|
|
9463
|
+
ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9464
|
+
len0 = WASM_VECTOR_LEN;
|
|
9465
|
+
ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9466
|
+
len1 = WASM_VECTOR_LEN;
|
|
9467
|
+
} catch (e) {
|
|
9468
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9469
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9470
|
+
throw e;
|
|
9471
|
+
}
|
|
9472
|
+
const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, val3);
|
|
9473
|
+
deferred4_0 = ret[0];
|
|
9474
|
+
deferred4_1 = ret[1];
|
|
8153
9475
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
8154
9476
|
} finally {
|
|
8155
|
-
wasm.__wbindgen_free(
|
|
9477
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
8156
9478
|
}
|
|
8157
9479
|
}
|
|
8158
9480
|
|
|
@@ -8245,10 +9567,17 @@ export function screen_smiles_json(smiles_batch, delimiter) {
|
|
|
8245
9567
|
let deferred3_0;
|
|
8246
9568
|
let deferred3_1;
|
|
8247
9569
|
try {
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
9570
|
+
let ptr0, len0, ptr1, len1;
|
|
9571
|
+
try {
|
|
9572
|
+
ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9573
|
+
len0 = WASM_VECTOR_LEN;
|
|
9574
|
+
ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9575
|
+
len1 = WASM_VECTOR_LEN;
|
|
9576
|
+
} catch (e) {
|
|
9577
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9578
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9579
|
+
throw e;
|
|
9580
|
+
}
|
|
8252
9581
|
const ret = wasm.screen_smiles_json(ptr0, len0, ptr1, len1);
|
|
8253
9582
|
deferred3_0 = ret[0];
|
|
8254
9583
|
deferred3_1 = ret[1];
|
|
@@ -8282,12 +9611,20 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
|
|
|
8282
9611
|
let deferred5_0;
|
|
8283
9612
|
let deferred5_1;
|
|
8284
9613
|
try {
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
9614
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
9615
|
+
try {
|
|
9616
|
+
ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9617
|
+
len0 = WASM_VECTOR_LEN;
|
|
9618
|
+
ptr1 = passStringToWasm0(names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9619
|
+
len1 = WASM_VECTOR_LEN;
|
|
9620
|
+
ptr2 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9621
|
+
len2 = WASM_VECTOR_LEN;
|
|
9622
|
+
} catch (e) {
|
|
9623
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
9624
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9625
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9626
|
+
throw e;
|
|
9627
|
+
}
|
|
8291
9628
|
const ret = wasm.sdf_from_records_json(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
8292
9629
|
var ptr4 = ret[0];
|
|
8293
9630
|
var len4 = ret[1];
|
|
@@ -8316,23 +9653,25 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
|
|
|
8316
9653
|
* @returns {string}
|
|
8317
9654
|
*/
|
|
8318
9655
|
export function sdf_records_batch_json(sdf, offset, batch_size) {
|
|
8319
|
-
let
|
|
8320
|
-
let
|
|
9656
|
+
let deferred5_0;
|
|
9657
|
+
let deferred5_1;
|
|
8321
9658
|
try {
|
|
9659
|
+
const val2 = +offset;
|
|
9660
|
+
const val3 = +batch_size;
|
|
8322
9661
|
const ptr0 = passStringToWasm0(sdf, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8323
9662
|
const len0 = WASM_VECTOR_LEN;
|
|
8324
|
-
const ret = wasm.sdf_records_batch_json(ptr0, len0,
|
|
8325
|
-
var
|
|
8326
|
-
var
|
|
9663
|
+
const ret = wasm.sdf_records_batch_json(ptr0, len0, val2, val3);
|
|
9664
|
+
var ptr4 = ret[0];
|
|
9665
|
+
var len4 = ret[1];
|
|
8327
9666
|
if (ret[3]) {
|
|
8328
|
-
|
|
9667
|
+
ptr4 = 0; len4 = 0;
|
|
8329
9668
|
throw takeFromExternrefTable0(ret[2]);
|
|
8330
9669
|
}
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
return getStringFromWasm0(
|
|
9670
|
+
deferred5_0 = ptr4;
|
|
9671
|
+
deferred5_1 = len4;
|
|
9672
|
+
return getStringFromWasm0(ptr4, len4);
|
|
8334
9673
|
} finally {
|
|
8335
|
-
wasm.__wbindgen_free(
|
|
9674
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
8336
9675
|
}
|
|
8337
9676
|
}
|
|
8338
9677
|
|
|
@@ -8400,10 +9739,17 @@ export function semantic_apply_json_command(model_json, command_json) {
|
|
|
8400
9739
|
let deferred4_0;
|
|
8401
9740
|
let deferred4_1;
|
|
8402
9741
|
try {
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
9742
|
+
let ptr0, len0, ptr1, len1;
|
|
9743
|
+
try {
|
|
9744
|
+
ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9745
|
+
len0 = WASM_VECTOR_LEN;
|
|
9746
|
+
ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9747
|
+
len1 = WASM_VECTOR_LEN;
|
|
9748
|
+
} catch (e) {
|
|
9749
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9750
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9751
|
+
throw e;
|
|
9752
|
+
}
|
|
8407
9753
|
const ret = wasm.semantic_apply_json_command(ptr0, len0, ptr1, len1);
|
|
8408
9754
|
var ptr3 = ret[0];
|
|
8409
9755
|
var len3 = ret[1];
|
|
@@ -8430,10 +9776,17 @@ export function semantic_expand_json(base_smiles, model_json) {
|
|
|
8430
9776
|
let deferred4_0;
|
|
8431
9777
|
let deferred4_1;
|
|
8432
9778
|
try {
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
9779
|
+
let ptr0, len0, ptr1, len1;
|
|
9780
|
+
try {
|
|
9781
|
+
ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9782
|
+
len0 = WASM_VECTOR_LEN;
|
|
9783
|
+
ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9784
|
+
len1 = WASM_VECTOR_LEN;
|
|
9785
|
+
} catch (e) {
|
|
9786
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9787
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9788
|
+
throw e;
|
|
9789
|
+
}
|
|
8437
9790
|
const ret = wasm.semantic_expand_json(ptr0, len0, ptr1, len1);
|
|
8438
9791
|
var ptr3 = ret[0];
|
|
8439
9792
|
var len3 = ret[1];
|
|
@@ -8458,25 +9811,34 @@ export function semantic_expand_json(base_smiles, model_json) {
|
|
|
8458
9811
|
* @returns {string}
|
|
8459
9812
|
*/
|
|
8460
9813
|
export function semantic_expand_json_with_limits(base_smiles, model_json, max_atoms, max_repeat_count) {
|
|
8461
|
-
let
|
|
8462
|
-
let
|
|
9814
|
+
let deferred6_0;
|
|
9815
|
+
let deferred6_1;
|
|
8463
9816
|
try {
|
|
8464
|
-
const
|
|
8465
|
-
const
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
9817
|
+
const val3 = +max_atoms;
|
|
9818
|
+
const val4 = +max_repeat_count;
|
|
9819
|
+
let ptr0, len0, ptr1, len1;
|
|
9820
|
+
try {
|
|
9821
|
+
ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9822
|
+
len0 = WASM_VECTOR_LEN;
|
|
9823
|
+
ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9824
|
+
len1 = WASM_VECTOR_LEN;
|
|
9825
|
+
} catch (e) {
|
|
9826
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
9827
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
9828
|
+
throw e;
|
|
9829
|
+
}
|
|
9830
|
+
const ret = wasm.semantic_expand_json_with_limits(ptr0, len0, ptr1, len1, val3, val4);
|
|
9831
|
+
var ptr5 = ret[0];
|
|
9832
|
+
var len5 = ret[1];
|
|
8471
9833
|
if (ret[3]) {
|
|
8472
|
-
|
|
9834
|
+
ptr5 = 0; len5 = 0;
|
|
8473
9835
|
throw takeFromExternrefTable0(ret[2]);
|
|
8474
9836
|
}
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
return getStringFromWasm0(
|
|
9837
|
+
deferred6_0 = ptr5;
|
|
9838
|
+
deferred6_1 = len5;
|
|
9839
|
+
return getStringFromWasm0(ptr5, len5);
|
|
8478
9840
|
} finally {
|
|
8479
|
-
wasm.__wbindgen_free(
|
|
9841
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
8480
9842
|
}
|
|
8481
9843
|
}
|
|
8482
9844
|
|
|
@@ -8520,24 +9882,28 @@ export function semantic_model_json(model_json) {
|
|
|
8520
9882
|
* @returns {string}
|
|
8521
9883
|
*/
|
|
8522
9884
|
export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle_deg) {
|
|
8523
|
-
let
|
|
8524
|
-
let
|
|
9885
|
+
let deferred7_0;
|
|
9886
|
+
let deferred7_1;
|
|
8525
9887
|
try {
|
|
8526
9888
|
_assertClass(mol, MolHandle);
|
|
9889
|
+
const val2 = +i;
|
|
9890
|
+
const val3 = +j;
|
|
9891
|
+
const val4 = +k;
|
|
9892
|
+
const val5 = +angle_deg;
|
|
8527
9893
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8528
9894
|
const len0 = WASM_VECTOR_LEN;
|
|
8529
|
-
const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
8530
|
-
var
|
|
8531
|
-
var
|
|
9895
|
+
const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
|
|
9896
|
+
var ptr6 = ret[0];
|
|
9897
|
+
var len6 = ret[1];
|
|
8532
9898
|
if (ret[3]) {
|
|
8533
|
-
|
|
9899
|
+
ptr6 = 0; len6 = 0;
|
|
8534
9900
|
throw takeFromExternrefTable0(ret[2]);
|
|
8535
9901
|
}
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
return getStringFromWasm0(
|
|
9902
|
+
deferred7_0 = ptr6;
|
|
9903
|
+
deferred7_1 = len6;
|
|
9904
|
+
return getStringFromWasm0(ptr6, len6);
|
|
8539
9905
|
} finally {
|
|
8540
|
-
wasm.__wbindgen_free(
|
|
9906
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
8541
9907
|
}
|
|
8542
9908
|
}
|
|
8543
9909
|
|
|
@@ -8554,24 +9920,27 @@ export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle
|
|
|
8554
9920
|
* @returns {string}
|
|
8555
9921
|
*/
|
|
8556
9922
|
export function set_bond_length_from_coords_json(mol, coords_json, i, j, length) {
|
|
8557
|
-
let
|
|
8558
|
-
let
|
|
9923
|
+
let deferred6_0;
|
|
9924
|
+
let deferred6_1;
|
|
8559
9925
|
try {
|
|
8560
9926
|
_assertClass(mol, MolHandle);
|
|
9927
|
+
const val2 = +i;
|
|
9928
|
+
const val3 = +j;
|
|
9929
|
+
const val4 = +length;
|
|
8561
9930
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8562
9931
|
const len0 = WASM_VECTOR_LEN;
|
|
8563
|
-
const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
8564
|
-
var
|
|
8565
|
-
var
|
|
9932
|
+
const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
|
|
9933
|
+
var ptr5 = ret[0];
|
|
9934
|
+
var len5 = ret[1];
|
|
8566
9935
|
if (ret[3]) {
|
|
8567
|
-
|
|
9936
|
+
ptr5 = 0; len5 = 0;
|
|
8568
9937
|
throw takeFromExternrefTable0(ret[2]);
|
|
8569
9938
|
}
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
return getStringFromWasm0(
|
|
9939
|
+
deferred6_0 = ptr5;
|
|
9940
|
+
deferred6_1 = len5;
|
|
9941
|
+
return getStringFromWasm0(ptr5, len5);
|
|
8573
9942
|
} finally {
|
|
8574
|
-
wasm.__wbindgen_free(
|
|
9943
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
8575
9944
|
}
|
|
8576
9945
|
}
|
|
8577
9946
|
|
|
@@ -8589,24 +9958,29 @@ export function set_bond_length_from_coords_json(mol, coords_json, i, j, length)
|
|
|
8589
9958
|
* @returns {string}
|
|
8590
9959
|
*/
|
|
8591
9960
|
export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angle_deg) {
|
|
8592
|
-
let
|
|
8593
|
-
let
|
|
9961
|
+
let deferred8_0;
|
|
9962
|
+
let deferred8_1;
|
|
8594
9963
|
try {
|
|
8595
9964
|
_assertClass(mol, MolHandle);
|
|
9965
|
+
const val2 = +i;
|
|
9966
|
+
const val3 = +j;
|
|
9967
|
+
const val4 = +k;
|
|
9968
|
+
const val5 = +l;
|
|
9969
|
+
const val6 = +angle_deg;
|
|
8596
9970
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8597
9971
|
const len0 = WASM_VECTOR_LEN;
|
|
8598
|
-
const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0,
|
|
8599
|
-
var
|
|
8600
|
-
var
|
|
9972
|
+
const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6);
|
|
9973
|
+
var ptr7 = ret[0];
|
|
9974
|
+
var len7 = ret[1];
|
|
8601
9975
|
if (ret[3]) {
|
|
8602
|
-
|
|
9976
|
+
ptr7 = 0; len7 = 0;
|
|
8603
9977
|
throw takeFromExternrefTable0(ret[2]);
|
|
8604
9978
|
}
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
return getStringFromWasm0(
|
|
9979
|
+
deferred8_0 = ptr7;
|
|
9980
|
+
deferred8_1 = len7;
|
|
9981
|
+
return getStringFromWasm0(ptr7, len7);
|
|
8608
9982
|
} finally {
|
|
8609
|
-
wasm.__wbindgen_free(
|
|
9983
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
8610
9984
|
}
|
|
8611
9985
|
}
|
|
8612
9986
|
|
|
@@ -8633,23 +10007,28 @@ export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angl
|
|
|
8633
10007
|
* @returns {string}
|
|
8634
10008
|
*/
|
|
8635
10009
|
export function set_dihedral_json(smiles, a, b, c, d, angle_deg) {
|
|
8636
|
-
let
|
|
8637
|
-
let
|
|
8638
|
-
try {
|
|
10010
|
+
let deferred8_0;
|
|
10011
|
+
let deferred8_1;
|
|
10012
|
+
try {
|
|
10013
|
+
const val2 = +a;
|
|
10014
|
+
const val3 = +b;
|
|
10015
|
+
const val4 = +c;
|
|
10016
|
+
const val5 = +d;
|
|
10017
|
+
const val6 = +angle_deg;
|
|
8639
10018
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8640
10019
|
const len0 = WASM_VECTOR_LEN;
|
|
8641
|
-
const ret = wasm.set_dihedral_json(ptr0, len0,
|
|
8642
|
-
var
|
|
8643
|
-
var
|
|
10020
|
+
const ret = wasm.set_dihedral_json(ptr0, len0, val2, val3, val4, val5, val6);
|
|
10021
|
+
var ptr7 = ret[0];
|
|
10022
|
+
var len7 = ret[1];
|
|
8644
10023
|
if (ret[3]) {
|
|
8645
|
-
|
|
10024
|
+
ptr7 = 0; len7 = 0;
|
|
8646
10025
|
throw takeFromExternrefTable0(ret[2]);
|
|
8647
10026
|
}
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
return getStringFromWasm0(
|
|
10027
|
+
deferred8_0 = ptr7;
|
|
10028
|
+
deferred8_1 = len7;
|
|
10029
|
+
return getStringFromWasm0(ptr7, len7);
|
|
8651
10030
|
} finally {
|
|
8652
|
-
wasm.__wbindgen_free(
|
|
10031
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
8653
10032
|
}
|
|
8654
10033
|
}
|
|
8655
10034
|
|
|
@@ -8709,9 +10088,9 @@ export function smarts_match_atoms(smarts, mol) {
|
|
|
8709
10088
|
let deferred3_0;
|
|
8710
10089
|
let deferred3_1;
|
|
8711
10090
|
try {
|
|
10091
|
+
_assertClass(mol, MolHandle);
|
|
8712
10092
|
const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8713
10093
|
const len0 = WASM_VECTOR_LEN;
|
|
8714
|
-
_assertClass(mol, MolHandle);
|
|
8715
10094
|
const ret = wasm.smarts_match_atoms(ptr0, len0, mol.__wbg_ptr);
|
|
8716
10095
|
var ptr2 = ret[0];
|
|
8717
10096
|
var len2 = ret[1];
|
|
@@ -8739,24 +10118,65 @@ export function smarts_match_atoms(smarts, mol) {
|
|
|
8739
10118
|
* @returns {string}
|
|
8740
10119
|
*/
|
|
8741
10120
|
export function smarts_match_atoms_with_chirality(smarts, mol, use_chirality) {
|
|
8742
|
-
let
|
|
8743
|
-
let
|
|
10121
|
+
let deferred4_0;
|
|
10122
|
+
let deferred4_1;
|
|
8744
10123
|
try {
|
|
10124
|
+
_assertClass(mol, MolHandle);
|
|
10125
|
+
const val2 = +use_chirality;
|
|
8745
10126
|
const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
8746
10127
|
const len0 = WASM_VECTOR_LEN;
|
|
10128
|
+
const ret = wasm.smarts_match_atoms_with_chirality(ptr0, len0, mol.__wbg_ptr, val2);
|
|
10129
|
+
var ptr3 = ret[0];
|
|
10130
|
+
var len3 = ret[1];
|
|
10131
|
+
if (ret[3]) {
|
|
10132
|
+
ptr3 = 0; len3 = 0;
|
|
10133
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10134
|
+
}
|
|
10135
|
+
deferred4_0 = ptr3;
|
|
10136
|
+
deferred4_1 = len3;
|
|
10137
|
+
return getStringFromWasm0(ptr3, len3);
|
|
10138
|
+
} finally {
|
|
10139
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
10140
|
+
}
|
|
10141
|
+
}
|
|
10142
|
+
|
|
10143
|
+
/**
|
|
10144
|
+
* Match SMARTS with optional `useChirality` and `useIsotopes` JSON flags.
|
|
10145
|
+
* Returns sorted atom indices for each hit. The existing WASM match and visit
|
|
10146
|
+
* limits apply. Pass `{}` to use the default settings.
|
|
10147
|
+
* @param {string} smarts
|
|
10148
|
+
* @param {MolHandle} mol
|
|
10149
|
+
* @param {string} config_json
|
|
10150
|
+
* @returns {string}
|
|
10151
|
+
*/
|
|
10152
|
+
export function smarts_match_atoms_with_config(smarts, mol, config_json) {
|
|
10153
|
+
let deferred4_0;
|
|
10154
|
+
let deferred4_1;
|
|
10155
|
+
try {
|
|
8747
10156
|
_assertClass(mol, MolHandle);
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
10157
|
+
let ptr0, len0, ptr1, len1;
|
|
10158
|
+
try {
|
|
10159
|
+
ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10160
|
+
len0 = WASM_VECTOR_LEN;
|
|
10161
|
+
ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10162
|
+
len1 = WASM_VECTOR_LEN;
|
|
10163
|
+
} catch (e) {
|
|
10164
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10165
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10166
|
+
throw e;
|
|
10167
|
+
}
|
|
10168
|
+
const ret = wasm.smarts_match_atoms_with_config(ptr0, len0, mol.__wbg_ptr, ptr1, len1);
|
|
10169
|
+
var ptr3 = ret[0];
|
|
10170
|
+
var len3 = ret[1];
|
|
8751
10171
|
if (ret[3]) {
|
|
8752
|
-
|
|
10172
|
+
ptr3 = 0; len3 = 0;
|
|
8753
10173
|
throw takeFromExternrefTable0(ret[2]);
|
|
8754
10174
|
}
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
return getStringFromWasm0(
|
|
10175
|
+
deferred4_0 = ptr3;
|
|
10176
|
+
deferred4_1 = len3;
|
|
10177
|
+
return getStringFromWasm0(ptr3, len3);
|
|
8758
10178
|
} finally {
|
|
8759
|
-
wasm.__wbindgen_free(
|
|
10179
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
8760
10180
|
}
|
|
8761
10181
|
}
|
|
8762
10182
|
|
|
@@ -8832,14 +10252,23 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
|
|
|
8832
10252
|
let deferred5_0;
|
|
8833
10253
|
let deferred5_1;
|
|
8834
10254
|
try {
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
10255
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
10256
|
+
try {
|
|
10257
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10258
|
+
len0 = WASM_VECTOR_LEN;
|
|
10259
|
+
ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10260
|
+
len1 = WASM_VECTOR_LEN;
|
|
10261
|
+
ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10262
|
+
len2 = WASM_VECTOR_LEN;
|
|
10263
|
+
ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10264
|
+
len3 = WASM_VECTOR_LEN;
|
|
10265
|
+
} catch (e) {
|
|
10266
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
10267
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
10268
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10269
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10270
|
+
throw e;
|
|
10271
|
+
}
|
|
8843
10272
|
const ret = wasm.smiles_to_pdbqt(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
8844
10273
|
deferred5_0 = ret[0];
|
|
8845
10274
|
deferred5_1 = ret[1];
|
|
@@ -8855,6 +10284,7 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
|
|
|
8855
10284
|
* contain exactly one value per graph atom, including explicit H. No defaults,
|
|
8856
10285
|
* charge calculation, atom removal or ligand torsion preparation are applied.
|
|
8857
10286
|
* AutoDock types retain the legacy heuristic, with unknown `X` types rejected.
|
|
10287
|
+
* Isotopes are refused; smiles_to_pdbqt_isotope_projection records their omission.
|
|
8858
10288
|
* @param {string} smiles
|
|
8859
10289
|
* @param {string} coords_json
|
|
8860
10290
|
* @param {string} charges_json
|
|
@@ -8865,14 +10295,23 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
|
|
|
8865
10295
|
let deferred6_0;
|
|
8866
10296
|
let deferred6_1;
|
|
8867
10297
|
try {
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
10298
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
10299
|
+
try {
|
|
10300
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10301
|
+
len0 = WASM_VECTOR_LEN;
|
|
10302
|
+
ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10303
|
+
len1 = WASM_VECTOR_LEN;
|
|
10304
|
+
ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10305
|
+
len2 = WASM_VECTOR_LEN;
|
|
10306
|
+
ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10307
|
+
len3 = WASM_VECTOR_LEN;
|
|
10308
|
+
} catch (e) {
|
|
10309
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
10310
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
10311
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10312
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10313
|
+
throw e;
|
|
10314
|
+
}
|
|
8876
10315
|
const ret = wasm.smiles_to_pdbqt_checked(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
8877
10316
|
var ptr5 = ret[0];
|
|
8878
10317
|
var len5 = ret[1];
|
|
@@ -8888,6 +10327,53 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
|
|
|
8888
10327
|
}
|
|
8889
10328
|
}
|
|
8890
10329
|
|
|
10330
|
+
/**
|
|
10331
|
+
* Explicit isotope projection. Returns JSON {pdbqt, isotopes_omitted} with
|
|
10332
|
+
* zero-based source_atom_index, one-based pdbqt_serial, atomic_number and
|
|
10333
|
+
* mass_number for each label omitted from PDBQT. Retains all explicit atoms,
|
|
10334
|
+
* without H merging, charge recalculation or ligand torsion preparation.
|
|
10335
|
+
* @param {string} smiles
|
|
10336
|
+
* @param {string} coords_json
|
|
10337
|
+
* @param {string} charges_json
|
|
10338
|
+
* @param {string} name
|
|
10339
|
+
* @returns {string}
|
|
10340
|
+
*/
|
|
10341
|
+
export function smiles_to_pdbqt_isotope_projection(smiles, coords_json, charges_json, name) {
|
|
10342
|
+
let deferred6_0;
|
|
10343
|
+
let deferred6_1;
|
|
10344
|
+
try {
|
|
10345
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
10346
|
+
try {
|
|
10347
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10348
|
+
len0 = WASM_VECTOR_LEN;
|
|
10349
|
+
ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10350
|
+
len1 = WASM_VECTOR_LEN;
|
|
10351
|
+
ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10352
|
+
len2 = WASM_VECTOR_LEN;
|
|
10353
|
+
ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10354
|
+
len3 = WASM_VECTOR_LEN;
|
|
10355
|
+
} catch (e) {
|
|
10356
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
10357
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
10358
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10359
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10360
|
+
throw e;
|
|
10361
|
+
}
|
|
10362
|
+
const ret = wasm.smiles_to_pdbqt_isotope_projection(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
10363
|
+
var ptr5 = ret[0];
|
|
10364
|
+
var len5 = ret[1];
|
|
10365
|
+
if (ret[3]) {
|
|
10366
|
+
ptr5 = 0; len5 = 0;
|
|
10367
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10368
|
+
}
|
|
10369
|
+
deferred6_0 = ptr5;
|
|
10370
|
+
deferred6_1 = len5;
|
|
10371
|
+
return getStringFromWasm0(ptr5, len5);
|
|
10372
|
+
} finally {
|
|
10373
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
10374
|
+
}
|
|
10375
|
+
}
|
|
10376
|
+
|
|
8891
10377
|
/**
|
|
8892
10378
|
* Render a highlighted SVG from a SMILES string in one call.
|
|
8893
10379
|
*
|
|
@@ -8897,8 +10383,8 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
|
|
|
8897
10383
|
*
|
|
8898
10384
|
* Returns a JS error on SMILES parse failure.
|
|
8899
10385
|
* @param {string} smiles
|
|
8900
|
-
* @param {Uint32Array} atoms
|
|
8901
|
-
* @param {Uint32Array} bonds
|
|
10386
|
+
* @param {Uint32Array | number[]} atoms
|
|
10387
|
+
* @param {Uint32Array | number[]} bonds
|
|
8902
10388
|
* @param {string} color
|
|
8903
10389
|
* @returns {string}
|
|
8904
10390
|
*/
|
|
@@ -8906,14 +10392,23 @@ export function smiles_to_svg_highlighted(smiles, atoms, bonds, color) {
|
|
|
8906
10392
|
let deferred6_0;
|
|
8907
10393
|
let deferred6_1;
|
|
8908
10394
|
try {
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
10395
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
10396
|
+
try {
|
|
10397
|
+
ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10398
|
+
len0 = WASM_VECTOR_LEN;
|
|
10399
|
+
ptr1 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
|
|
10400
|
+
len1 = WASM_VECTOR_LEN;
|
|
10401
|
+
ptr2 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
|
|
10402
|
+
len2 = WASM_VECTOR_LEN;
|
|
10403
|
+
ptr3 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10404
|
+
len3 = WASM_VECTOR_LEN;
|
|
10405
|
+
} catch (e) {
|
|
10406
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
10407
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 4, 4); }
|
|
10408
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
|
|
10409
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10410
|
+
throw e;
|
|
10411
|
+
}
|
|
8917
10412
|
const ret = wasm.smiles_to_svg_highlighted(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
8918
10413
|
var ptr5 = ret[0];
|
|
8919
10414
|
var len5 = ret[1];
|
|
@@ -9006,17 +10501,21 @@ export function standardize_smiles(smiles) {
|
|
|
9006
10501
|
* @returns {string}
|
|
9007
10502
|
*/
|
|
9008
10503
|
export function standardize_smiles_report_json(smiles, largest_fragment_only, neutralize_charges, remove_explicit_h, canonical_tautomer) {
|
|
9009
|
-
let
|
|
9010
|
-
let
|
|
10504
|
+
let deferred6_0;
|
|
10505
|
+
let deferred6_1;
|
|
9011
10506
|
try {
|
|
10507
|
+
const val2 = +largest_fragment_only;
|
|
10508
|
+
const val3 = +neutralize_charges;
|
|
10509
|
+
const val4 = +remove_explicit_h;
|
|
10510
|
+
const val5 = +canonical_tautomer;
|
|
9012
10511
|
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9013
10512
|
const len0 = WASM_VECTOR_LEN;
|
|
9014
|
-
const ret = wasm.standardize_smiles_report_json(ptr0, len0,
|
|
9015
|
-
|
|
9016
|
-
|
|
10513
|
+
const ret = wasm.standardize_smiles_report_json(ptr0, len0, val2, val3, val4, val5);
|
|
10514
|
+
deferred6_0 = ret[0];
|
|
10515
|
+
deferred6_1 = ret[1];
|
|
9017
10516
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
9018
10517
|
} finally {
|
|
9019
|
-
wasm.__wbindgen_free(
|
|
10518
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
9020
10519
|
}
|
|
9021
10520
|
}
|
|
9022
10521
|
|
|
@@ -9195,10 +10694,17 @@ export function tanimoto_maccs(a, b) {
|
|
|
9195
10694
|
* @returns {number}
|
|
9196
10695
|
*/
|
|
9197
10696
|
export function tanimoto_mhfp_smiles(smi1, smi2) {
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
10697
|
+
let ptr0, len0, ptr1, len1;
|
|
10698
|
+
try {
|
|
10699
|
+
ptr0 = passStringToWasm0(smi1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10700
|
+
len0 = WASM_VECTOR_LEN;
|
|
10701
|
+
ptr1 = passStringToWasm0(smi2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10702
|
+
len1 = WASM_VECTOR_LEN;
|
|
10703
|
+
} catch (e) {
|
|
10704
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10705
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10706
|
+
throw e;
|
|
10707
|
+
}
|
|
9202
10708
|
const ret = wasm.tanimoto_mhfp_smiles(ptr0, len0, ptr1, len1);
|
|
9203
10709
|
if (ret[2]) {
|
|
9204
10710
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -9222,10 +10728,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
|
|
|
9222
10728
|
let deferred3_0;
|
|
9223
10729
|
let deferred3_1;
|
|
9224
10730
|
try {
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
10731
|
+
let ptr0, len0, ptr1, len1;
|
|
10732
|
+
try {
|
|
10733
|
+
ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10734
|
+
len0 = WASM_VECTOR_LEN;
|
|
10735
|
+
ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10736
|
+
len1 = WASM_VECTOR_LEN;
|
|
10737
|
+
} catch (e) {
|
|
10738
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10739
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10740
|
+
throw e;
|
|
10741
|
+
}
|
|
9229
10742
|
const ret = wasm.tanimoto_row_json(ptr0, len0, ptr1, len1);
|
|
9230
10743
|
deferred3_0 = ret[0];
|
|
9231
10744
|
deferred3_1 = ret[1];
|
|
@@ -9244,10 +10757,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
|
|
|
9244
10757
|
* @returns {number}
|
|
9245
10758
|
*/
|
|
9246
10759
|
export function tanimoto_smiles(smiles1, smiles2) {
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
10760
|
+
let ptr0, len0, ptr1, len1;
|
|
10761
|
+
try {
|
|
10762
|
+
ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10763
|
+
len0 = WASM_VECTOR_LEN;
|
|
10764
|
+
ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10765
|
+
len1 = WASM_VECTOR_LEN;
|
|
10766
|
+
} catch (e) {
|
|
10767
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10768
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10769
|
+
throw e;
|
|
10770
|
+
}
|
|
9251
10771
|
const ret = wasm.tanimoto_smiles(ptr0, len0, ptr1, len1);
|
|
9252
10772
|
if (ret[2]) {
|
|
9253
10773
|
throw takeFromExternrefTable0(ret[1]);
|
|
@@ -9306,6 +10826,58 @@ export function tautomer_parent_json(mol, max_transforms, max_tautomers, timeout
|
|
|
9306
10826
|
}
|
|
9307
10827
|
}
|
|
9308
10828
|
|
|
10829
|
+
/**
|
|
10830
|
+
* Write an edited record, refusing unsupported keys rather than dropping them.
|
|
10831
|
+
* @param {string} json
|
|
10832
|
+
* @returns {string}
|
|
10833
|
+
*/
|
|
10834
|
+
export function tinker_xyz_from_record_json(json) {
|
|
10835
|
+
let deferred3_0;
|
|
10836
|
+
let deferred3_1;
|
|
10837
|
+
try {
|
|
10838
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10839
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10840
|
+
const ret = wasm.tinker_xyz_from_record_json(ptr0, len0);
|
|
10841
|
+
var ptr2 = ret[0];
|
|
10842
|
+
var len2 = ret[1];
|
|
10843
|
+
if (ret[3]) {
|
|
10844
|
+
ptr2 = 0; len2 = 0;
|
|
10845
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10846
|
+
}
|
|
10847
|
+
deferred3_0 = ptr2;
|
|
10848
|
+
deferred3_1 = len2;
|
|
10849
|
+
return getStringFromWasm0(ptr2, len2);
|
|
10850
|
+
} finally {
|
|
10851
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
10852
|
+
}
|
|
10853
|
+
}
|
|
10854
|
+
|
|
10855
|
+
/**
|
|
10856
|
+
* Read one Tinker XYZ frame. Names/types and declared adjacency remain opaque.
|
|
10857
|
+
* @param {string} text
|
|
10858
|
+
* @returns {string}
|
|
10859
|
+
*/
|
|
10860
|
+
export function tinker_xyz_record_json(text) {
|
|
10861
|
+
let deferred3_0;
|
|
10862
|
+
let deferred3_1;
|
|
10863
|
+
try {
|
|
10864
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10865
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10866
|
+
const ret = wasm.tinker_xyz_record_json(ptr0, len0);
|
|
10867
|
+
var ptr2 = ret[0];
|
|
10868
|
+
var len2 = ret[1];
|
|
10869
|
+
if (ret[3]) {
|
|
10870
|
+
ptr2 = 0; len2 = 0;
|
|
10871
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10872
|
+
}
|
|
10873
|
+
deferred3_0 = ptr2;
|
|
10874
|
+
deferred3_1 = len2;
|
|
10875
|
+
return getStringFromWasm0(ptr2, len2);
|
|
10876
|
+
} finally {
|
|
10877
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
10878
|
+
}
|
|
10879
|
+
}
|
|
10880
|
+
|
|
9309
10881
|
/**
|
|
9310
10882
|
* Serialise a `MolHandle` to a CML string with 2D coordinates.
|
|
9311
10883
|
*
|
|
@@ -9343,7 +10915,11 @@ export function to_cml(mol) {
|
|
|
9343
10915
|
*
|
|
9344
10916
|
* Returns a JS error if `coords_json`/`options_json` are malformed, if
|
|
9345
10917
|
* `coords_json`'s length doesn't match `mol`'s atom count, or if a
|
|
9346
|
-
* `properties` column's row count doesn't match it.
|
|
10918
|
+
* `properties` column's row count doesn't match it. Options must be an object
|
|
10919
|
+
* with only lattice/properties/info; duplicate keys and malformed values fail.
|
|
10920
|
+
* Nonfinite values, ambiguous/reserved names and invalid frame data fail before
|
|
10921
|
+
* output. Bare empty info values require explicit typed metadata encoding.
|
|
10922
|
+
* Molecular bonds, formal charges, isotope and stereo are not projected.
|
|
9347
10923
|
* @param {MolHandle} mol
|
|
9348
10924
|
* @param {string} coords_json
|
|
9349
10925
|
* @param {string} options_json
|
|
@@ -9354,10 +10930,17 @@ export function to_extxyz_json(mol, coords_json, options_json) {
|
|
|
9354
10930
|
let deferred4_1;
|
|
9355
10931
|
try {
|
|
9356
10932
|
_assertClass(mol, MolHandle);
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
10933
|
+
let ptr0, len0, ptr1, len1;
|
|
10934
|
+
try {
|
|
10935
|
+
ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10936
|
+
len0 = WASM_VECTOR_LEN;
|
|
10937
|
+
ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10938
|
+
len1 = WASM_VECTOR_LEN;
|
|
10939
|
+
} catch (e) {
|
|
10940
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
10941
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
10942
|
+
throw e;
|
|
10943
|
+
}
|
|
9361
10944
|
const ret = wasm.to_extxyz_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
9362
10945
|
var ptr3 = ret[0];
|
|
9363
10946
|
var len3 = ret[1];
|
|
@@ -9481,24 +11064,26 @@ export function to_moljson(mol) {
|
|
|
9481
11064
|
* @returns {string}
|
|
9482
11065
|
*/
|
|
9483
11066
|
export function to_qcschema_molecule_json(mol, coords_json, charge, multiplicity) {
|
|
9484
|
-
let
|
|
9485
|
-
let
|
|
11067
|
+
let deferred5_0;
|
|
11068
|
+
let deferred5_1;
|
|
9486
11069
|
try {
|
|
9487
11070
|
_assertClass(mol, MolHandle);
|
|
11071
|
+
const val2 = +charge;
|
|
11072
|
+
const val3 = BigInt.asIntN(64, multiplicity);
|
|
9488
11073
|
const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
9489
11074
|
const len0 = WASM_VECTOR_LEN;
|
|
9490
|
-
const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0,
|
|
9491
|
-
var
|
|
9492
|
-
var
|
|
11075
|
+
const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
|
|
11076
|
+
var ptr4 = ret[0];
|
|
11077
|
+
var len4 = ret[1];
|
|
9493
11078
|
if (ret[3]) {
|
|
9494
|
-
|
|
11079
|
+
ptr4 = 0; len4 = 0;
|
|
9495
11080
|
throw takeFromExternrefTable0(ret[2]);
|
|
9496
11081
|
}
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
return getStringFromWasm0(
|
|
11082
|
+
deferred5_0 = ptr4;
|
|
11083
|
+
deferred5_1 = len4;
|
|
11084
|
+
return getStringFromWasm0(ptr4, len4);
|
|
9500
11085
|
} finally {
|
|
9501
|
-
wasm.__wbindgen_free(
|
|
11086
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
9502
11087
|
}
|
|
9503
11088
|
}
|
|
9504
11089
|
|
|
@@ -9627,6 +11212,32 @@ export function validate_nmr_spectrum_json(json) {
|
|
|
9627
11212
|
}
|
|
9628
11213
|
}
|
|
9629
11214
|
|
|
11215
|
+
/**
|
|
11216
|
+
* Explicit checked binary64 Angstrom positions; raw parse/write is independent.
|
|
11217
|
+
* @param {string} text
|
|
11218
|
+
* @returns {string}
|
|
11219
|
+
*/
|
|
11220
|
+
export function viewmol_positions_angstrom_json(text) {
|
|
11221
|
+
let deferred3_0;
|
|
11222
|
+
let deferred3_1;
|
|
11223
|
+
try {
|
|
11224
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11226
|
+
const ret = wasm.viewmol_positions_angstrom_json(ptr0, len0);
|
|
11227
|
+
var ptr2 = ret[0];
|
|
11228
|
+
var len2 = ret[1];
|
|
11229
|
+
if (ret[3]) {
|
|
11230
|
+
ptr2 = 0; len2 = 0;
|
|
11231
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11232
|
+
}
|
|
11233
|
+
deferred3_0 = ptr2;
|
|
11234
|
+
deferred3_1 = len2;
|
|
11235
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11236
|
+
} finally {
|
|
11237
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11238
|
+
}
|
|
11239
|
+
}
|
|
11240
|
+
|
|
9630
11241
|
/**
|
|
9631
11242
|
* Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
|
|
9632
11243
|
*
|
|
@@ -9641,19 +11252,27 @@ export function validate_nmr_spectrum_json(json) {
|
|
|
9641
11252
|
* @returns {string}
|
|
9642
11253
|
*/
|
|
9643
11254
|
export function virtual_screen_ecfp4_json(query_smi, db_smiles_json, k) {
|
|
9644
|
-
let
|
|
9645
|
-
let
|
|
11255
|
+
let deferred4_0;
|
|
11256
|
+
let deferred4_1;
|
|
9646
11257
|
try {
|
|
9647
|
-
const
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
11258
|
+
const val3 = +k;
|
|
11259
|
+
let ptr0, len0, ptr1, len1;
|
|
11260
|
+
try {
|
|
11261
|
+
ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11262
|
+
len0 = WASM_VECTOR_LEN;
|
|
11263
|
+
ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11264
|
+
len1 = WASM_VECTOR_LEN;
|
|
11265
|
+
} catch (e) {
|
|
11266
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
11267
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
11268
|
+
throw e;
|
|
11269
|
+
}
|
|
11270
|
+
const ret = wasm.virtual_screen_ecfp4_json(ptr0, len0, ptr1, len1, val3);
|
|
11271
|
+
deferred4_0 = ret[0];
|
|
11272
|
+
deferred4_1 = ret[1];
|
|
9654
11273
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
9655
11274
|
} finally {
|
|
9656
|
-
wasm.__wbindgen_free(
|
|
11275
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
9657
11276
|
}
|
|
9658
11277
|
}
|
|
9659
11278
|
|
|
@@ -9741,6 +11360,84 @@ export function write_cube_json(grid_json) {
|
|
|
9741
11360
|
}
|
|
9742
11361
|
}
|
|
9743
11362
|
|
|
11363
|
+
/**
|
|
11364
|
+
* Serialize validated edited fields; duplicate/unknown JSON keys refuse.
|
|
11365
|
+
* @param {string} json
|
|
11366
|
+
* @returns {string}
|
|
11367
|
+
*/
|
|
11368
|
+
export function write_fract_from_json(json) {
|
|
11369
|
+
let deferred3_0;
|
|
11370
|
+
let deferred3_1;
|
|
11371
|
+
try {
|
|
11372
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11373
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11374
|
+
const ret = wasm.write_fract_from_json(ptr0, len0);
|
|
11375
|
+
var ptr2 = ret[0];
|
|
11376
|
+
var len2 = ret[1];
|
|
11377
|
+
if (ret[3]) {
|
|
11378
|
+
ptr2 = 0; len2 = 0;
|
|
11379
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11380
|
+
}
|
|
11381
|
+
deferred3_0 = ptr2;
|
|
11382
|
+
deferred3_1 = len2;
|
|
11383
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11384
|
+
} finally {
|
|
11385
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
|
|
11389
|
+
/**
|
|
11390
|
+
* Write current fields. Duplicate/unknown keys and unsupported semantics refuse.
|
|
11391
|
+
* @param {string} json
|
|
11392
|
+
* @returns {string}
|
|
11393
|
+
*/
|
|
11394
|
+
export function write_gpr_from_json(json) {
|
|
11395
|
+
let deferred3_0;
|
|
11396
|
+
let deferred3_1;
|
|
11397
|
+
try {
|
|
11398
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11399
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11400
|
+
const ret = wasm.write_gpr_from_json(ptr0, len0);
|
|
11401
|
+
var ptr2 = ret[0];
|
|
11402
|
+
var len2 = ret[1];
|
|
11403
|
+
if (ret[3]) {
|
|
11404
|
+
ptr2 = 0; len2 = 0;
|
|
11405
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11406
|
+
}
|
|
11407
|
+
deferred3_0 = ptr2;
|
|
11408
|
+
deferred3_1 = len2;
|
|
11409
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11410
|
+
} finally {
|
|
11411
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11412
|
+
}
|
|
11413
|
+
}
|
|
11414
|
+
|
|
11415
|
+
/**
|
|
11416
|
+
* Write current fields without rescaling; unknown or duplicate keys refuse.
|
|
11417
|
+
* @param {string} text
|
|
11418
|
+
* @returns {string}
|
|
11419
|
+
*/
|
|
11420
|
+
export function write_gromos96_from_json(text) {
|
|
11421
|
+
let deferred3_0;
|
|
11422
|
+
let deferred3_1;
|
|
11423
|
+
try {
|
|
11424
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11425
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11426
|
+
const ret = wasm.write_gromos96_from_json(ptr0, len0);
|
|
11427
|
+
var ptr2 = ret[0];
|
|
11428
|
+
var len2 = ret[1];
|
|
11429
|
+
if (ret[3]) {
|
|
11430
|
+
ptr2 = 0; len2 = 0;
|
|
11431
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11432
|
+
}
|
|
11433
|
+
deferred3_0 = ptr2;
|
|
11434
|
+
deferred3_1 = len2;
|
|
11435
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11436
|
+
} finally {
|
|
11437
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11438
|
+
}
|
|
11439
|
+
}
|
|
11440
|
+
|
|
9744
11441
|
/**
|
|
9745
11442
|
* Write a LAMMPS data file from the JSON shape [`lammps_data_to_json`]
|
|
9746
11443
|
* returns.
|
|
@@ -9823,6 +11520,32 @@ export function write_lammps_trajectory_json(json) {
|
|
|
9823
11520
|
}
|
|
9824
11521
|
}
|
|
9825
11522
|
|
|
11523
|
+
/**
|
|
11524
|
+
* Write current fields without rescaling; unknown or duplicate keys refuse.
|
|
11525
|
+
* @param {string} text
|
|
11526
|
+
* @returns {string}
|
|
11527
|
+
*/
|
|
11528
|
+
export function write_lpmd_from_json(text) {
|
|
11529
|
+
let deferred3_0;
|
|
11530
|
+
let deferred3_1;
|
|
11531
|
+
try {
|
|
11532
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11533
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11534
|
+
const ret = wasm.write_lpmd_from_json(ptr0, len0);
|
|
11535
|
+
var ptr2 = ret[0];
|
|
11536
|
+
var len2 = ret[1];
|
|
11537
|
+
if (ret[3]) {
|
|
11538
|
+
ptr2 = 0; len2 = 0;
|
|
11539
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11540
|
+
}
|
|
11541
|
+
deferred3_0 = ptr2;
|
|
11542
|
+
deferred3_1 = len2;
|
|
11543
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11544
|
+
} finally {
|
|
11545
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11546
|
+
}
|
|
11547
|
+
}
|
|
11548
|
+
|
|
9826
11549
|
/**
|
|
9827
11550
|
* Write an mmCIF file from atom records in the JSON shape
|
|
9828
11551
|
* [`mmcif_to_json`]'s `"atoms"` array uses (a full record per atom, not
|
|
@@ -9832,6 +11555,8 @@ export function write_lammps_trajectory_json(json) {
|
|
|
9832
11555
|
*
|
|
9833
11556
|
* `cell_json`: `"null"` or `{"a":...,"b":...,"c":...,"alpha":...,"beta":...,"gamma":...}`.
|
|
9834
11557
|
* `space_group`: pass `""` for none.
|
|
11558
|
+
* Finite numeric fields retain their binary64 values without fixed decimal
|
|
11559
|
+
* rounding. This does not retain original spelling or uncertainty suffixes.
|
|
9835
11560
|
* @param {string} records_json
|
|
9836
11561
|
* @param {string} cell_json
|
|
9837
11562
|
* @param {string} space_group
|
|
@@ -9842,14 +11567,23 @@ export function write_mmcif_json(records_json, cell_json, space_group, data_bloc
|
|
|
9842
11567
|
let deferred6_0;
|
|
9843
11568
|
let deferred6_1;
|
|
9844
11569
|
try {
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
11570
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
11571
|
+
try {
|
|
11572
|
+
ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11573
|
+
len0 = WASM_VECTOR_LEN;
|
|
11574
|
+
ptr1 = passStringToWasm0(cell_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11575
|
+
len1 = WASM_VECTOR_LEN;
|
|
11576
|
+
ptr2 = passStringToWasm0(space_group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11577
|
+
len2 = WASM_VECTOR_LEN;
|
|
11578
|
+
ptr3 = passStringToWasm0(data_block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11579
|
+
len3 = WASM_VECTOR_LEN;
|
|
11580
|
+
} catch (e) {
|
|
11581
|
+
if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
|
|
11582
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
11583
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
11584
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
11585
|
+
throw e;
|
|
11586
|
+
}
|
|
9853
11587
|
const ret = wasm.write_mmcif_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
9854
11588
|
var ptr5 = ret[0];
|
|
9855
11589
|
var len5 = ret[1];
|
|
@@ -9953,6 +11687,35 @@ export function write_orca_input_json(json) {
|
|
|
9953
11687
|
}
|
|
9954
11688
|
}
|
|
9955
11689
|
|
|
11690
|
+
/**
|
|
11691
|
+
* Write represented ORCA input fields with exact finite Cartesian values.
|
|
11692
|
+
* Requires explicit fields, rejects unknown/duplicate JSON fields, unit
|
|
11693
|
+
* conflicts, %coords and any metadata that would change on structured reparse.
|
|
11694
|
+
* Accepts either kind or type coordinate tags, never both. No job validation.
|
|
11695
|
+
* @param {string} input_json
|
|
11696
|
+
* @returns {string}
|
|
11697
|
+
*/
|
|
11698
|
+
export function write_orca_input_json_checked(input_json) {
|
|
11699
|
+
let deferred3_0;
|
|
11700
|
+
let deferred3_1;
|
|
11701
|
+
try {
|
|
11702
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11703
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11704
|
+
const ret = wasm.write_orca_input_json_checked(ptr0, len0);
|
|
11705
|
+
var ptr2 = ret[0];
|
|
11706
|
+
var len2 = ret[1];
|
|
11707
|
+
if (ret[3]) {
|
|
11708
|
+
ptr2 = 0; len2 = 0;
|
|
11709
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11710
|
+
}
|
|
11711
|
+
deferred3_0 = ptr2;
|
|
11712
|
+
deferred3_1 = len2;
|
|
11713
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11714
|
+
} finally {
|
|
11715
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11716
|
+
}
|
|
11717
|
+
}
|
|
11718
|
+
|
|
9956
11719
|
/**
|
|
9957
11720
|
* Write a PQR file from atom records in the JSON shape [`pqr_to_json`]'s
|
|
9958
11721
|
* `"atoms"` array uses. Each atom's `chain_id` independently controls
|
|
@@ -9982,6 +11745,34 @@ export function write_pqr_json(records_json) {
|
|
|
9982
11745
|
}
|
|
9983
11746
|
}
|
|
9984
11747
|
|
|
11748
|
+
/**
|
|
11749
|
+
* Write explicit PQR atom records without numeric rounding or bond inference.
|
|
11750
|
+
* Strict JSON array: no duplicate/unknown fields, missing required values or
|
|
11751
|
+
* incompatible elements. Non-atom source metadata is not represented.
|
|
11752
|
+
* @param {string} records_json
|
|
11753
|
+
* @returns {string}
|
|
11754
|
+
*/
|
|
11755
|
+
export function write_pqr_json_checked(records_json) {
|
|
11756
|
+
let deferred3_0;
|
|
11757
|
+
let deferred3_1;
|
|
11758
|
+
try {
|
|
11759
|
+
const ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11761
|
+
const ret = wasm.write_pqr_json_checked(ptr0, len0);
|
|
11762
|
+
var ptr2 = ret[0];
|
|
11763
|
+
var len2 = ret[1];
|
|
11764
|
+
if (ret[3]) {
|
|
11765
|
+
ptr2 = 0; len2 = 0;
|
|
11766
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11767
|
+
}
|
|
11768
|
+
deferred3_0 = ptr2;
|
|
11769
|
+
deferred3_1 = len2;
|
|
11770
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11771
|
+
} finally {
|
|
11772
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11773
|
+
}
|
|
11774
|
+
}
|
|
11775
|
+
|
|
9985
11776
|
/**
|
|
9986
11777
|
* Non-canonical SMILES for `mol`.
|
|
9987
11778
|
*
|
|
@@ -10005,6 +11796,58 @@ export function write_smiles(mol) {
|
|
|
10005
11796
|
}
|
|
10006
11797
|
}
|
|
10007
11798
|
|
|
11799
|
+
/**
|
|
11800
|
+
* Serialize validated edited fields; duplicate/unknown JSON keys refuse.
|
|
11801
|
+
* @param {string} json
|
|
11802
|
+
* @returns {string}
|
|
11803
|
+
*/
|
|
11804
|
+
export function write_unixyz_from_json(json) {
|
|
11805
|
+
let deferred3_0;
|
|
11806
|
+
let deferred3_1;
|
|
11807
|
+
try {
|
|
11808
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11809
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11810
|
+
const ret = wasm.write_unixyz_from_json(ptr0, len0);
|
|
11811
|
+
var ptr2 = ret[0];
|
|
11812
|
+
var len2 = ret[1];
|
|
11813
|
+
if (ret[3]) {
|
|
11814
|
+
ptr2 = 0; len2 = 0;
|
|
11815
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11816
|
+
}
|
|
11817
|
+
deferred3_0 = ptr2;
|
|
11818
|
+
deferred3_1 = len2;
|
|
11819
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11820
|
+
} finally {
|
|
11821
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11822
|
+
}
|
|
11823
|
+
}
|
|
11824
|
+
|
|
11825
|
+
/**
|
|
11826
|
+
* Write current fields without rescaling; unknown or duplicate keys refuse.
|
|
11827
|
+
* @param {string} text
|
|
11828
|
+
* @returns {string}
|
|
11829
|
+
*/
|
|
11830
|
+
export function write_viewmol_from_json(text) {
|
|
11831
|
+
let deferred3_0;
|
|
11832
|
+
let deferred3_1;
|
|
11833
|
+
try {
|
|
11834
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
11835
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11836
|
+
const ret = wasm.write_viewmol_from_json(ptr0, len0);
|
|
11837
|
+
var ptr2 = ret[0];
|
|
11838
|
+
var len2 = ret[1];
|
|
11839
|
+
if (ret[3]) {
|
|
11840
|
+
ptr2 = 0; len2 = 0;
|
|
11841
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11842
|
+
}
|
|
11843
|
+
deferred3_0 = ptr2;
|
|
11844
|
+
deferred3_1 = len2;
|
|
11845
|
+
return getStringFromWasm0(ptr2, len2);
|
|
11846
|
+
} finally {
|
|
11847
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
11848
|
+
}
|
|
11849
|
+
}
|
|
11850
|
+
|
|
10008
11851
|
/**
|
|
10009
11852
|
* XLogP3 partition coefficient (alternative to Crippen LogP).
|
|
10010
11853
|
* Returns JSON: `{"xlogp3": float}`.
|
|
@@ -10054,61 +11897,63 @@ export function xlogp3_per_atom_json(mol) {
|
|
|
10054
11897
|
* @returns {string}
|
|
10055
11898
|
*/
|
|
10056
11899
|
export function xyz_frames_batch_json(text, offset, batch_size) {
|
|
10057
|
-
let
|
|
10058
|
-
let
|
|
11900
|
+
let deferred5_0;
|
|
11901
|
+
let deferred5_1;
|
|
10059
11902
|
try {
|
|
11903
|
+
const val2 = +offset;
|
|
11904
|
+
const val3 = +batch_size;
|
|
10060
11905
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10061
11906
|
const len0 = WASM_VECTOR_LEN;
|
|
10062
|
-
const ret = wasm.xyz_frames_batch_json(ptr0, len0,
|
|
10063
|
-
var
|
|
10064
|
-
var
|
|
11907
|
+
const ret = wasm.xyz_frames_batch_json(ptr0, len0, val2, val3);
|
|
11908
|
+
var ptr4 = ret[0];
|
|
11909
|
+
var len4 = ret[1];
|
|
10065
11910
|
if (ret[3]) {
|
|
10066
|
-
|
|
11911
|
+
ptr4 = 0; len4 = 0;
|
|
10067
11912
|
throw takeFromExternrefTable0(ret[2]);
|
|
10068
11913
|
}
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
return getStringFromWasm0(
|
|
11914
|
+
deferred5_0 = ptr4;
|
|
11915
|
+
deferred5_1 = len4;
|
|
11916
|
+
return getStringFromWasm0(ptr4, len4);
|
|
10072
11917
|
} finally {
|
|
10073
|
-
wasm.__wbindgen_free(
|
|
11918
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
10074
11919
|
}
|
|
10075
11920
|
}
|
|
10076
11921
|
function __wbg_get_imports() {
|
|
10077
11922
|
const import0 = {
|
|
10078
11923
|
__proto__: null,
|
|
10079
|
-
|
|
11924
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
10080
11925
|
const ret = arg0 === undefined;
|
|
10081
11926
|
return ret;
|
|
10082
11927
|
},
|
|
10083
|
-
|
|
11928
|
+
__wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
|
|
10084
11929
|
const obj = arg1;
|
|
10085
11930
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
10086
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
10087
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
11931
|
+
getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
11932
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
10088
11933
|
},
|
|
10089
|
-
|
|
11934
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
10090
11935
|
const obj = arg1;
|
|
10091
11936
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
10092
11937
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
10093
11938
|
var len1 = WASM_VECTOR_LEN;
|
|
10094
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
10095
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
11939
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
11940
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
10096
11941
|
},
|
|
10097
|
-
|
|
11942
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
10098
11943
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
10099
11944
|
},
|
|
10100
|
-
|
|
11945
|
+
__wbg_error_d1fc0193610e0e39: function(arg0) {
|
|
10101
11946
|
console.error(arg0);
|
|
10102
11947
|
},
|
|
10103
11948
|
__wbg_molhandle_new: function(arg0) {
|
|
10104
11949
|
const ret = MolHandle.__wrap(arg0);
|
|
10105
11950
|
return ret;
|
|
10106
11951
|
},
|
|
10107
|
-
|
|
11952
|
+
__wbg_new_from_slice_3512352010266e02: function(arg0, arg1) {
|
|
10108
11953
|
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
10109
11954
|
return ret;
|
|
10110
11955
|
},
|
|
10111
|
-
|
|
11956
|
+
__wbg_new_from_slice_aaf85a9746711968: function(arg0, arg1) {
|
|
10112
11957
|
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
10113
11958
|
return ret;
|
|
10114
11959
|
},
|
|
@@ -10116,24 +11961,24 @@ function __wbg_get_imports() {
|
|
|
10116
11961
|
const ret = arg0.now();
|
|
10117
11962
|
return ret;
|
|
10118
11963
|
},
|
|
10119
|
-
|
|
11964
|
+
__wbg_performance_7e4e4494fdc9d07a: function(arg0) {
|
|
10120
11965
|
const ret = arg0.performance;
|
|
10121
11966
|
return ret;
|
|
10122
11967
|
},
|
|
10123
|
-
|
|
10124
|
-
const ret = typeof
|
|
11968
|
+
__wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
|
|
11969
|
+
const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
|
|
10125
11970
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
10126
11971
|
},
|
|
10127
|
-
|
|
10128
|
-
const ret = typeof
|
|
11972
|
+
__wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
|
|
11973
|
+
const ret = typeof global === 'undefined' ? undefined : global;
|
|
10129
11974
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
10130
11975
|
},
|
|
10131
|
-
|
|
10132
|
-
const ret = typeof self === 'undefined' ?
|
|
11976
|
+
__wbg_static_accessor_SELF_53bb20457401453d: function() {
|
|
11977
|
+
const ret = typeof self === 'undefined' ? undefined : self;
|
|
10133
11978
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
10134
11979
|
},
|
|
10135
|
-
|
|
10136
|
-
const ret = typeof window === 'undefined' ?
|
|
11980
|
+
__wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
|
|
11981
|
+
const ret = typeof window === 'undefined' ? undefined : window;
|
|
10137
11982
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
10138
11983
|
},
|
|
10139
11984
|
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
@@ -10148,12 +11993,11 @@ function __wbg_get_imports() {
|
|
|
10148
11993
|
},
|
|
10149
11994
|
__wbindgen_init_externref_table: function() {
|
|
10150
11995
|
const table = wasm.__wbindgen_externrefs;
|
|
10151
|
-
const offset = table.grow(4);
|
|
10152
11996
|
table.set(0, undefined);
|
|
10153
|
-
table.set(
|
|
10154
|
-
table.set(
|
|
10155
|
-
table.set(
|
|
10156
|
-
table.set(
|
|
11997
|
+
table.set(1024, undefined);
|
|
11998
|
+
table.set(1025, null);
|
|
11999
|
+
table.set(1026, true);
|
|
12000
|
+
table.set(1027, false);
|
|
10157
12001
|
},
|
|
10158
12002
|
};
|
|
10159
12003
|
return {
|
|
@@ -10245,7 +12089,8 @@ function getFloat64ArrayMemory0() {
|
|
|
10245
12089
|
}
|
|
10246
12090
|
|
|
10247
12091
|
function getStringFromWasm0(ptr, len) {
|
|
10248
|
-
|
|
12092
|
+
ptr = ptr >>> 0;
|
|
12093
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
10249
12094
|
}
|
|
10250
12095
|
|
|
10251
12096
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -10325,18 +12170,18 @@ function takeFromExternrefTable0(idx) {
|
|
|
10325
12170
|
return value;
|
|
10326
12171
|
}
|
|
10327
12172
|
|
|
10328
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
12173
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
10329
12174
|
cachedTextDecoder.decode();
|
|
10330
12175
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
10331
12176
|
let numBytesDecoded = 0;
|
|
10332
|
-
function decodeText(
|
|
10333
|
-
numBytesDecoded +=
|
|
12177
|
+
function decodeText(bytes) {
|
|
12178
|
+
numBytesDecoded += bytes.length;
|
|
10334
12179
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
10335
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
12180
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
10336
12181
|
cachedTextDecoder.decode();
|
|
10337
|
-
numBytesDecoded =
|
|
12182
|
+
numBytesDecoded = bytes.length;
|
|
10338
12183
|
}
|
|
10339
|
-
return cachedTextDecoder.decode(
|
|
12184
|
+
return cachedTextDecoder.decode(bytes);
|
|
10340
12185
|
}
|
|
10341
12186
|
|
|
10342
12187
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -10426,9 +12271,17 @@ function initSync(module) {
|
|
|
10426
12271
|
return __wbg_finalize_init(instance, module);
|
|
10427
12272
|
}
|
|
10428
12273
|
|
|
12274
|
+
let __wbg_init_promise;
|
|
10429
12275
|
async function __wbg_init(module_or_path) {
|
|
10430
12276
|
if (wasm !== undefined) return wasm;
|
|
12277
|
+
if (__wbg_init_promise === undefined) {
|
|
12278
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
12279
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
12280
|
+
}
|
|
12281
|
+
return __wbg_init_promise;
|
|
12282
|
+
}
|
|
10431
12283
|
|
|
12284
|
+
async function __wbg_init_once(module_or_path) {
|
|
10432
12285
|
|
|
10433
12286
|
if (module_or_path !== undefined) {
|
|
10434
12287
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|