@kent-tokyo/chematic 0.1.37 → 0.1.89
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 +105 -0
- package/chematic_wasm.js +298 -0
- package/chematic_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/chematic_wasm.d.ts
CHANGED
|
@@ -162,6 +162,11 @@ export class MolHandle {
|
|
|
162
162
|
* Kier–Hall χ4v valence-weighted connectivity index.
|
|
163
163
|
*/
|
|
164
164
|
chi4v(): number;
|
|
165
|
+
/**
|
|
166
|
+
* 2D PNG depiction (rasterized from SVG).
|
|
167
|
+
* Returns PNG data as base64-encoded string for embedding in HTML/JS.
|
|
168
|
+
*/
|
|
169
|
+
depict_png(): Uint8Array;
|
|
165
170
|
/**
|
|
166
171
|
* 2D SVG depiction of the molecule (CPK coloring).
|
|
167
172
|
*/
|
|
@@ -351,6 +356,17 @@ export function add_hydrogens(mol: MolHandle): MolHandle;
|
|
|
351
356
|
*/
|
|
352
357
|
export function atom_pair_bitvec(mol: MolHandle): Uint8Array;
|
|
353
358
|
|
|
359
|
+
/**
|
|
360
|
+
* AutoCorr2D descriptor (7 values: topological distance lags 1-7).
|
|
361
|
+
*/
|
|
362
|
+
export function autocorr_2d_json(mol: MolHandle): string;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* AutoCorr3D descriptor (8 values: Euclidean distance bins 1-8 Å).
|
|
366
|
+
* Requires 3D coordinates (generated automatically).
|
|
367
|
+
*/
|
|
368
|
+
export function autocorr_3d_json(mol: MolHandle): string;
|
|
369
|
+
|
|
354
370
|
/**
|
|
355
371
|
* Check whether a reaction SMILES is atom-balanced.
|
|
356
372
|
*
|
|
@@ -595,6 +611,18 @@ export function ecfp6_bitvec_with_chirality(mol: MolHandle, use_chirality: boole
|
|
|
595
611
|
*/
|
|
596
612
|
export function ecfp_bitvec_custom(mol: MolHandle, radius: number, nbits: number, use_chirality: boolean): Uint8Array;
|
|
597
613
|
|
|
614
|
+
/**
|
|
615
|
+
* Enumerate a combinatorial library from a SMIRKS template and two fragment sets.
|
|
616
|
+
*
|
|
617
|
+
* Generates all products by combining every scaffold with every building block.
|
|
618
|
+
* Input format: `scaffolds_smiles` and `building_blocks_smiles` are pipe-delimited
|
|
619
|
+
* SMILES strings (e.g., `"c1ccccc1|Cc1ccccc1"`).
|
|
620
|
+
*
|
|
621
|
+
* Returns JSON array of product SMILES strings.
|
|
622
|
+
* Example: `enumerate_library_2way("[C:1][Cl].[C:2][NH2]>>[C:1]N[C:2]", "c1ccccc1|Cc1ccccc1", "NCc1ccccc1|NCC")`
|
|
623
|
+
*/
|
|
624
|
+
export function enumerate_library_2way(template: string, scaffolds_smiles: string, building_blocks_smiles: string): string;
|
|
625
|
+
|
|
598
626
|
/**
|
|
599
627
|
* Enumerate all stereoisomers arising from unspecified tetrahedral stereocenters.
|
|
600
628
|
*
|
|
@@ -646,6 +674,18 @@ export function find_reaction_center_json(reaction_smiles: string): string;
|
|
|
646
674
|
*/
|
|
647
675
|
export function gasteiger_charges_json(mol: MolHandle): string;
|
|
648
676
|
|
|
677
|
+
/**
|
|
678
|
+
* Generate 3D coordinates using ETKDG and minimize with DREIDING force field.
|
|
679
|
+
*/
|
|
680
|
+
export function generate_3d_etkdg_minimized_pdb(mol: MolHandle): string;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Generate 3D coordinates using ETKDG (torsion angle preferences) and return PDB block.
|
|
684
|
+
* ETKDG produces higher-quality conformations than rule-based DG by applying
|
|
685
|
+
* experimental torsion angle preferences to common structural patterns.
|
|
686
|
+
*/
|
|
687
|
+
export function generate_3d_etkdg_pdb(mol: MolHandle): string;
|
|
688
|
+
|
|
649
689
|
/**
|
|
650
690
|
* Generate 3D coordinates from SMILES (raw distance geometry, no minimization).
|
|
651
691
|
* Returns PDB format string with atoms positioned in 3D space.
|
|
@@ -769,6 +809,14 @@ export function get_descriptors_json(mol: MolHandle): string;
|
|
|
769
809
|
*/
|
|
770
810
|
export function get_dihedral_json(smiles: string, a: number, b: number, c: number, d: number): any;
|
|
771
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Compute GETAWAY descriptors (GEometric, Topologic And wAveleT descriptors) from 3D coordinates.
|
|
814
|
+
* Returns JSON array of 9 values: [G1, G2, G3, D1, D2, D3, T, V, A]
|
|
815
|
+
* where G* = geometric autocorrelations (lag-1,2,3), D* = topologic distances,
|
|
816
|
+
* T = total pairwise distance, V = bounding-box volume, A = anisotropy ratio.
|
|
817
|
+
*/
|
|
818
|
+
export function getaway_descriptors_json(mol: MolHandle): string;
|
|
819
|
+
|
|
772
820
|
/**
|
|
773
821
|
* Identify functional groups. Returns a JSON array of objects:
|
|
774
822
|
* `[{"atoms":[0,2,3],"type":"C,N,O"}, …]`
|
|
@@ -1027,6 +1075,11 @@ export function mol_with_bond_removed(mol: MolHandle, idx: number): MolHandle;
|
|
|
1027
1075
|
*/
|
|
1028
1076
|
export function molecule_report_json(smiles: string): string;
|
|
1029
1077
|
|
|
1078
|
+
/**
|
|
1079
|
+
* MQN descriptor (42 integer values: Molecular Quantum Numbers).
|
|
1080
|
+
*/
|
|
1081
|
+
export function mqn_json(mol: MolHandle): string;
|
|
1082
|
+
|
|
1030
1083
|
/**
|
|
1031
1084
|
* Per-atom molar refractivity contributions as a JSON array of f64.
|
|
1032
1085
|
*/
|
|
@@ -1105,6 +1158,24 @@ export function parse_smiles(s: string): MolHandle;
|
|
|
1105
1158
|
*/
|
|
1106
1159
|
export function peoe_vsa_json(mol: MolHandle): string;
|
|
1107
1160
|
|
|
1161
|
+
/**
|
|
1162
|
+
* Detect pharmacophore features for virtual screening and lead optimization.
|
|
1163
|
+
* Returns JSON array of features: [{type, atom_idx, neighbor_count}, ...]
|
|
1164
|
+
*/
|
|
1165
|
+
export function pharmacophore_features_json(mol: MolHandle): string;
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Compute 2D pharmacophore fingerprint (2048 bits) as a JSON feature count summary.
|
|
1169
|
+
* Returns simplified JSON with feature type counts: {Donor, Acceptor, Aromatic, Hydrophobic, Positive, Negative}
|
|
1170
|
+
*/
|
|
1171
|
+
export function pharmacophore_fp_2d_summary(mol: MolHandle): string;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Compute 3D pharmacophore fingerprint from generated 3D coordinates.
|
|
1175
|
+
* Returns simplified JSON with feature type counts (3D-aware version).
|
|
1176
|
+
*/
|
|
1177
|
+
export function pharmacophore_fp_3d_summary(mol: MolHandle): string;
|
|
1178
|
+
|
|
1108
1179
|
/**
|
|
1109
1180
|
* Generate `count` random SMILES from a SMILES string using the given seed.
|
|
1110
1181
|
* Atoms are permuted based on xorshift64 RNG. Each variant should parse back
|
|
@@ -1151,6 +1222,12 @@ export function remove_hydrogens(mol: MolHandle): MolHandle;
|
|
|
1151
1222
|
*/
|
|
1152
1223
|
export function rgroup_decompose_json(smiles_json: string, core_smarts: string): string;
|
|
1153
1224
|
|
|
1225
|
+
/**
|
|
1226
|
+
* Ring family classification and detection as JSON.
|
|
1227
|
+
* Returns an array of ring families with their atoms, ring indices, and topology kind.
|
|
1228
|
+
*/
|
|
1229
|
+
export function ring_families_json(mol: MolHandle): string;
|
|
1230
|
+
|
|
1154
1231
|
/**
|
|
1155
1232
|
* Run molecular dynamics simulation and return trajectory as JSON.
|
|
1156
1233
|
*
|
|
@@ -1414,6 +1491,20 @@ export function to_xyz(mol: MolHandle): string;
|
|
|
1414
1491
|
*/
|
|
1415
1492
|
export function torsion_bitvec(mol: MolHandle): Uint8Array;
|
|
1416
1493
|
|
|
1494
|
+
/**
|
|
1495
|
+
* Compute WHIM descriptors (Weighted Holistic Invariant Molecular) from 3D coordinates.
|
|
1496
|
+
* Returns JSON array of 10 values: [L1, L2, L3, P1, P2, P3, ALPHA, BETA, GAMMA, DELTA]
|
|
1497
|
+
* where L* = inertia tensor eigenvalues, P* = principal moments, ALPHA = sum of moments,
|
|
1498
|
+
* BETA = average pairwise interaction, GAMMA = geometric mean, DELTA = anisotropy.
|
|
1499
|
+
*/
|
|
1500
|
+
export function whim_descriptors_json(mol: MolHandle): string;
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Compute combined WHIM + GETAWAY descriptors (19 values total) as JSON array.
|
|
1504
|
+
* Useful for ML pipelines requiring both shape and topologic features.
|
|
1505
|
+
*/
|
|
1506
|
+
export function whim_getaway_combined_json(mol: MolHandle): string;
|
|
1507
|
+
|
|
1417
1508
|
/**
|
|
1418
1509
|
* Non-canonical SMILES for `mol`.
|
|
1419
1510
|
*
|
|
@@ -1432,6 +1523,8 @@ export interface InitOutput {
|
|
|
1432
1523
|
readonly __wbg_molhandle_free: (a: number, b: number) => void;
|
|
1433
1524
|
readonly add_hydrogens: (a: number) => number;
|
|
1434
1525
|
readonly atom_pair_bitvec: (a: number) => [number, number];
|
|
1526
|
+
readonly autocorr_2d_json: (a: number) => [number, number];
|
|
1527
|
+
readonly autocorr_3d_json: (a: number) => [number, number];
|
|
1435
1528
|
readonly balance_check_json: (a: number, b: number) => [number, number];
|
|
1436
1529
|
readonly brics_fragment_count: (a: number) => number;
|
|
1437
1530
|
readonly brics_fragments_json: (a: number) => [number, number];
|
|
@@ -1477,6 +1570,7 @@ export interface InitOutput {
|
|
|
1477
1570
|
readonly ecfp6_bitvec: (a: number) => [number, number];
|
|
1478
1571
|
readonly ecfp6_bitvec_with_chirality: (a: number, b: number) => [number, number];
|
|
1479
1572
|
readonly ecfp_bitvec_custom: (a: number, b: number, c: number, d: number) => [number, number];
|
|
1573
|
+
readonly enumerate_library_2way: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
1480
1574
|
readonly enumerate_stereo_isomers_json: (a: number) => [number, number, number, number];
|
|
1481
1575
|
readonly enumerate_tautomers_json: (a: number) => [number, number];
|
|
1482
1576
|
readonly estate_indices_json: (a: number) => [number, number];
|
|
@@ -1484,6 +1578,8 @@ export interface InitOutput {
|
|
|
1484
1578
|
readonly fcfp6_bitvec: (a: number) => [number, number];
|
|
1485
1579
|
readonly find_reaction_center_json: (a: number, b: number) => [number, number];
|
|
1486
1580
|
readonly gasteiger_charges_json: (a: number) => [number, number];
|
|
1581
|
+
readonly generate_3d_etkdg_minimized_pdb: (a: number) => [number, number];
|
|
1582
|
+
readonly generate_3d_etkdg_pdb: (a: number) => [number, number];
|
|
1487
1583
|
readonly generate_3d_minimized_pdb: (a: number) => [number, number];
|
|
1488
1584
|
readonly generate_3d_pdb: (a: number) => [number, number];
|
|
1489
1585
|
readonly generic_murcko_scaffold: (a: number) => number;
|
|
@@ -1493,6 +1589,7 @@ export interface InitOutput {
|
|
|
1493
1589
|
readonly get_bond_length_json: (a: number, b: number, c: number, d: number) => number;
|
|
1494
1590
|
readonly get_descriptors_json: (a: number) => [number, number];
|
|
1495
1591
|
readonly get_dihedral_json: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
1592
|
+
readonly getaway_descriptors_json: (a: number) => [number, number];
|
|
1496
1593
|
readonly identify_functional_groups: (a: number) => [number, number];
|
|
1497
1594
|
readonly inchi_from_smiles: (a: number, b: number) => [number, number];
|
|
1498
1595
|
readonly inchikey_from_smiles: (a: number, b: number) => [number, number];
|
|
@@ -1537,6 +1634,7 @@ export interface InitOutput {
|
|
|
1537
1634
|
readonly molhandle_chi3v: (a: number) => number;
|
|
1538
1635
|
readonly molhandle_chi4: (a: number) => number;
|
|
1539
1636
|
readonly molhandle_chi4v: (a: number) => number;
|
|
1637
|
+
readonly molhandle_depict_png: (a: number) => [number, number];
|
|
1540
1638
|
readonly molhandle_depict_svg: (a: number) => [number, number];
|
|
1541
1639
|
readonly molhandle_depict_svg_opts: (a: number, b: number) => [number, number];
|
|
1542
1640
|
readonly molhandle_egan_passes: (a: number) => number;
|
|
@@ -1580,6 +1678,7 @@ export interface InitOutput {
|
|
|
1580
1678
|
readonly molhandle_tpsa: (a: number) => number;
|
|
1581
1679
|
readonly molhandle_veber_passes: (a: number) => number;
|
|
1582
1680
|
readonly molhandle_wiener_index: (a: number) => number;
|
|
1681
|
+
readonly mqn_json: (a: number) => [number, number];
|
|
1583
1682
|
readonly mr_per_atom_json: (a: number) => [number, number];
|
|
1584
1683
|
readonly murcko_scaffold: (a: number) => number;
|
|
1585
1684
|
readonly nearest_neighbors_json: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
@@ -1591,9 +1690,13 @@ export interface InitOutput {
|
|
|
1591
1690
|
readonly parse_cxsmiles_json: (a: number, b: number) => [number, number, number, number];
|
|
1592
1691
|
readonly parse_smiles: (a: number, b: number) => [number, number, number];
|
|
1593
1692
|
readonly peoe_vsa_json: (a: number) => [number, number];
|
|
1693
|
+
readonly pharmacophore_features_json: (a: number) => [number, number];
|
|
1694
|
+
readonly pharmacophore_fp_2d_summary: (a: number) => [number, number];
|
|
1695
|
+
readonly pharmacophore_fp_3d_summary: (a: number) => [number, number];
|
|
1594
1696
|
readonly random_smiles_json: (a: number, b: number, c: number, d: bigint) => [number, number, number, number];
|
|
1595
1697
|
readonly remove_hydrogens: (a: number) => number;
|
|
1596
1698
|
readonly rgroup_decompose_json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
1699
|
+
readonly ring_families_json: (a: number) => [number, number, number, number];
|
|
1597
1700
|
readonly run_md_json: (a: number, b: number, c: number) => [number, number];
|
|
1598
1701
|
readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
1599
1702
|
readonly sa_score: (a: number) => number;
|
|
@@ -1626,6 +1729,8 @@ export interface InitOutput {
|
|
|
1626
1729
|
readonly to_mol_v3000_block: (a: number) => [number, number];
|
|
1627
1730
|
readonly to_xyz: (a: number) => [number, number];
|
|
1628
1731
|
readonly torsion_bitvec: (a: number) => [number, number];
|
|
1732
|
+
readonly whim_descriptors_json: (a: number) => [number, number];
|
|
1733
|
+
readonly whim_getaway_combined_json: (a: number) => [number, number];
|
|
1629
1734
|
readonly write_smiles: (a: number) => [number, number];
|
|
1630
1735
|
readonly start: () => void;
|
|
1631
1736
|
readonly molhandle_atom_count: (a: number) => number;
|
package/chematic_wasm.js
CHANGED
|
@@ -388,6 +388,17 @@ export class MolHandle {
|
|
|
388
388
|
const ret = wasm.molhandle_chi4v(this.__wbg_ptr);
|
|
389
389
|
return ret;
|
|
390
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* 2D PNG depiction (rasterized from SVG).
|
|
393
|
+
* Returns PNG data as base64-encoded string for embedding in HTML/JS.
|
|
394
|
+
* @returns {Uint8Array}
|
|
395
|
+
*/
|
|
396
|
+
depict_png() {
|
|
397
|
+
const ret = wasm.molhandle_depict_png(this.__wbg_ptr);
|
|
398
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
399
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
400
|
+
return v1;
|
|
401
|
+
}
|
|
391
402
|
/**
|
|
392
403
|
* 2D SVG depiction of the molecule (CPK coloring).
|
|
393
404
|
* @returns {string}
|
|
@@ -815,6 +826,45 @@ export function atom_pair_bitvec(mol) {
|
|
|
815
826
|
return v1;
|
|
816
827
|
}
|
|
817
828
|
|
|
829
|
+
/**
|
|
830
|
+
* AutoCorr2D descriptor (7 values: topological distance lags 1-7).
|
|
831
|
+
* @param {MolHandle} mol
|
|
832
|
+
* @returns {string}
|
|
833
|
+
*/
|
|
834
|
+
export function autocorr_2d_json(mol) {
|
|
835
|
+
let deferred1_0;
|
|
836
|
+
let deferred1_1;
|
|
837
|
+
try {
|
|
838
|
+
_assertClass(mol, MolHandle);
|
|
839
|
+
const ret = wasm.autocorr_2d_json(mol.__wbg_ptr);
|
|
840
|
+
deferred1_0 = ret[0];
|
|
841
|
+
deferred1_1 = ret[1];
|
|
842
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
843
|
+
} finally {
|
|
844
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* AutoCorr3D descriptor (8 values: Euclidean distance bins 1-8 Å).
|
|
850
|
+
* Requires 3D coordinates (generated automatically).
|
|
851
|
+
* @param {MolHandle} mol
|
|
852
|
+
* @returns {string}
|
|
853
|
+
*/
|
|
854
|
+
export function autocorr_3d_json(mol) {
|
|
855
|
+
let deferred1_0;
|
|
856
|
+
let deferred1_1;
|
|
857
|
+
try {
|
|
858
|
+
_assertClass(mol, MolHandle);
|
|
859
|
+
const ret = wasm.autocorr_3d_json(mol.__wbg_ptr);
|
|
860
|
+
deferred1_0 = ret[0];
|
|
861
|
+
deferred1_1 = ret[1];
|
|
862
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
863
|
+
} finally {
|
|
864
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
818
868
|
/**
|
|
819
869
|
* Check whether a reaction SMILES is atom-balanced.
|
|
820
870
|
*
|
|
@@ -1404,6 +1454,45 @@ export function ecfp_bitvec_custom(mol, radius, nbits, use_chirality) {
|
|
|
1404
1454
|
return v1;
|
|
1405
1455
|
}
|
|
1406
1456
|
|
|
1457
|
+
/**
|
|
1458
|
+
* Enumerate a combinatorial library from a SMIRKS template and two fragment sets.
|
|
1459
|
+
*
|
|
1460
|
+
* Generates all products by combining every scaffold with every building block.
|
|
1461
|
+
* Input format: `scaffolds_smiles` and `building_blocks_smiles` are pipe-delimited
|
|
1462
|
+
* SMILES strings (e.g., `"c1ccccc1|Cc1ccccc1"`).
|
|
1463
|
+
*
|
|
1464
|
+
* Returns JSON array of product SMILES strings.
|
|
1465
|
+
* Example: `enumerate_library_2way("[C:1][Cl].[C:2][NH2]>>[C:1]N[C:2]", "c1ccccc1|Cc1ccccc1", "NCc1ccccc1|NCC")`
|
|
1466
|
+
* @param {string} template
|
|
1467
|
+
* @param {string} scaffolds_smiles
|
|
1468
|
+
* @param {string} building_blocks_smiles
|
|
1469
|
+
* @returns {string}
|
|
1470
|
+
*/
|
|
1471
|
+
export function enumerate_library_2way(template, scaffolds_smiles, building_blocks_smiles) {
|
|
1472
|
+
let deferred5_0;
|
|
1473
|
+
let deferred5_1;
|
|
1474
|
+
try {
|
|
1475
|
+
const ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1476
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1477
|
+
const ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1478
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1479
|
+
const ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1480
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1481
|
+
const ret = wasm.enumerate_library_2way(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1482
|
+
var ptr4 = ret[0];
|
|
1483
|
+
var len4 = ret[1];
|
|
1484
|
+
if (ret[3]) {
|
|
1485
|
+
ptr4 = 0; len4 = 0;
|
|
1486
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1487
|
+
}
|
|
1488
|
+
deferred5_0 = ptr4;
|
|
1489
|
+
deferred5_1 = len4;
|
|
1490
|
+
return getStringFromWasm0(ptr4, len4);
|
|
1491
|
+
} finally {
|
|
1492
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1407
1496
|
/**
|
|
1408
1497
|
* Enumerate all stereoisomers arising from unspecified tetrahedral stereocenters.
|
|
1409
1498
|
*
|
|
@@ -1548,6 +1637,46 @@ export function gasteiger_charges_json(mol) {
|
|
|
1548
1637
|
}
|
|
1549
1638
|
}
|
|
1550
1639
|
|
|
1640
|
+
/**
|
|
1641
|
+
* Generate 3D coordinates using ETKDG and minimize with DREIDING force field.
|
|
1642
|
+
* @param {MolHandle} mol
|
|
1643
|
+
* @returns {string}
|
|
1644
|
+
*/
|
|
1645
|
+
export function generate_3d_etkdg_minimized_pdb(mol) {
|
|
1646
|
+
let deferred1_0;
|
|
1647
|
+
let deferred1_1;
|
|
1648
|
+
try {
|
|
1649
|
+
_assertClass(mol, MolHandle);
|
|
1650
|
+
const ret = wasm.generate_3d_etkdg_minimized_pdb(mol.__wbg_ptr);
|
|
1651
|
+
deferred1_0 = ret[0];
|
|
1652
|
+
deferred1_1 = ret[1];
|
|
1653
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1654
|
+
} finally {
|
|
1655
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Generate 3D coordinates using ETKDG (torsion angle preferences) and return PDB block.
|
|
1661
|
+
* ETKDG produces higher-quality conformations than rule-based DG by applying
|
|
1662
|
+
* experimental torsion angle preferences to common structural patterns.
|
|
1663
|
+
* @param {MolHandle} mol
|
|
1664
|
+
* @returns {string}
|
|
1665
|
+
*/
|
|
1666
|
+
export function generate_3d_etkdg_pdb(mol) {
|
|
1667
|
+
let deferred1_0;
|
|
1668
|
+
let deferred1_1;
|
|
1669
|
+
try {
|
|
1670
|
+
_assertClass(mol, MolHandle);
|
|
1671
|
+
const ret = wasm.generate_3d_etkdg_pdb(mol.__wbg_ptr);
|
|
1672
|
+
deferred1_0 = ret[0];
|
|
1673
|
+
deferred1_1 = ret[1];
|
|
1674
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1675
|
+
} finally {
|
|
1676
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1551
1680
|
/**
|
|
1552
1681
|
* Generate 3D coordinates from SMILES (raw distance geometry, no minimization).
|
|
1553
1682
|
* Returns PDB format string with atoms positioned in 3D space.
|
|
@@ -1827,6 +1956,28 @@ export function get_dihedral_json(smiles, a, b, c, d) {
|
|
|
1827
1956
|
return ret;
|
|
1828
1957
|
}
|
|
1829
1958
|
|
|
1959
|
+
/**
|
|
1960
|
+
* Compute GETAWAY descriptors (GEometric, Topologic And wAveleT descriptors) from 3D coordinates.
|
|
1961
|
+
* Returns JSON array of 9 values: [G1, G2, G3, D1, D2, D3, T, V, A]
|
|
1962
|
+
* where G* = geometric autocorrelations (lag-1,2,3), D* = topologic distances,
|
|
1963
|
+
* T = total pairwise distance, V = bounding-box volume, A = anisotropy ratio.
|
|
1964
|
+
* @param {MolHandle} mol
|
|
1965
|
+
* @returns {string}
|
|
1966
|
+
*/
|
|
1967
|
+
export function getaway_descriptors_json(mol) {
|
|
1968
|
+
let deferred1_0;
|
|
1969
|
+
let deferred1_1;
|
|
1970
|
+
try {
|
|
1971
|
+
_assertClass(mol, MolHandle);
|
|
1972
|
+
const ret = wasm.getaway_descriptors_json(mol.__wbg_ptr);
|
|
1973
|
+
deferred1_0 = ret[0];
|
|
1974
|
+
deferred1_1 = ret[1];
|
|
1975
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1976
|
+
} finally {
|
|
1977
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1830
1981
|
/**
|
|
1831
1982
|
* Identify functional groups. Returns a JSON array of objects:
|
|
1832
1983
|
* `[{"atoms":[0,2,3],"type":"C,N,O"}, …]`
|
|
@@ -2499,6 +2650,25 @@ export function molecule_report_json(smiles) {
|
|
|
2499
2650
|
}
|
|
2500
2651
|
}
|
|
2501
2652
|
|
|
2653
|
+
/**
|
|
2654
|
+
* MQN descriptor (42 integer values: Molecular Quantum Numbers).
|
|
2655
|
+
* @param {MolHandle} mol
|
|
2656
|
+
* @returns {string}
|
|
2657
|
+
*/
|
|
2658
|
+
export function mqn_json(mol) {
|
|
2659
|
+
let deferred1_0;
|
|
2660
|
+
let deferred1_1;
|
|
2661
|
+
try {
|
|
2662
|
+
_assertClass(mol, MolHandle);
|
|
2663
|
+
const ret = wasm.mqn_json(mol.__wbg_ptr);
|
|
2664
|
+
deferred1_0 = ret[0];
|
|
2665
|
+
deferred1_1 = ret[1];
|
|
2666
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2667
|
+
} finally {
|
|
2668
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2502
2672
|
/**
|
|
2503
2673
|
* Per-atom molar refractivity contributions as a JSON array of f64.
|
|
2504
2674
|
* @param {MolHandle} mol
|
|
@@ -2744,6 +2914,66 @@ export function peoe_vsa_json(mol) {
|
|
|
2744
2914
|
}
|
|
2745
2915
|
}
|
|
2746
2916
|
|
|
2917
|
+
/**
|
|
2918
|
+
* Detect pharmacophore features for virtual screening and lead optimization.
|
|
2919
|
+
* Returns JSON array of features: [{type, atom_idx, neighbor_count}, ...]
|
|
2920
|
+
* @param {MolHandle} mol
|
|
2921
|
+
* @returns {string}
|
|
2922
|
+
*/
|
|
2923
|
+
export function pharmacophore_features_json(mol) {
|
|
2924
|
+
let deferred1_0;
|
|
2925
|
+
let deferred1_1;
|
|
2926
|
+
try {
|
|
2927
|
+
_assertClass(mol, MolHandle);
|
|
2928
|
+
const ret = wasm.pharmacophore_features_json(mol.__wbg_ptr);
|
|
2929
|
+
deferred1_0 = ret[0];
|
|
2930
|
+
deferred1_1 = ret[1];
|
|
2931
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2932
|
+
} finally {
|
|
2933
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* Compute 2D pharmacophore fingerprint (2048 bits) as a JSON feature count summary.
|
|
2939
|
+
* Returns simplified JSON with feature type counts: {Donor, Acceptor, Aromatic, Hydrophobic, Positive, Negative}
|
|
2940
|
+
* @param {MolHandle} mol
|
|
2941
|
+
* @returns {string}
|
|
2942
|
+
*/
|
|
2943
|
+
export function pharmacophore_fp_2d_summary(mol) {
|
|
2944
|
+
let deferred1_0;
|
|
2945
|
+
let deferred1_1;
|
|
2946
|
+
try {
|
|
2947
|
+
_assertClass(mol, MolHandle);
|
|
2948
|
+
const ret = wasm.pharmacophore_fp_2d_summary(mol.__wbg_ptr);
|
|
2949
|
+
deferred1_0 = ret[0];
|
|
2950
|
+
deferred1_1 = ret[1];
|
|
2951
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2952
|
+
} finally {
|
|
2953
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* Compute 3D pharmacophore fingerprint from generated 3D coordinates.
|
|
2959
|
+
* Returns simplified JSON with feature type counts (3D-aware version).
|
|
2960
|
+
* @param {MolHandle} mol
|
|
2961
|
+
* @returns {string}
|
|
2962
|
+
*/
|
|
2963
|
+
export function pharmacophore_fp_3d_summary(mol) {
|
|
2964
|
+
let deferred1_0;
|
|
2965
|
+
let deferred1_1;
|
|
2966
|
+
try {
|
|
2967
|
+
_assertClass(mol, MolHandle);
|
|
2968
|
+
const ret = wasm.pharmacophore_fp_3d_summary(mol.__wbg_ptr);
|
|
2969
|
+
deferred1_0 = ret[0];
|
|
2970
|
+
deferred1_1 = ret[1];
|
|
2971
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2972
|
+
} finally {
|
|
2973
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2747
2977
|
/**
|
|
2748
2978
|
* Generate `count` random SMILES from a SMILES string using the given seed.
|
|
2749
2979
|
* Atoms are permuted based on xorshift64 RNG. Each variant should parse back
|
|
@@ -2843,6 +3073,32 @@ export function rgroup_decompose_json(smiles_json, core_smarts) {
|
|
|
2843
3073
|
}
|
|
2844
3074
|
}
|
|
2845
3075
|
|
|
3076
|
+
/**
|
|
3077
|
+
* Ring family classification and detection as JSON.
|
|
3078
|
+
* Returns an array of ring families with their atoms, ring indices, and topology kind.
|
|
3079
|
+
* @param {MolHandle} mol
|
|
3080
|
+
* @returns {string}
|
|
3081
|
+
*/
|
|
3082
|
+
export function ring_families_json(mol) {
|
|
3083
|
+
let deferred2_0;
|
|
3084
|
+
let deferred2_1;
|
|
3085
|
+
try {
|
|
3086
|
+
_assertClass(mol, MolHandle);
|
|
3087
|
+
const ret = wasm.ring_families_json(mol.__wbg_ptr);
|
|
3088
|
+
var ptr1 = ret[0];
|
|
3089
|
+
var len1 = ret[1];
|
|
3090
|
+
if (ret[3]) {
|
|
3091
|
+
ptr1 = 0; len1 = 0;
|
|
3092
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3093
|
+
}
|
|
3094
|
+
deferred2_0 = ptr1;
|
|
3095
|
+
deferred2_1 = len1;
|
|
3096
|
+
return getStringFromWasm0(ptr1, len1);
|
|
3097
|
+
} finally {
|
|
3098
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
|
|
2846
3102
|
/**
|
|
2847
3103
|
* Run molecular dynamics simulation and return trajectory as JSON.
|
|
2848
3104
|
*
|
|
@@ -3599,6 +3855,48 @@ export function torsion_bitvec(mol) {
|
|
|
3599
3855
|
return v1;
|
|
3600
3856
|
}
|
|
3601
3857
|
|
|
3858
|
+
/**
|
|
3859
|
+
* Compute WHIM descriptors (Weighted Holistic Invariant Molecular) from 3D coordinates.
|
|
3860
|
+
* Returns JSON array of 10 values: [L1, L2, L3, P1, P2, P3, ALPHA, BETA, GAMMA, DELTA]
|
|
3861
|
+
* where L* = inertia tensor eigenvalues, P* = principal moments, ALPHA = sum of moments,
|
|
3862
|
+
* BETA = average pairwise interaction, GAMMA = geometric mean, DELTA = anisotropy.
|
|
3863
|
+
* @param {MolHandle} mol
|
|
3864
|
+
* @returns {string}
|
|
3865
|
+
*/
|
|
3866
|
+
export function whim_descriptors_json(mol) {
|
|
3867
|
+
let deferred1_0;
|
|
3868
|
+
let deferred1_1;
|
|
3869
|
+
try {
|
|
3870
|
+
_assertClass(mol, MolHandle);
|
|
3871
|
+
const ret = wasm.whim_descriptors_json(mol.__wbg_ptr);
|
|
3872
|
+
deferred1_0 = ret[0];
|
|
3873
|
+
deferred1_1 = ret[1];
|
|
3874
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3875
|
+
} finally {
|
|
3876
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
/**
|
|
3881
|
+
* Compute combined WHIM + GETAWAY descriptors (19 values total) as JSON array.
|
|
3882
|
+
* Useful for ML pipelines requiring both shape and topologic features.
|
|
3883
|
+
* @param {MolHandle} mol
|
|
3884
|
+
* @returns {string}
|
|
3885
|
+
*/
|
|
3886
|
+
export function whim_getaway_combined_json(mol) {
|
|
3887
|
+
let deferred1_0;
|
|
3888
|
+
let deferred1_1;
|
|
3889
|
+
try {
|
|
3890
|
+
_assertClass(mol, MolHandle);
|
|
3891
|
+
const ret = wasm.whim_getaway_combined_json(mol.__wbg_ptr);
|
|
3892
|
+
deferred1_0 = ret[0];
|
|
3893
|
+
deferred1_1 = ret[1];
|
|
3894
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3895
|
+
} finally {
|
|
3896
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
|
|
3602
3900
|
/**
|
|
3603
3901
|
* Non-canonical SMILES for `mol`.
|
|
3604
3902
|
*
|
package/chematic_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"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.1.
|
|
8
|
+
"version": "0.1.89",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|