@kent-tokyo/chematic 0.49.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chematic_wasm.d.ts +21 -1
- package/chematic_wasm.js +41 -1
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +2 -2
package/chematic_wasm.d.ts
CHANGED
|
@@ -517,6 +517,8 @@ export function balance_check_json(reaction_smiles: string): string;
|
|
|
517
517
|
*
|
|
518
518
|
* Empty lines and invalid SMILES are silently skipped.
|
|
519
519
|
* Returns the same card-grid HTML as Python's `chematic.report()`.
|
|
520
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
521
|
+
* per successfully parsed molecule. Limit violations return an HTML error.
|
|
520
522
|
*
|
|
521
523
|
* ```js
|
|
522
524
|
* const html = mod.batch_report_html("CCO\nc1ccccc1\nCC(=O)O");
|
|
@@ -582,6 +584,13 @@ export function canonical_tautomer(mol: MolHandle): MolHandle;
|
|
|
582
584
|
*/
|
|
583
585
|
export function canonical_tautomer_with_blocked_atoms_json(mol: MolHandle, blocked_atom_indices_json: string): string;
|
|
584
586
|
|
|
587
|
+
/**
|
|
588
|
+
* Parse a CDXML document while preserving page and presentation objects.
|
|
589
|
+
* The returned JSON contains an opaque `raw_xml` for each object so unknown
|
|
590
|
+
* ChemDraw extensions are never silently discarded.
|
|
591
|
+
*/
|
|
592
|
+
export function cdxml_document_json(cdxml: string): string;
|
|
593
|
+
|
|
585
594
|
/**
|
|
586
595
|
* Parse all molecular fragments from a CDXML string.
|
|
587
596
|
*
|
|
@@ -638,6 +647,8 @@ export function cip_unresolved_json(mol: MolHandle): string;
|
|
|
638
647
|
/**
|
|
639
648
|
* Compare multiple SMILES strings (up to 256 by default).
|
|
640
649
|
* Accepts a delimiter-separated list (e.g., newline or comma).
|
|
650
|
+
* The input is limited to 1 MiB, 1,024 records, and 10,000 atoms per parsed
|
|
651
|
+
* molecule.
|
|
641
652
|
*
|
|
642
653
|
* # Example (JS)
|
|
643
654
|
* ```javascript
|
|
@@ -754,6 +765,9 @@ export function depict_reaction_svg(rxn_smiles: string): string;
|
|
|
754
765
|
*
|
|
755
766
|
* Lines that fail to parse are silently skipped.
|
|
756
767
|
* `cols` controls the number of columns (each cell is 200×200 px).
|
|
768
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
769
|
+
* per successfully parsed molecule. Limit violations return an empty SVG
|
|
770
|
+
* containing an error title.
|
|
757
771
|
*/
|
|
758
772
|
export function depict_svg_grid(smiles_block: string, cols: number): string;
|
|
759
773
|
|
|
@@ -767,6 +781,9 @@ export function depict_svg_grid(smiles_block: string, cols: number): string;
|
|
|
767
781
|
*
|
|
768
782
|
* Invalid SMILES are rendered as empty cells; SMARTS parse failure returns an
|
|
769
783
|
* unhighlighted grid (the SMARTS is silently ignored).
|
|
784
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
785
|
+
* per successfully parsed molecule. Limit violations return an empty SVG
|
|
786
|
+
* containing an error title.
|
|
770
787
|
*/
|
|
771
788
|
export function depict_svg_grid_highlighted(smiles_block: string, cols: number, match_smarts: string): string;
|
|
772
789
|
|
|
@@ -2081,7 +2098,7 @@ export function remove_hydrogens(mol: MolHandle): MolHandle;
|
|
|
2081
2098
|
* APIs. This function changes nothing about the underlying algorithm; it
|
|
2082
2099
|
* only serializes the result to JSON.
|
|
2083
2100
|
*
|
|
2084
|
-
* `max_results` -- cap on returned disconnections (0 =
|
|
2101
|
+
* `max_results` -- cap on returned disconnections (0 = the WASM safety cap).
|
|
2085
2102
|
*
|
|
2086
2103
|
* `reaction_class` -- filter to a single reaction class, or `""` for all
|
|
2087
2104
|
* classes. Valid values: `"AmideBond"`, `"Ester"`, `"Ether"`, `"CNBond"`,
|
|
@@ -2144,6 +2161,8 @@ export function sa_score(mol: MolHandle): number;
|
|
|
2144
2161
|
* Screen a batch of SMILES strings (JSON string output).
|
|
2145
2162
|
* Returns per-record results including pass/fail with error details.
|
|
2146
2163
|
* Includes MaxMin diversity picking and Butina clustering by default.
|
|
2164
|
+
* The input is limited to 1 MiB, 1,024 records, and 10,000 atoms per parsed
|
|
2165
|
+
* molecule.
|
|
2147
2166
|
*
|
|
2148
2167
|
* # Example (JS)
|
|
2149
2168
|
* ```javascript
|
|
@@ -2610,6 +2629,7 @@ export interface InitOutput {
|
|
|
2610
2629
|
readonly butina_cluster_ecfp4_json: (a: number, b: number, c: number) => [number, number, number, number];
|
|
2611
2630
|
readonly canonical_tautomer: (a: number) => number;
|
|
2612
2631
|
readonly canonical_tautomer_with_blocked_atoms_json: (a: number, b: number, c: number) => [number, number];
|
|
2632
|
+
readonly cdxml_document_json: (a: number, b: number) => [number, number, number, number];
|
|
2613
2633
|
readonly cdxml_to_smiles_json: (a: number, b: number) => [number, number, number, number];
|
|
2614
2634
|
readonly charge_parent_json: (a: number) => [number, number];
|
|
2615
2635
|
readonly chematic_version: () => [number, number];
|
package/chematic_wasm.js
CHANGED
|
@@ -1206,6 +1206,8 @@ export function balance_check_json(reaction_smiles) {
|
|
|
1206
1206
|
*
|
|
1207
1207
|
* Empty lines and invalid SMILES are silently skipped.
|
|
1208
1208
|
* Returns the same card-grid HTML as Python's `chematic.report()`.
|
|
1209
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
1210
|
+
* per successfully parsed molecule. Limit violations return an HTML error.
|
|
1209
1211
|
*
|
|
1210
1212
|
* ```js
|
|
1211
1213
|
* const html = mod.batch_report_html("CCO\nc1ccccc1\nCC(=O)O");
|
|
@@ -1366,6 +1368,34 @@ export function canonical_tautomer_with_blocked_atoms_json(mol, blocked_atom_ind
|
|
|
1366
1368
|
}
|
|
1367
1369
|
}
|
|
1368
1370
|
|
|
1371
|
+
/**
|
|
1372
|
+
* Parse a CDXML document while preserving page and presentation objects.
|
|
1373
|
+
* The returned JSON contains an opaque `raw_xml` for each object so unknown
|
|
1374
|
+
* ChemDraw extensions are never silently discarded.
|
|
1375
|
+
* @param {string} cdxml
|
|
1376
|
+
* @returns {string}
|
|
1377
|
+
*/
|
|
1378
|
+
export function cdxml_document_json(cdxml) {
|
|
1379
|
+
let deferred3_0;
|
|
1380
|
+
let deferred3_1;
|
|
1381
|
+
try {
|
|
1382
|
+
const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1383
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1384
|
+
const ret = wasm.cdxml_document_json(ptr0, len0);
|
|
1385
|
+
var ptr2 = ret[0];
|
|
1386
|
+
var len2 = ret[1];
|
|
1387
|
+
if (ret[3]) {
|
|
1388
|
+
ptr2 = 0; len2 = 0;
|
|
1389
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1390
|
+
}
|
|
1391
|
+
deferred3_0 = ptr2;
|
|
1392
|
+
deferred3_1 = len2;
|
|
1393
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1394
|
+
} finally {
|
|
1395
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1369
1399
|
/**
|
|
1370
1400
|
* Parse all molecular fragments from a CDXML string.
|
|
1371
1401
|
*
|
|
@@ -1511,6 +1541,8 @@ export function cip_unresolved_json(mol) {
|
|
|
1511
1541
|
/**
|
|
1512
1542
|
* Compare multiple SMILES strings (up to 256 by default).
|
|
1513
1543
|
* Accepts a delimiter-separated list (e.g., newline or comma).
|
|
1544
|
+
* The input is limited to 1 MiB, 1,024 records, and 10,000 atoms per parsed
|
|
1545
|
+
* molecule.
|
|
1514
1546
|
*
|
|
1515
1547
|
* # Example (JS)
|
|
1516
1548
|
* ```javascript
|
|
@@ -1826,6 +1858,9 @@ export function depict_reaction_svg(rxn_smiles) {
|
|
|
1826
1858
|
*
|
|
1827
1859
|
* Lines that fail to parse are silently skipped.
|
|
1828
1860
|
* `cols` controls the number of columns (each cell is 200×200 px).
|
|
1861
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
1862
|
+
* per successfully parsed molecule. Limit violations return an empty SVG
|
|
1863
|
+
* containing an error title.
|
|
1829
1864
|
* @param {string} smiles_block
|
|
1830
1865
|
* @param {number} cols
|
|
1831
1866
|
* @returns {string}
|
|
@@ -1855,6 +1890,9 @@ export function depict_svg_grid(smiles_block, cols) {
|
|
|
1855
1890
|
*
|
|
1856
1891
|
* Invalid SMILES are rendered as empty cells; SMARTS parse failure returns an
|
|
1857
1892
|
* unhighlighted grid (the SMARTS is silently ignored).
|
|
1893
|
+
* The input is limited to 1 MiB, 1,024 non-empty records, and 10,000 atoms
|
|
1894
|
+
* per successfully parsed molecule. Limit violations return an empty SVG
|
|
1895
|
+
* containing an error title.
|
|
1858
1896
|
* @param {string} smiles_block
|
|
1859
1897
|
* @param {number} cols
|
|
1860
1898
|
* @param {string} match_smarts
|
|
@@ -5217,7 +5255,7 @@ export function remove_hydrogens(mol) {
|
|
|
5217
5255
|
* APIs. This function changes nothing about the underlying algorithm; it
|
|
5218
5256
|
* only serializes the result to JSON.
|
|
5219
5257
|
*
|
|
5220
|
-
* `max_results` -- cap on returned disconnections (0 =
|
|
5258
|
+
* `max_results` -- cap on returned disconnections (0 = the WASM safety cap).
|
|
5221
5259
|
*
|
|
5222
5260
|
* `reaction_class` -- filter to a single reaction class, or `""` for all
|
|
5223
5261
|
* classes. Valid values: `"AmideBond"`, `"Ester"`, `"Ether"`, `"CNBond"`,
|
|
@@ -5378,6 +5416,8 @@ export function sa_score(mol) {
|
|
|
5378
5416
|
* Screen a batch of SMILES strings (JSON string output).
|
|
5379
5417
|
* Returns per-record results including pass/fail with error details.
|
|
5380
5418
|
* Includes MaxMin diversity picking and Butina clustering by default.
|
|
5419
|
+
* The input is limited to 1 MiB, 1,024 records, and 10,000 atoms per parsed
|
|
5420
|
+
* molecule.
|
|
5381
5421
|
*
|
|
5382
5422
|
* # Example (JS)
|
|
5383
5423
|
* ```javascript
|
package/chematic_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@kent-tokyo/chematic",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"collaborators": [
|
|
5
|
-
"kent-tokyo <kent-tokyo@users.noreply.github.com>"
|
|
5
|
+
"Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "1.0.3",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|