rdkit-esm 0.3.0 → 0.4.1
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/dist/index.d.ts +40 -31
- package/dist/index.js +77 -37
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ interface JSMol {
|
|
|
116
116
|
* You can also specify the following options
|
|
117
117
|
* (passed as a stringified JSON object)
|
|
118
118
|
* @param {number} radius fingerprint radius
|
|
119
|
-
* @param {number}
|
|
119
|
+
* @param {number} nBits fingerprint length
|
|
120
120
|
*/
|
|
121
121
|
get_morgan_fp(options: JSONString): string;
|
|
122
122
|
|
|
@@ -131,7 +131,7 @@ interface JSMol {
|
|
|
131
131
|
* You can also specify the following options
|
|
132
132
|
* (passed as a stringified JSON object)
|
|
133
133
|
* @param {number} radius fingerprint radius
|
|
134
|
-
* @param {number}
|
|
134
|
+
* @param {number} nBits fingerprint length
|
|
135
135
|
*/
|
|
136
136
|
get_morgan_fp_as_uint8array(options: JSONString): Uint8Array;
|
|
137
137
|
|
|
@@ -145,7 +145,7 @@ interface JSMol {
|
|
|
145
145
|
*
|
|
146
146
|
* you can also specify the following options
|
|
147
147
|
* (passed as a stringified JSON object)
|
|
148
|
-
* @param {number}
|
|
148
|
+
* @param {number} nBits fingerprint length
|
|
149
149
|
*/
|
|
150
150
|
get_pattern_fp(options: JSONString): string;
|
|
151
151
|
|
|
@@ -159,7 +159,7 @@ interface JSMol {
|
|
|
159
159
|
*
|
|
160
160
|
* you can also specify the following options
|
|
161
161
|
* (passed as a stringified JSON object)
|
|
162
|
-
* @param {number}
|
|
162
|
+
* @param {number} nBits fingerprint length
|
|
163
163
|
*/
|
|
164
164
|
get_pattern_fp_as_uint8array(options: JSONString): Uint8Array;
|
|
165
165
|
|
|
@@ -173,7 +173,7 @@ interface JSMol {
|
|
|
173
173
|
*
|
|
174
174
|
* you can also specify the following options
|
|
175
175
|
* (passed as a stringified JSON object)
|
|
176
|
-
* @param {number}
|
|
176
|
+
* @param {number} nBits fingerprint length
|
|
177
177
|
*/
|
|
178
178
|
get_topological_torsion_fp(options: JSONString): string;
|
|
179
179
|
|
|
@@ -187,7 +187,7 @@ interface JSMol {
|
|
|
187
187
|
*
|
|
188
188
|
* you can also specify the following options
|
|
189
189
|
* (passed as a stringified JSON object)
|
|
190
|
-
* @param {number}
|
|
190
|
+
* @param {number} nBits fingerprint length
|
|
191
191
|
*/
|
|
192
192
|
get_topological_torsion_fp_as_uint8array(options: JSONString): Uint8Array;
|
|
193
193
|
|
|
@@ -201,7 +201,7 @@ interface JSMol {
|
|
|
201
201
|
*
|
|
202
202
|
* you can also specify the following options
|
|
203
203
|
* (passed as a stringified JSON object)
|
|
204
|
-
* @param {number}
|
|
204
|
+
* @param {number} nBits fingerprint length
|
|
205
205
|
*/
|
|
206
206
|
get_rdkit_fp(options: JSONString): string;
|
|
207
207
|
|
|
@@ -215,7 +215,7 @@ interface JSMol {
|
|
|
215
215
|
*
|
|
216
216
|
* you can also specify the following options
|
|
217
217
|
* (passed as a stringified JSON object)
|
|
218
|
-
* @param {number}
|
|
218
|
+
* @param {number} nBits fingerprint length
|
|
219
219
|
*/
|
|
220
220
|
get_rdkit_fp_as_uint8array(options: JSONString): Uint8Array;
|
|
221
221
|
|
|
@@ -229,7 +229,7 @@ interface JSMol {
|
|
|
229
229
|
*
|
|
230
230
|
* you can also specify the following options
|
|
231
231
|
* (passed as a stringified JSON object)
|
|
232
|
-
* @param {number}
|
|
232
|
+
* @param {number} nBits fingerprint length
|
|
233
233
|
*/
|
|
234
234
|
get_atom_pair_fp(options: JSONString): string;
|
|
235
235
|
|
|
@@ -243,7 +243,7 @@ interface JSMol {
|
|
|
243
243
|
*
|
|
244
244
|
* you can also specify the following options
|
|
245
245
|
* (passed as a stringified JSON object)
|
|
246
|
-
* @param {number}
|
|
246
|
+
* @param {number} nBits fingerprint length
|
|
247
247
|
*/
|
|
248
248
|
get_atom_pair_fp_as_uint8array(options: JSONString): Uint8Array;
|
|
249
249
|
|
|
@@ -257,7 +257,7 @@ interface JSMol {
|
|
|
257
257
|
*
|
|
258
258
|
* you can also specify the following options
|
|
259
259
|
* (passed as a stringified JSON object)
|
|
260
|
-
* @param {number}
|
|
260
|
+
* @param {number} nBits fingerprint length
|
|
261
261
|
*/
|
|
262
262
|
get_maccs_fp(options: JSONString): string;
|
|
263
263
|
|
|
@@ -1173,6 +1173,23 @@ type RDKitGetUint8ArrayOptions = {
|
|
|
1173
1173
|
properties: PropertyPickleOptionsKeys[];
|
|
1174
1174
|
};
|
|
1175
1175
|
//#endregion
|
|
1176
|
+
//#region src/fingerprints/fingerprints.types.d.ts
|
|
1177
|
+
type FingerprintType = 'Morgan' | 'Pattern' | 'AtomPair' | 'TopologicalTorsion' | 'RDKit' | 'MACCS';
|
|
1178
|
+
type SimilarityMetric = 'tanimoto';
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/fingerprints/fingerprint.d.ts
|
|
1181
|
+
declare class Fingerprint {
|
|
1182
|
+
readonly nBits: number;
|
|
1183
|
+
readonly fpU32: Uint32Array;
|
|
1184
|
+
readonly fpU8: Uint8Array;
|
|
1185
|
+
private _onBits;
|
|
1186
|
+
type?: FingerprintType;
|
|
1187
|
+
constructor(fpU8: Uint8Array, nBits?: number, type?: FingerprintType);
|
|
1188
|
+
get onBits(): number;
|
|
1189
|
+
get uint8Array(): Uint8Array<ArrayBufferLike>;
|
|
1190
|
+
toString(): string;
|
|
1191
|
+
}
|
|
1192
|
+
//#endregion
|
|
1176
1193
|
//#region src/mol.d.ts
|
|
1177
1194
|
/**
|
|
1178
1195
|
* A wrapper around RDKit's JSMol object providing a typed, camelCase API.
|
|
@@ -1282,29 +1299,17 @@ declare class Mol implements Disposable {
|
|
|
1282
1299
|
* Returns the Morgan fingerprint as a bit string
|
|
1283
1300
|
* @param options - Fingerprint options
|
|
1284
1301
|
*/
|
|
1285
|
-
getMorganFp(options?: Partial<RDKitMorganFPOptions>):
|
|
1302
|
+
getMorganFp(options?: Partial<RDKitMorganFPOptions>): Fingerprint;
|
|
1286
1303
|
/** Returns the pattern fingerprint as a bit string */
|
|
1287
|
-
getPatternFp(options?: Partial<RDKitPatternFPOptions>):
|
|
1304
|
+
getPatternFp(options?: Partial<RDKitPatternFPOptions>): Fingerprint;
|
|
1288
1305
|
/** Returns the topological torsion fingerprint as a bit string */
|
|
1289
|
-
getTopologicalTorsionFp(options?: Partial<RDKitTopologicalTorsionFPOptions>):
|
|
1306
|
+
getTopologicalTorsionFp(options?: Partial<RDKitTopologicalTorsionFPOptions>): Fingerprint;
|
|
1290
1307
|
/** Returns the RDKit fingerprint as a bit string */
|
|
1291
|
-
getRdkitFp(options?: Partial<RDKitRdkitFpOptions>):
|
|
1308
|
+
getRdkitFp(options?: Partial<RDKitRdkitFpOptions>): Fingerprint;
|
|
1292
1309
|
/** Returns the atom pair fingerprint as a bit string */
|
|
1293
|
-
getAtomPairFp(options?: Partial<RDKitAtomPairFPOptions>):
|
|
1310
|
+
getAtomPairFp(options?: Partial<RDKitAtomPairFPOptions>): Fingerprint;
|
|
1294
1311
|
/** Returns the MACCS fingerprint as a bit string (fixed 167-bit) */
|
|
1295
|
-
getMaccsFp():
|
|
1296
|
-
/** Returns the Morgan fingerprint as a Uint8Array */
|
|
1297
|
-
getMorganFpAsUint8Array(options?: Partial<RDKitMorganFPOptions>): Uint8Array;
|
|
1298
|
-
/** Returns the pattern fingerprint as a Uint8Array */
|
|
1299
|
-
getPatternFpAsUint8Array(options?: Partial<RDKitPatternFPOptions>): Uint8Array;
|
|
1300
|
-
/** Returns the topological torsion fingerprint as a Uint8Array */
|
|
1301
|
-
getTopologicalTorsionFpAsUint8Array(options?: Partial<RDKitTopologicalTorsionFPOptions>): Uint8Array;
|
|
1302
|
-
/** Returns the RDKit fingerprint as a Uint8Array */
|
|
1303
|
-
getRdkitFpAsUint8Array(options?: Partial<RDKitRdkitFpOptions>): Uint8Array;
|
|
1304
|
-
/** Returns the atom pair fingerprint as a Uint8Array */
|
|
1305
|
-
getAtomPairFpAsUint8Array(options?: Partial<RDKitAtomPairFPOptions>): Uint8Array;
|
|
1306
|
-
/** Returns the MACCS fingerprint as a Uint8Array */
|
|
1307
|
-
getMaccsFpAsUint8Array(): Uint8Array;
|
|
1312
|
+
getMaccsFp(): Fingerprint;
|
|
1308
1313
|
/**
|
|
1309
1314
|
* Parses a property value string, attempting JSON.parse first.
|
|
1310
1315
|
* Returns the parsed value on success, or the raw string on failure.
|
|
@@ -1392,7 +1397,7 @@ declare class Mol implements Disposable {
|
|
|
1392
1397
|
* @param template - Template molecule to align to
|
|
1393
1398
|
* @param options - Alignment options
|
|
1394
1399
|
*/
|
|
1395
|
-
generateAlignedCoords(template: Mol, options?: Partial<RDKitAlignedCoordsOptions>):
|
|
1400
|
+
generateAlignedCoords(template: Mol, options?: Partial<RDKitAlignedCoordsOptions>): RDKitSubstructMatch;
|
|
1396
1401
|
/**
|
|
1397
1402
|
* Normalizes the depiction of the molecule
|
|
1398
1403
|
* @param options - Normalization options
|
|
@@ -1507,6 +1512,9 @@ declare class Reaction implements Disposable {
|
|
|
1507
1512
|
*/
|
|
1508
1513
|
type RGDRow = Record<string, Mol>;
|
|
1509
1514
|
//#endregion
|
|
1515
|
+
//#region src/fingerprints/bitops.d.ts
|
|
1516
|
+
declare const computeFingerprintSimilarity: (a: Fingerprint, b: Fingerprint, metric?: SimilarityMetric) => number;
|
|
1517
|
+
//#endregion
|
|
1510
1518
|
//#region src/rdkit.d.ts
|
|
1511
1519
|
/** Result of a Maximum Common Substructure (MCS) computation */
|
|
1512
1520
|
interface MCSResult {
|
|
@@ -1585,6 +1593,7 @@ declare class RDKit {
|
|
|
1585
1593
|
*/
|
|
1586
1594
|
getRGD(core: string | string[] | Mol | Mol[], molecules: string[] | Mol[], options?: Partial<RDKitGetRgdOptions>): RGDRow[] | null;
|
|
1587
1595
|
molzip(mol1: Mol, mol2: Mol): Mol | null;
|
|
1596
|
+
computeFingerprintsSimilarity(...args: Parameters<typeof computeFingerprintSimilarity>): number;
|
|
1588
1597
|
/** Returns the RDKit version string */
|
|
1589
1598
|
get version(): string;
|
|
1590
1599
|
/** The underlying RDKitModule for direct access to the raw API */
|
|
@@ -1632,4 +1641,4 @@ interface InitRDKitOptions {
|
|
|
1632
1641
|
declare function initRDKit(options?: Partial<InitRDKitOptions>): Promise<RDKit>;
|
|
1633
1642
|
declare function initRDKit<T extends typeof RDKit>(options: Partial<InitRDKitOptions> | undefined, constructor: T): Promise<InstanceType<T>>;
|
|
1634
1643
|
//#endregion
|
|
1635
|
-
export { type InitRDKitOptions, type JSMol, type JSReaction, type MCSResult, Mol, MolArray, type MolList, RDKit, type RDKitAlignedCoordsOptions, type RDKitAtomPairFPOptions, type RDKitDepictionDetails, type RDKitDescriptors, type RDKitGetMCSOptions, type RDKitGetMolBlockOptions, type RDKitGetMolOpt, type RDKitGetRgdOptions, type RDKitGetSmilesOptions, type RDKitJson, type RDKitMCSResult, type RDKitModule, type RDKitMorganFPOptions, type RDKitPatternFPOptions, type RDKitRdkitFpOptions, type RDKitRemoveHsOptions, type RDKitRxnDetails, type RDKitStereoTags, type RDKitSubstructMatch, type RDKitTopologicalTorsionFPOptions, type RGDRow, Reaction, initRDKit };
|
|
1644
|
+
export { Fingerprint, type InitRDKitOptions, type JSMol, type JSReaction, type MCSResult, Mol, MolArray, type MolList, RDKit, type RDKitAlignedCoordsOptions, type RDKitAtomPairFPOptions, type RDKitDepictionDetails, type RDKitDescriptors, type RDKitGetMCSOptions, type RDKitGetMolBlockOptions, type RDKitGetMolOpt, type RDKitGetRgdOptions, type RDKitGetSmilesOptions, type RDKitJson, type RDKitMCSResult, type RDKitModule, type RDKitMorganFPOptions, type RDKitPatternFPOptions, type RDKitRdkitFpOptions, type RDKitRemoveHsOptions, type RDKitRxnDetails, type RDKitStereoTags, type RDKitSubstructMatch, type RDKitTopologicalTorsionFPOptions, type RGDRow, Reaction, initRDKit };
|
package/dist/index.js
CHANGED
|
@@ -3913,6 +3913,67 @@ const buildGetMolAsUint8ArrayOptions = (options) => {
|
|
|
3913
3913
|
return { propertyFlags: raw };
|
|
3914
3914
|
};
|
|
3915
3915
|
|
|
3916
|
+
//#endregion
|
|
3917
|
+
//#region src/fingerprints/bitops.ts
|
|
3918
|
+
/**
|
|
3919
|
+
* From FastBitSet
|
|
3920
|
+
* @link https://github.com/lemire/FastBitSet.js
|
|
3921
|
+
*
|
|
3922
|
+
* Compute the Hamming weight of a 32-bit unsigned integer
|
|
3923
|
+
*/
|
|
3924
|
+
const hammingWeight = (v) => {
|
|
3925
|
+
v -= v >>> 1 & 1431655765;
|
|
3926
|
+
v = (v & 858993459) + (v >>> 2 & 858993459);
|
|
3927
|
+
return (v + (v >>> 4) & 252645135) * 16843009 >>> 24;
|
|
3928
|
+
};
|
|
3929
|
+
const computeFingerprintSimilarity = (a, b, metric) => {
|
|
3930
|
+
if (a.nBits !== b.nBits) throw new Error("Fingerprints must be of the same length");
|
|
3931
|
+
switch (metric) {
|
|
3932
|
+
case "tanimoto": return tanimotoSimilarity(a, b);
|
|
3933
|
+
default: throw new Error(`Unsupported similarity metric: ${metric}`);
|
|
3934
|
+
}
|
|
3935
|
+
};
|
|
3936
|
+
const tanimotoSimilarity = (a, b) => {
|
|
3937
|
+
let interBits = 0;
|
|
3938
|
+
for (let i = 0; i < a.fpU32.length; i++) interBits += hammingWeight(a.fpU32[i] & b.fpU32[i]);
|
|
3939
|
+
return interBits / (a.onBits + b.onBits - interBits);
|
|
3940
|
+
};
|
|
3941
|
+
|
|
3942
|
+
//#endregion
|
|
3943
|
+
//#region src/fingerprints/fingerprint.ts
|
|
3944
|
+
var Fingerprint = class {
|
|
3945
|
+
nBits;
|
|
3946
|
+
fpU32;
|
|
3947
|
+
fpU8;
|
|
3948
|
+
_onBits = null;
|
|
3949
|
+
type;
|
|
3950
|
+
constructor(fpU8, nBits, type) {
|
|
3951
|
+
this.nBits = nBits ?? fpU8.length * 8;
|
|
3952
|
+
this.type = type;
|
|
3953
|
+
this.fpU8 = fpU8;
|
|
3954
|
+
if (fpU8.length % 4) {
|
|
3955
|
+
const padded = new Uint8Array(fpU8.length + (4 - fpU8.length % 4));
|
|
3956
|
+
padded.set(fpU8);
|
|
3957
|
+
this.fpU32 = new Uint32Array(padded.buffer);
|
|
3958
|
+
} else this.fpU32 = new Uint32Array(fpU8.buffer);
|
|
3959
|
+
}
|
|
3960
|
+
get onBits() {
|
|
3961
|
+
if (this._onBits !== null) return this._onBits;
|
|
3962
|
+
let count = 0;
|
|
3963
|
+
for (let i = 0; i < this.fpU32.length; i++) count += hammingWeight(this.fpU32[i]);
|
|
3964
|
+
this._onBits = count;
|
|
3965
|
+
return this._onBits;
|
|
3966
|
+
}
|
|
3967
|
+
get uint8Array() {
|
|
3968
|
+
return this.fpU8;
|
|
3969
|
+
}
|
|
3970
|
+
toString() {
|
|
3971
|
+
const pieces = [];
|
|
3972
|
+
for (const byte of this.fpU8) pieces.push(...byte.toString(2).padStart(8, "0").split("").reverse());
|
|
3973
|
+
return pieces.join("").substring(0, this.nBits);
|
|
3974
|
+
}
|
|
3975
|
+
};
|
|
3976
|
+
|
|
3916
3977
|
//#endregion
|
|
3917
3978
|
//#region src/mol.ts
|
|
3918
3979
|
/**
|
|
@@ -4103,60 +4164,31 @@ var Mol = class Mol {
|
|
|
4103
4164
|
*/
|
|
4104
4165
|
getMorganFp(options) {
|
|
4105
4166
|
const mol = this.jsMol;
|
|
4106
|
-
return options ? mol.
|
|
4167
|
+
return new Fingerprint(options ? mol.get_morgan_fp_as_uint8array(JSON.stringify(options)) : mol.get_morgan_fp_as_uint8array(), options?.nBits, "Morgan");
|
|
4107
4168
|
}
|
|
4108
4169
|
/** Returns the pattern fingerprint as a bit string */
|
|
4109
4170
|
getPatternFp(options) {
|
|
4110
4171
|
const mol = this.jsMol;
|
|
4111
|
-
return options ? mol.
|
|
4172
|
+
return new Fingerprint(options ? mol.get_pattern_fp_as_uint8array(JSON.stringify(options)) : mol.get_pattern_fp_as_uint8array(), options?.nBits, "Pattern");
|
|
4112
4173
|
}
|
|
4113
4174
|
/** Returns the topological torsion fingerprint as a bit string */
|
|
4114
4175
|
getTopologicalTorsionFp(options) {
|
|
4115
4176
|
const mol = this.jsMol;
|
|
4116
|
-
return options ? mol.
|
|
4177
|
+
return new Fingerprint(options ? mol.get_topological_torsion_fp_as_uint8array(JSON.stringify(options)) : mol.get_topological_torsion_fp_as_uint8array(), options?.nBits, "TopologicalTorsion");
|
|
4117
4178
|
}
|
|
4118
4179
|
/** Returns the RDKit fingerprint as a bit string */
|
|
4119
4180
|
getRdkitFp(options) {
|
|
4120
4181
|
const mol = this.jsMol;
|
|
4121
|
-
return options ? mol.
|
|
4182
|
+
return new Fingerprint(options ? mol.get_rdkit_fp_as_uint8array(JSON.stringify(options)) : mol.get_rdkit_fp_as_uint8array(), options?.nBits, "RDKit");
|
|
4122
4183
|
}
|
|
4123
4184
|
/** Returns the atom pair fingerprint as a bit string */
|
|
4124
4185
|
getAtomPairFp(options) {
|
|
4125
4186
|
const mol = this.jsMol;
|
|
4126
|
-
return options ? mol.
|
|
4187
|
+
return new Fingerprint(options ? mol.get_atom_pair_fp_as_uint8array(JSON.stringify(options)) : mol.get_atom_pair_fp_as_uint8array(), options?.nBits, "AtomPair");
|
|
4127
4188
|
}
|
|
4128
4189
|
/** Returns the MACCS fingerprint as a bit string (fixed 167-bit) */
|
|
4129
4190
|
getMaccsFp() {
|
|
4130
|
-
return this.jsMol.
|
|
4131
|
-
}
|
|
4132
|
-
/** Returns the Morgan fingerprint as a Uint8Array */
|
|
4133
|
-
getMorganFpAsUint8Array(options) {
|
|
4134
|
-
const mol = this.jsMol;
|
|
4135
|
-
return options ? mol.get_morgan_fp_as_uint8array(JSON.stringify(options)) : mol.get_morgan_fp_as_uint8array();
|
|
4136
|
-
}
|
|
4137
|
-
/** Returns the pattern fingerprint as a Uint8Array */
|
|
4138
|
-
getPatternFpAsUint8Array(options) {
|
|
4139
|
-
const mol = this.jsMol;
|
|
4140
|
-
return options ? mol.get_pattern_fp_as_uint8array(JSON.stringify(options)) : mol.get_pattern_fp_as_uint8array();
|
|
4141
|
-
}
|
|
4142
|
-
/** Returns the topological torsion fingerprint as a Uint8Array */
|
|
4143
|
-
getTopologicalTorsionFpAsUint8Array(options) {
|
|
4144
|
-
const mol = this.jsMol;
|
|
4145
|
-
return options ? mol.get_topological_torsion_fp_as_uint8array(JSON.stringify(options)) : mol.get_topological_torsion_fp_as_uint8array();
|
|
4146
|
-
}
|
|
4147
|
-
/** Returns the RDKit fingerprint as a Uint8Array */
|
|
4148
|
-
getRdkitFpAsUint8Array(options) {
|
|
4149
|
-
const mol = this.jsMol;
|
|
4150
|
-
return options ? mol.get_rdkit_fp_as_uint8array(JSON.stringify(options)) : mol.get_rdkit_fp_as_uint8array();
|
|
4151
|
-
}
|
|
4152
|
-
/** Returns the atom pair fingerprint as a Uint8Array */
|
|
4153
|
-
getAtomPairFpAsUint8Array(options) {
|
|
4154
|
-
const mol = this.jsMol;
|
|
4155
|
-
return options ? mol.get_atom_pair_fp_as_uint8array(JSON.stringify(options)) : mol.get_atom_pair_fp_as_uint8array();
|
|
4156
|
-
}
|
|
4157
|
-
/** Returns the MACCS fingerprint as a Uint8Array */
|
|
4158
|
-
getMaccsFpAsUint8Array() {
|
|
4159
|
-
return this.jsMol.get_maccs_fp_as_uint8array();
|
|
4191
|
+
return new Fingerprint(this.jsMol.get_maccs_fp_as_uint8array(), 167, "MACCS");
|
|
4160
4192
|
}
|
|
4161
4193
|
/**
|
|
4162
4194
|
* Parses a property value string, attempting JSON.parse first.
|
|
@@ -4309,7 +4341,12 @@ var Mol = class Mol {
|
|
|
4309
4341
|
* @param options - Alignment options
|
|
4310
4342
|
*/
|
|
4311
4343
|
generateAlignedCoords(template, options) {
|
|
4312
|
-
|
|
4344
|
+
const matchJson = this.jsMol.generate_aligned_coords(template.jsMol, JSON.stringify(options ?? {}));
|
|
4345
|
+
if (matchJson === "" || matchJson === "{}") return {
|
|
4346
|
+
atoms: [],
|
|
4347
|
+
bonds: []
|
|
4348
|
+
};
|
|
4349
|
+
return JSON.parse(matchJson);
|
|
4313
4350
|
}
|
|
4314
4351
|
/**
|
|
4315
4352
|
* Normalizes the depiction of the molecule
|
|
@@ -4664,6 +4701,9 @@ var RDKit = class {
|
|
|
4664
4701
|
if (!jsMol) return null;
|
|
4665
4702
|
return new Mol(jsMol, this.#mod);
|
|
4666
4703
|
}
|
|
4704
|
+
computeFingerprintsSimilarity(...args) {
|
|
4705
|
+
return computeFingerprintSimilarity(...args);
|
|
4706
|
+
}
|
|
4667
4707
|
/** Returns the RDKit version string */
|
|
4668
4708
|
get version() {
|
|
4669
4709
|
return this.#mod.version();
|
|
@@ -4703,4 +4743,4 @@ async function initRDKit(options, constructor = RDKit) {
|
|
|
4703
4743
|
}
|
|
4704
4744
|
|
|
4705
4745
|
//#endregion
|
|
4706
|
-
export { Mol, MolArray, RDKit, Reaction, initRDKit };
|
|
4746
|
+
export { Fingerprint, Mol, MolArray, RDKit, Reaction, initRDKit };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rdkit-esm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "RDKit minimal lib for the modern web.",
|
|
5
5
|
"homepage": "https://github.com/tandemai/rdkit-esm#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@typescript/native-preview": "7.0.0-dev.20260307.1",
|
|
39
39
|
"@vitest/coverage-v8": "^4.0.18",
|
|
40
40
|
"bumpp": "^10.3.2",
|
|
41
|
-
"oxfmt": "^0.
|
|
41
|
+
"oxfmt": "^0.41.0",
|
|
42
42
|
"rolldown-plugin-wasm": "^0.2.1",
|
|
43
43
|
"tsdown": "^0.18.1",
|
|
44
44
|
"typescript": "^5.9.3",
|