@kent-tokyo/chematic 0.1.5 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,32 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * Style options for [`MolHandle::depict_svg_opts`].
6
+ *
7
+ * Construct with `new DepictOptions()`, then call setters:
8
+ * ```js
9
+ * const opts = new DepictOptions();
10
+ * opts.set_background("transparent");
11
+ * opts.set_dark(true);
12
+ * opts.set_width(240);
13
+ * opts.set_height(240);
14
+ * ```
15
+ */
16
+ export class DepictOptions {
17
+ free(): void;
18
+ [Symbol.dispose](): void;
19
+ constructor();
20
+ set_background(bg: string): void;
21
+ set_dark(dark: boolean): void;
22
+ set_height(h: number): void;
23
+ set_highlight_atoms(atoms: Uint32Array): void;
24
+ set_highlight_bonds(bonds: Uint32Array): void;
25
+ set_highlight_color(color: string): void;
26
+ set_padding(p: number): void;
27
+ set_width(w: number): void;
28
+ }
29
+
4
30
  /**
5
31
  * A handle to a parsed molecule. Owns the molecule behind an `Rc` so that
6
32
  * it can be cheaply cloned on the JS side without copying atom/bond data.
@@ -17,6 +43,10 @@ export class MolHandle {
17
43
  * Number of heavy atoms (explicit atoms in the graph; does not count implicit H).
18
44
  */
19
45
  atom_count(): number;
46
+ /**
47
+ * Bertz complexity index (BertzCT).
48
+ */
49
+ bertz_ct(): number;
20
50
  /**
21
51
  * Number of bonds.
22
52
  */
@@ -25,10 +55,54 @@ export class MolHandle {
25
55
  * Canonical SMILES string.
26
56
  */
27
57
  canonical_smiles(): string;
58
+ /**
59
+ * Kier–Hall χ0 molecular connectivity index.
60
+ */
61
+ chi0(): number;
62
+ /**
63
+ * Kier–Hall χ0v valence-weighted connectivity index.
64
+ */
65
+ chi0v(): number;
66
+ /**
67
+ * Kier–Hall χ1 molecular connectivity index.
68
+ */
69
+ chi1(): number;
70
+ /**
71
+ * Kier–Hall χ1v valence-weighted connectivity index.
72
+ */
73
+ chi1v(): number;
74
+ /**
75
+ * Kier–Hall χ2 molecular connectivity index.
76
+ */
77
+ chi2(): number;
78
+ /**
79
+ * Kier–Hall χ2v valence-weighted connectivity index.
80
+ */
81
+ chi2v(): number;
82
+ /**
83
+ * Kier–Hall χ3 molecular connectivity index.
84
+ */
85
+ chi3(): number;
86
+ /**
87
+ * Kier–Hall χ3v valence-weighted connectivity index.
88
+ */
89
+ chi3v(): number;
90
+ /**
91
+ * Kier–Hall χ4 molecular connectivity index.
92
+ */
93
+ chi4(): number;
94
+ /**
95
+ * Kier–Hall χ4v valence-weighted connectivity index.
96
+ */
97
+ chi4v(): number;
28
98
  /**
29
99
  * 2D SVG depiction of the molecule (CPK coloring).
30
100
  */
31
101
  depict_svg(): string;
102
+ /**
103
+ * 2D SVG depiction with style options.
104
+ */
105
+ depict_svg_opts(opts: DepictOptions): string;
32
106
  /**
33
107
  * Returns `true` if the molecule passes Egan's absorption criteria
34
108
  * (TPSA ≤ 131.6 Ų and LogP ≤ 5.88).
@@ -67,6 +141,22 @@ export class MolHandle {
67
141
  * Number of non-hydrogen heavy atoms.
68
142
  */
69
143
  heavy_atom_count(): number;
144
+ /**
145
+ * Hall–Kier κ1 shape index.
146
+ */
147
+ kappa1(): number;
148
+ /**
149
+ * Hall–Kier κ2 shape index.
150
+ */
151
+ kappa2(): number;
152
+ /**
153
+ * Hall–Kier κ3 shape index.
154
+ */
155
+ kappa3(): number;
156
+ /**
157
+ * Labute approximate surface area (Ų).
158
+ */
159
+ labute_asa(): number;
70
160
  /**
71
161
  * Returns `true` if the molecule satisfies Lipinski's Rule of Five.
72
162
  */
@@ -83,6 +173,12 @@ export class MolHandle {
83
173
  * Average molecular weight (Da).
84
174
  */
85
175
  molecular_weight(): number;
176
+ /**
177
+ * Morgan count fingerprint as a JSON object string (`{"<hash>": count, …}`).
178
+ *
179
+ * `radius` controls the ECFP radius (2 = ECFP4-equivalent).
180
+ */
181
+ morgan_fp_counts_json(radius: number): string;
86
182
  /**
87
183
  * Number of non-aromatic rings containing at least one heteroatom.
88
184
  */
@@ -140,8 +236,17 @@ export class MolHandle {
140
236
  * (TPSA ≤ 140 Ų and rotatable bonds ≤ 10).
141
237
  */
142
238
  veber_passes(): boolean;
239
+ /**
240
+ * Wiener topological index (sum of all pairwise shortest-path distances).
241
+ */
242
+ wiener_index(): number;
143
243
  }
144
244
 
245
+ /**
246
+ * Return a copy of the molecule with all implicit hydrogens converted to explicit H atoms.
247
+ */
248
+ export function add_hydrogens(mol: MolHandle): MolHandle;
249
+
145
250
  /**
146
251
  * Number of BRICS fragments produced by fragmenting the molecule.
147
252
  *
@@ -149,11 +254,24 @@ export class MolHandle {
149
254
  */
150
255
  export function brics_fragment_count(mol: MolHandle): number;
151
256
 
257
+ /**
258
+ * Render a grid SVG from newline-separated SMILES (one per line).
259
+ *
260
+ * Lines that fail to parse are silently skipped.
261
+ * `cols` controls the number of columns (each cell is 200×200 px).
262
+ */
263
+ export function depict_svg_grid(smiles_block: string, cols: number): string;
264
+
152
265
  /**
153
266
  * Compute the ECFP4 fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
154
267
  */
155
268
  export function ecfp4_bitvec(mol: MolHandle): Uint8Array;
156
269
 
270
+ /**
271
+ * Returns `true` if the SMILES string can be parsed without error.
272
+ */
273
+ export function is_valid_smiles(s: string): boolean;
274
+
157
275
  /**
158
276
  * Parse a SMILES string into a `MolHandle`.
159
277
  *
@@ -161,6 +279,20 @@ export function ecfp4_bitvec(mol: MolHandle): Uint8Array;
161
279
  */
162
280
  export function parse_smiles(s: string): MolHandle;
163
281
 
282
+ /**
283
+ * Return a copy of the molecule with all explicit hydrogen atoms removed.
284
+ */
285
+ export function remove_hydrogens(mol: MolHandle): MolHandle;
286
+
287
+ /**
288
+ * Apply a SMIRKS reaction template and return product SMILES as a JSON string.
289
+ *
290
+ * `reactants_smiles`: pipe-separated SMILES, one per reactant slot in the SMIRKS.
291
+ * Returns a JSON array of arrays: `[["product_smi", …], …]`.
292
+ * Returns a JS error on parse failure or arity mismatch.
293
+ */
294
+ export function run_reactants(smirks: string, reactants_smiles: string): string;
295
+
164
296
  /**
165
297
  * Tanimoto similarity between two molecules using AtomPair fingerprints.
166
298
  */
@@ -180,3 +312,110 @@ export function tanimoto_fcfp4(a: MolHandle, b: MolHandle): number;
180
312
  * Tanimoto similarity between two molecules using Topological Torsion fingerprints.
181
313
  */
182
314
  export function tanimoto_torsion(a: MolHandle, b: MolHandle): number;
315
+
316
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
317
+
318
+ export interface InitOutput {
319
+ readonly memory: WebAssembly.Memory;
320
+ readonly __wbg_depictoptions_free: (a: number, b: number) => void;
321
+ readonly __wbg_molhandle_free: (a: number, b: number) => void;
322
+ readonly add_hydrogens: (a: number) => number;
323
+ readonly brics_fragment_count: (a: number) => number;
324
+ readonly depict_svg_grid: (a: number, b: number, c: number) => [number, number];
325
+ readonly depictoptions_new: () => number;
326
+ readonly depictoptions_set_background: (a: number, b: number, c: number) => void;
327
+ readonly depictoptions_set_dark: (a: number, b: number) => void;
328
+ readonly depictoptions_set_height: (a: number, b: number) => void;
329
+ readonly depictoptions_set_highlight_atoms: (a: number, b: number, c: number) => void;
330
+ readonly depictoptions_set_highlight_bonds: (a: number, b: number, c: number) => void;
331
+ readonly depictoptions_set_highlight_color: (a: number, b: number, c: number) => void;
332
+ readonly depictoptions_set_padding: (a: number, b: number) => void;
333
+ readonly depictoptions_set_width: (a: number, b: number) => void;
334
+ readonly ecfp4_bitvec: (a: number) => [number, number];
335
+ readonly is_valid_smiles: (a: number, b: number) => number;
336
+ readonly molhandle_aromatic_ring_count: (a: number) => number;
337
+ readonly molhandle_atom_count: (a: number) => number;
338
+ readonly molhandle_bertz_ct: (a: number) => number;
339
+ readonly molhandle_bond_count: (a: number) => number;
340
+ readonly molhandle_canonical_smiles: (a: number) => [number, number];
341
+ readonly molhandle_chi0: (a: number) => number;
342
+ readonly molhandle_chi0v: (a: number) => number;
343
+ readonly molhandle_chi1: (a: number) => number;
344
+ readonly molhandle_chi1v: (a: number) => number;
345
+ readonly molhandle_chi2: (a: number) => number;
346
+ readonly molhandle_chi2v: (a: number) => number;
347
+ readonly molhandle_chi3: (a: number) => number;
348
+ readonly molhandle_chi3v: (a: number) => number;
349
+ readonly molhandle_chi4: (a: number) => number;
350
+ readonly molhandle_chi4v: (a: number) => number;
351
+ readonly molhandle_depict_svg: (a: number) => [number, number];
352
+ readonly molhandle_depict_svg_opts: (a: number, b: number) => [number, number];
353
+ readonly molhandle_egan_passes: (a: number) => number;
354
+ readonly molhandle_exact_mass: (a: number) => number;
355
+ readonly molhandle_formal_charge_sum: (a: number) => number;
356
+ readonly molhandle_formula: (a: number) => [number, number];
357
+ readonly molhandle_fsp3: (a: number) => number;
358
+ readonly molhandle_ghose_passes: (a: number) => number;
359
+ readonly molhandle_hba_count: (a: number) => number;
360
+ readonly molhandle_hbd_count: (a: number) => number;
361
+ readonly molhandle_heavy_atom_count: (a: number) => number;
362
+ readonly molhandle_kappa1: (a: number) => number;
363
+ readonly molhandle_kappa2: (a: number) => number;
364
+ readonly molhandle_kappa3: (a: number) => number;
365
+ readonly molhandle_labute_asa: (a: number) => number;
366
+ readonly molhandle_lipinski_passes: (a: number) => number;
367
+ readonly molhandle_logp_crippen: (a: number) => number;
368
+ readonly molhandle_molar_refractivity: (a: number) => number;
369
+ readonly molhandle_molecular_weight: (a: number) => number;
370
+ readonly molhandle_morgan_fp_counts_json: (a: number, b: number) => [number, number];
371
+ readonly molhandle_num_aliphatic_heterocycles: (a: number) => number;
372
+ readonly molhandle_num_aromatic_heterocycles: (a: number) => number;
373
+ readonly molhandle_num_bridgehead_atoms: (a: number) => number;
374
+ readonly molhandle_num_heteroatoms: (a: number) => number;
375
+ readonly molhandle_num_saturated_heterocycles: (a: number) => number;
376
+ readonly molhandle_num_spiro_atoms: (a: number) => number;
377
+ readonly molhandle_num_stereocenters: (a: number) => number;
378
+ readonly molhandle_pains_passes: (a: number) => number;
379
+ readonly molhandle_qed: (a: number) => number;
380
+ readonly molhandle_reos_passes: (a: number) => number;
381
+ readonly molhandle_ring_count: (a: number) => number;
382
+ readonly molhandle_rotatable_bond_count: (a: number) => number;
383
+ readonly molhandle_tpsa: (a: number) => number;
384
+ readonly molhandle_veber_passes: (a: number) => number;
385
+ readonly molhandle_wiener_index: (a: number) => number;
386
+ readonly parse_smiles: (a: number, b: number) => [number, number, number];
387
+ readonly remove_hydrogens: (a: number) => number;
388
+ readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
389
+ readonly tanimoto_atom_pair: (a: number, b: number) => number;
390
+ readonly tanimoto_ecfp4: (a: number, b: number) => number;
391
+ readonly tanimoto_fcfp4: (a: number, b: number) => number;
392
+ readonly tanimoto_torsion: (a: number, b: number) => number;
393
+ readonly __wbindgen_externrefs: WebAssembly.Table;
394
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
395
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
396
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
397
+ readonly __externref_table_dealloc: (a: number) => void;
398
+ readonly __wbindgen_start: () => void;
399
+ }
400
+
401
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
402
+
403
+ /**
404
+ * Instantiates the given `module`, which can either be bytes or
405
+ * a precompiled `WebAssembly.Module`.
406
+ *
407
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
408
+ *
409
+ * @returns {InitOutput}
410
+ */
411
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
412
+
413
+ /**
414
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
415
+ * for everything else, calls `WebAssembly.instantiate` directly.
416
+ *
417
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
418
+ *
419
+ * @returns {Promise<InitOutput>}
420
+ */
421
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;