openchemlib-search-wasm 1.2.0 → 2.1.0

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.
Files changed (59) hide show
  1. package/README.md +290 -3
  2. package/lib/functionKeys/dictionary.json +72071 -0
  3. package/lib/functionKeys/index.d.ts +105 -0
  4. package/lib/functionKeys/index.d.ts.map +1 -0
  5. package/lib/functionKeys/index.js +98 -0
  6. package/lib/functionKeys/index.js.map +1 -0
  7. package/lib/functions.d.ts +38 -0
  8. package/lib/functions.d.ts.map +1 -0
  9. package/lib/functions.js +54 -0
  10. package/lib/functions.js.map +1 -0
  11. package/lib/hex.d.ts +31 -0
  12. package/lib/hex.d.ts.map +1 -0
  13. package/lib/hex.js +41 -0
  14. package/lib/hex.js.map +1 -0
  15. package/lib/index.d.ts +140 -2
  16. package/lib/index.d.ts.map +1 -1
  17. package/lib/index.js +184 -7
  18. package/lib/index.js.map +1 -1
  19. package/lib/records.d.ts +45 -0
  20. package/lib/records.d.ts.map +1 -0
  21. package/lib/records.js +96 -0
  22. package/lib/records.js.map +1 -0
  23. package/lib/scan.d.ts +99 -7
  24. package/lib/scan.d.ts.map +1 -1
  25. package/lib/scan.js +158 -11
  26. package/lib/scan.js.map +1 -1
  27. package/lib/strongHash.d.ts +9 -0
  28. package/lib/strongHash.d.ts.map +1 -0
  29. package/lib/strongHash.js +56 -0
  30. package/lib/strongHash.js.map +1 -0
  31. package/lib/substructureSearch.d.ts +8 -5
  32. package/lib/substructureSearch.d.ts.map +1 -1
  33. package/lib/substructureSearch.js +28 -5
  34. package/lib/substructureSearch.js.map +1 -1
  35. package/lib/types.d.ts +120 -3
  36. package/lib/types.d.ts.map +1 -1
  37. package/lib/types.js +17 -1
  38. package/lib/types.js.map +1 -1
  39. package/lib/wasm/load.d.ts.map +1 -1
  40. package/lib/wasm/load.js +9 -1
  41. package/lib/wasm/load.js.map +1 -1
  42. package/lib/wasm/log.d.ts +36 -0
  43. package/lib/wasm/log.d.ts.map +1 -0
  44. package/lib/wasm/log.js +52 -0
  45. package/lib/wasm/log.js.map +1 -0
  46. package/package.json +6 -3
  47. package/src/functionKeys/index.ts +181 -0
  48. package/src/functions.ts +56 -0
  49. package/src/hex.ts +43 -0
  50. package/src/index.ts +269 -5
  51. package/src/records.ts +142 -0
  52. package/src/scan.ts +259 -16
  53. package/src/strongHash.ts +57 -0
  54. package/src/substructureSearch.ts +29 -6
  55. package/src/types.ts +171 -2
  56. package/src/wasm/load.ts +10 -1
  57. package/src/wasm/log.ts +66 -0
  58. package/wasm/data.js +1 -1
  59. package/wasm/runtime.d.ts +6 -0
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Where a key's answer comes from: one of the 512 function bits a record stores, a bit of the FragFp
3
+ * or the screen that holds exactly the same molecules, or a substructure search run when asked.
4
+ */
5
+ export type FunctionKeyTier = 'stored' | 'existingPlane' | 'onDemand';
6
+ /** One named function key: a functional group, a ring, a substituent, a natural product class. */
7
+ export interface FunctionKey {
8
+ /** Stable identifier. */
9
+ id: string;
10
+ /** The name to show. No other key carries it as name or synonym, case aside. */
11
+ name: string;
12
+ /** The other names it answers to, each also unique across the dictionary. */
13
+ synonyms: string[];
14
+ /** A key of {@link getFunctionCategories}. */
15
+ category: string;
16
+ /** A finer group within the category. */
17
+ subcategory: string;
18
+ tier: FunctionKeyTier;
19
+ /** For a `stored` key: its bit in the function words, 0 to 511. */
20
+ plane?: number;
21
+ /** For an `existingPlane` key: the fingerprint holding its bit. */
22
+ fingerprint?: 'fragFp' | 'screen';
23
+ /** For an `existingPlane` key: its bit in that fingerprint, 0 to 511. */
24
+ bit?: number;
25
+ /** The share of the 1,034,054 PubChem molecules it was counted on that hold it. */
26
+ prevalence: number;
27
+ /** Where its definition comes from: keys of {@link getFunctionKeySources}. */
28
+ sources: string[];
29
+ /** The SMARTS it was compiled from, absent for a key given as an idcode. */
30
+ smarts?: string;
31
+ /**
32
+ * Its query fragments, as idcodes: a molecule holds the key when it holds any of them, which is
33
+ * what `substructureSearch(key.fragments, entries)` tests.
34
+ */
35
+ fragments: string[];
36
+ }
37
+ /** A source the dictionary's definitions come from, and the licence they are used under. */
38
+ export interface FunctionKeySource {
39
+ name: string;
40
+ url: string;
41
+ licence: string;
42
+ }
43
+ /** Where a key's bit sits in the 48-word record of `getMoleculeRecords`. */
44
+ export interface RecordBit {
45
+ /** The word of the record: FragFp words first, then the screen, then the function bits. */
46
+ word: number;
47
+ /** The bit within that word. */
48
+ mask: number;
49
+ }
50
+ /** What {@link searchFunctionKeys} takes. */
51
+ export interface SearchFunctionKeysOptions {
52
+ /**
53
+ * Only the keys of this tier.
54
+ * @default every tier
55
+ */
56
+ tier?: FunctionKeyTier;
57
+ /**
58
+ * Only the keys of this category.
59
+ * @default every category
60
+ */
61
+ category?: string;
62
+ /**
63
+ * The most keys to return.
64
+ * @default no limit
65
+ */
66
+ limit?: number;
67
+ }
68
+ /**
69
+ * Returns every function key: the 512 stored ones in bit order, then those equal to a FragFp or
70
+ * screen bit, then those computed on demand, by category and prevalence.
71
+ * @returns The keys. They are shared: do not modify them.
72
+ */
73
+ export declare function getFunctionKeys(): readonly FunctionKey[];
74
+ /**
75
+ * Finds a key by its id, its name or one of its synonyms, case aside.
76
+ * @param nameOrId - What to look up, such as `thioether`, `Boc` or `pyridin_2_one`.
77
+ * @returns The key, or undefined when nothing carries that name.
78
+ */
79
+ export declare function getFunctionKey(nameOrId: string): FunctionKey | undefined;
80
+ /**
81
+ * Finds the keys whose id, name or synonyms hold every word of a text, case aside: an exact name
82
+ * first, then names starting with the text, then the rest, each by prevalence.
83
+ * @param text - Words to look for, such as `aromatic amine` or `lactam`.
84
+ * @param options - Narrows the result; see {@link SearchFunctionKeysOptions}.
85
+ * @returns The matching keys, best first.
86
+ */
87
+ export declare function searchFunctionKeys(text: string, options?: SearchFunctionKeysOptions): FunctionKey[];
88
+ /**
89
+ * Returns the categories keys are grouped in, in display order.
90
+ * @returns Category id to its title, such as `carbonyl` to `Carbonyl groups`.
91
+ */
92
+ export declare function getFunctionCategories(): Readonly<Record<string, string>>;
93
+ /**
94
+ * Returns the sources the definitions come from, with their licences, for attribution.
95
+ * @returns Source id, as a key's `sources` names it, to its name, address and licence.
96
+ */
97
+ export declare function getFunctionKeySources(): Readonly<Record<string, FunctionKeySource>>;
98
+ /**
99
+ * Says where a key's answer sits in a record of `getMoleculeRecords`, so a stored record answers it
100
+ * with one mask test: `(record[word] & mask) !== 0`.
101
+ * @param key - The key.
102
+ * @returns The word and mask, or undefined for a key computed on demand, which a record does not hold.
103
+ */
104
+ export declare function getRecordBit(key: FunctionKey): RecordBit | undefined;
105
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functionKeys/index.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,eAAe,GAAG,UAAU,CAAC;AAEtE,kGAAkG;AAClG,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;IACtB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,4FAA4F;AAC5F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACxB,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,SAAS,WAAW,EAAE,CAExD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAYxE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,yBAA8B,GACtC,WAAW,EAAE,CAwBf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAExE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,CAC/C,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAClC,CAEA;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAapE"}
@@ -0,0 +1,98 @@
1
+ import { INDEX_WORDS } from "../types.js";
2
+ import dictionary from './dictionary.json' with { type: 'json' };
3
+ const KEYS = dictionary.keys;
4
+ let byName;
5
+ /**
6
+ * Returns every function key: the 512 stored ones in bit order, then those equal to a FragFp or
7
+ * screen bit, then those computed on demand, by category and prevalence.
8
+ * @returns The keys. They are shared: do not modify them.
9
+ */
10
+ export function getFunctionKeys() {
11
+ return KEYS;
12
+ }
13
+ /**
14
+ * Finds a key by its id, its name or one of its synonyms, case aside.
15
+ * @param nameOrId - What to look up, such as `thioether`, `Boc` or `pyridin_2_one`.
16
+ * @returns The key, or undefined when nothing carries that name.
17
+ */
18
+ export function getFunctionKey(nameOrId) {
19
+ if (!byName) {
20
+ byName = new Map();
21
+ for (const key of KEYS) {
22
+ for (const name of [key.id, key.name, ...key.synonyms]) {
23
+ if (!byName.has(name.toLowerCase())) {
24
+ byName.set(name.toLowerCase(), key);
25
+ }
26
+ }
27
+ }
28
+ }
29
+ return byName.get(nameOrId.trim().toLowerCase());
30
+ }
31
+ /**
32
+ * Finds the keys whose id, name or synonyms hold every word of a text, case aside: an exact name
33
+ * first, then names starting with the text, then the rest, each by prevalence.
34
+ * @param text - Words to look for, such as `aromatic amine` or `lactam`.
35
+ * @param options - Narrows the result; see {@link SearchFunctionKeysOptions}.
36
+ * @returns The matching keys, best first.
37
+ */
38
+ export function searchFunctionKeys(text, options = {}) {
39
+ const { tier, category, limit = Number.POSITIVE_INFINITY } = options;
40
+ const wanted = text.trim().toLowerCase();
41
+ const words = wanted.split(/\s+/).filter(Boolean);
42
+ const scored = [];
43
+ for (const key of KEYS) {
44
+ if ((tier && key.tier !== tier) ||
45
+ (category && key.category !== category)) {
46
+ continue;
47
+ }
48
+ const names = [key.name, ...key.synonyms].map((name) => name.toLowerCase());
49
+ const haystack = `${key.id.toLowerCase()}\n${names.join('\n')}`;
50
+ if (!words.every((word) => haystack.includes(word)))
51
+ continue;
52
+ const rank = names.includes(wanted)
53
+ ? 0
54
+ : names.some((name) => name.startsWith(wanted))
55
+ ? 1
56
+ : 2;
57
+ scored.push({ key, rank });
58
+ }
59
+ scored.sort((a, b) => a.rank - b.rank || b.key.prevalence - a.key.prevalence);
60
+ return scored.slice(0, limit).map(({ key }) => key);
61
+ }
62
+ /**
63
+ * Returns the categories keys are grouped in, in display order.
64
+ * @returns Category id to its title, such as `carbonyl` to `Carbonyl groups`.
65
+ */
66
+ export function getFunctionCategories() {
67
+ return dictionary.categories;
68
+ }
69
+ /**
70
+ * Returns the sources the definitions come from, with their licences, for attribution.
71
+ * @returns Source id, as a key's `sources` names it, to its name, address and licence.
72
+ */
73
+ export function getFunctionKeySources() {
74
+ return dictionary.sources;
75
+ }
76
+ /**
77
+ * Says where a key's answer sits in a record of `getMoleculeRecords`, so a stored record answers it
78
+ * with one mask test: `(record[word] & mask) !== 0`.
79
+ * @param key - The key.
80
+ * @returns The word and mask, or undefined for a key computed on demand, which a record does not hold.
81
+ */
82
+ export function getRecordBit(key) {
83
+ let base;
84
+ let bit;
85
+ if (key.tier === 'stored' && key.plane !== undefined) {
86
+ base = 2 * INDEX_WORDS;
87
+ bit = key.plane;
88
+ }
89
+ else if (key.tier === 'existingPlane' && key.bit !== undefined) {
90
+ base = key.fingerprint === 'screen' ? INDEX_WORDS : 0;
91
+ bit = key.bit;
92
+ }
93
+ else {
94
+ return undefined;
95
+ }
96
+ return { word: base + (bit >> 5), mask: 1 << (31 - (bit & 31)) };
97
+ }
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functionKeys/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,UAAU,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AA0EjE,MAAM,IAAI,GAAG,UAAU,CAAC,IAAqB,CAAC;AAC9C,IAAI,MAA4C,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAA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;IACjB,IAAI,GAAW,CAAC;IAChB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACrD,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC;QACvB,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC;IAClB,CAAC;SAAM,IAAI,GAAG,CAAC,IAAI,KAAK,eAAe,IAAI,GAAG,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QACjE,IAAI,GAAG,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Builds the 512 function bits of one idcode, as sixteen 32-bit words: bit i is set when any
3
+ * fragment of stored function key i is a substructure of the molecule.
4
+ *
5
+ * The keys are named chemistry — thioether, aromatic ring, uracil, Boc — so a question in words
6
+ * becomes bit arithmetic over stored words. Their names, categories and synonyms, and the keys that
7
+ * are computed on demand instead, are in the dictionary of `openchemlib-search-wasm/function-keys`.
8
+ * A key's bit always agrees with a substructure search for its fragments. The words are laid out
9
+ * as {@link getFunctionKeyFragments} shows.
10
+ * @param idCode - The molecule to read, as an idcode.
11
+ * @returns Sixteen words. An idcode that will not parse gives sixteen zeros.
12
+ */
13
+ export declare function getFunction(idCode: string): Int32Array;
14
+ /**
15
+ * Builds the 512 function bits of every idcode, sixteen 32-bit words each.
16
+ *
17
+ * See {@link getFunction}. Each molecule's FragFp and screen are built too, because a key's fragment
18
+ * is only tried on a molecule holding its query words; `getMoleculeRecords` returns all three
19
+ * from one parse. The words are written into one buffer and returned as a view per molecule.
20
+ * @param idCodes - The molecules to read, as idcodes.
21
+ * @returns One sixteen-word view per idcode, in order.
22
+ */
23
+ export declare function getFunctions(idCodes: string[]): Int32Array[];
24
+ /**
25
+ * Returns the fragments of the 512 stored function keys, in bit order: bit i of {@link getFunction}
26
+ * is set when any fragment of key i is a substructure of the molecule. Bit i sits in word `i >> 5`,
27
+ * the first key in the highest bit of word 0:
28
+ *
29
+ * ```js
30
+ * const held = (words, i) => (words[i >> 5] & (1 << (31 - (i & 31)))) !== 0;
31
+ * ```
32
+ *
33
+ * The list is frozen with the module: changing, adding or reordering a key changes every stored
34
+ * record, so it only changes in a major release.
35
+ * @returns 512 arrays of idcodes, each a key's fragments. The arrays are the caller's own.
36
+ */
37
+ export declare function getFunctionKeyFragments(): string[][];
38
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAItD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAQ5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,EAAE,CAEpD"}
@@ -0,0 +1,54 @@
1
+ import { buildFunctions, readFunctionKeys } from "./scan.js";
2
+ import { INDEX_WORDS } from "./types.js";
3
+ /**
4
+ * Builds the 512 function bits of one idcode, as sixteen 32-bit words: bit i is set when any
5
+ * fragment of stored function key i is a substructure of the molecule.
6
+ *
7
+ * The keys are named chemistry — thioether, aromatic ring, uracil, Boc — so a question in words
8
+ * becomes bit arithmetic over stored words. Their names, categories and synonyms, and the keys that
9
+ * are computed on demand instead, are in the dictionary of `openchemlib-search-wasm/function-keys`.
10
+ * A key's bit always agrees with a substructure search for its fragments. The words are laid out
11
+ * as {@link getFunctionKeyFragments} shows.
12
+ * @param idCode - The molecule to read, as an idcode.
13
+ * @returns Sixteen words. An idcode that will not parse gives sixteen zeros.
14
+ */
15
+ export function getFunction(idCode) {
16
+ const result = new Int32Array(INDEX_WORDS);
17
+ buildFunctions([idCode], result, 0, 1);
18
+ return result;
19
+ }
20
+ /**
21
+ * Builds the 512 function bits of every idcode, sixteen 32-bit words each.
22
+ *
23
+ * See {@link getFunction}. Each molecule's FragFp and screen are built too, because a key's fragment
24
+ * is only tried on a molecule holding its query words; `getMoleculeRecords` returns all three
25
+ * from one parse. The words are written into one buffer and returned as a view per molecule.
26
+ * @param idCodes - The molecules to read, as idcodes.
27
+ * @returns One sixteen-word view per idcode, in order.
28
+ */
29
+ export function getFunctions(idCodes) {
30
+ const all = new Int32Array(idCodes.length * INDEX_WORDS);
31
+ buildFunctions(idCodes, all, 0, idCodes.length);
32
+ const words = new Array(idCodes.length);
33
+ for (let i = 0; i < idCodes.length; i++) {
34
+ words[i] = all.subarray(i * INDEX_WORDS, (i + 1) * INDEX_WORDS);
35
+ }
36
+ return words;
37
+ }
38
+ /**
39
+ * Returns the fragments of the 512 stored function keys, in bit order: bit i of {@link getFunction}
40
+ * is set when any fragment of key i is a substructure of the molecule. Bit i sits in word `i >> 5`,
41
+ * the first key in the highest bit of word 0:
42
+ *
43
+ * ```js
44
+ * const held = (words, i) => (words[i >> 5] & (1 << (31 - (i & 31)))) !== 0;
45
+ * ```
46
+ *
47
+ * The list is frozen with the module: changing, adding or reordering a key changes every stored
48
+ * record, so it only changes in a major release.
49
+ * @returns 512 arrays of idcodes, each a key's fragments. The arrays are the caller's own.
50
+ */
51
+ export function getFunctionKeyFragments() {
52
+ return readFunctionKeys();
53
+ }
54
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3C,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAAiB;IAC5C,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC;IACzD,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAa,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC"}
package/lib/hex.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Formats a hash as the 16 lowercase hex digits of its 64-bit pattern.
3
+ *
4
+ * A hash is a signed 64-bit integer, which `JSON.stringify` refuses outright — and a JSON number
5
+ * could not carry it anyway, since 64 bits does not fit a double. Hex is what crosses an API: it is
6
+ * always 16 characters whatever the value, it compares and sorts as a string, and it survives a
7
+ * round trip through anything that handles text.
8
+ *
9
+ * `hash.toString(16)` is not this: it writes `-1` for `-1n`, where the pattern is
10
+ * `ffffffffffffffff`, and it pads nothing.
11
+ *
12
+ * A database that stores the hash in an integer column can format it on the way out instead, and
13
+ * SQLite's `printf('%016x', hash)` produces exactly this string.
14
+ *
15
+ * ```js
16
+ * hashToHex(getNoStereoTautomerHash(idCode)); // 'eb14b9bc9ab4dd52'
17
+ * ```
18
+ * @param hash - The hash to format.
19
+ * @returns Its 16 hex digits, lowercase and zero-padded.
20
+ */
21
+ export declare function hashToHex(hash: bigint): string;
22
+ /**
23
+ * Reads back what {@link hashToHex} wrote, so a hash that arrived as text can be compared against
24
+ * one that was computed, or bound to an integer column.
25
+ * @param hex - The 16 hex digits, in either case.
26
+ * @returns The signed 64-bit hash.
27
+ * @throws {SyntaxError} When the string is not 16 hex digits — a truncated or `0x`-prefixed hash
28
+ * would otherwise read as a different, valid-looking value.
29
+ */
30
+ export declare function hexToHash(hex: string): bigint;
31
+ //# sourceMappingURL=hex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../src/hex.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK7C"}
package/lib/hex.js ADDED
@@ -0,0 +1,41 @@
1
+ /** How many hex digits a 64-bit hash always writes. */
2
+ const HASH_HEX_DIGITS = 16;
3
+ const HASH_HEX = /^[0-9a-f]{16}$/i;
4
+ /**
5
+ * Formats a hash as the 16 lowercase hex digits of its 64-bit pattern.
6
+ *
7
+ * A hash is a signed 64-bit integer, which `JSON.stringify` refuses outright — and a JSON number
8
+ * could not carry it anyway, since 64 bits does not fit a double. Hex is what crosses an API: it is
9
+ * always 16 characters whatever the value, it compares and sorts as a string, and it survives a
10
+ * round trip through anything that handles text.
11
+ *
12
+ * `hash.toString(16)` is not this: it writes `-1` for `-1n`, where the pattern is
13
+ * `ffffffffffffffff`, and it pads nothing.
14
+ *
15
+ * A database that stores the hash in an integer column can format it on the way out instead, and
16
+ * SQLite's `printf('%016x', hash)` produces exactly this string.
17
+ *
18
+ * ```js
19
+ * hashToHex(getNoStereoTautomerHash(idCode)); // 'eb14b9bc9ab4dd52'
20
+ * ```
21
+ * @param hash - The hash to format.
22
+ * @returns Its 16 hex digits, lowercase and zero-padded.
23
+ */
24
+ export function hashToHex(hash) {
25
+ return BigInt.asUintN(64, hash).toString(16).padStart(HASH_HEX_DIGITS, '0');
26
+ }
27
+ /**
28
+ * Reads back what {@link hashToHex} wrote, so a hash that arrived as text can be compared against
29
+ * one that was computed, or bound to an integer column.
30
+ * @param hex - The 16 hex digits, in either case.
31
+ * @returns The signed 64-bit hash.
32
+ * @throws {SyntaxError} When the string is not 16 hex digits — a truncated or `0x`-prefixed hash
33
+ * would otherwise read as a different, valid-looking value.
34
+ */
35
+ export function hexToHash(hex) {
36
+ if (!HASH_HEX.test(hex)) {
37
+ throw new SyntaxError(`not a 16-digit hex hash: ${JSON.stringify(hex)}`);
38
+ }
39
+ return BigInt.asIntN(64, BigInt(`0x${hex}`));
40
+ }
41
+ //# sourceMappingURL=hex.js.map
package/lib/hex.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.js","sourceRoot":"","sources":["../src/hex.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,WAAW,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  import type { HashOptions } from './types.ts';
2
2
  export { substructureSearch } from './substructureSearch.ts';
3
+ export { setLogHandler } from './wasm/log.ts';
4
+ export { hashToHex, hexToHash } from './hex.ts';
5
+ export { strongHash } from './strongHash.ts';
3
6
  export { similaritySearch } from './similaritySearch.ts';
4
- export { INDEX_WORDS, NO_HASH } from './types.ts';
5
- export type { HashOptions, ResultBuffer, SearchMode, SearchOptions, SearchResult, SearchStep, SimilaritySearchOptions, SimilaritySearchResult, SubstructureSearchOptions, SubstructureSearchResult, TautomerHashOptions, } from './types.ts';
7
+ export { getMoleculeRecords, getMoleculeSizes, getQueryAtomFloor, } from './records.ts';
8
+ export { getFunction, getFunctionKeyFragments, getFunctions, } from './functions.ts';
9
+ export { DEFAULT_MAX_TAUTOMERS, INDEX_WORDS, NO_HASH, NO_ID_CODE, RECORD_WORDS, } from './types.ts';
10
+ export type { LogHandler, LogStream } from './wasm/log.ts';
11
+ export type { HashOptions, MoleculeRecords, MoleculeRecordsOptions, MoleculeSizes, ResultBuffer, SearchMode, SearchOptions, SearchResult, SearchStep, SimilaritySearchOptions, SimilaritySearchResult, SubstructureSearchOptions, SubstructureSearchResult, TautomerHashOptions, } from './types.ts';
6
12
  export { SimilarityResult, SubstructureResult } from './types.ts';
7
13
  /**
8
14
  * Builds the 512-bit FragFp fingerprint of one idcode, as sixteen 32-bit words.
@@ -40,6 +46,85 @@ export declare function getIndex(idCode: string): Int32Array;
40
46
  * @returns One sixteen-word view per idcode, in order.
41
47
  */
42
48
  export declare function getIndexes(idCodes: string[]): Int32Array[];
49
+ /**
50
+ * Builds the 512-bit screen of one idcode, as sixteen 32-bit words: bit i is set when key i of the
51
+ * screen dictionary is a substructure of the molecule.
52
+ *
53
+ * The screen sits next to the FragFp fingerprint of {@link getIndex}. A molecule is a candidate for
54
+ * a query only if it holds every bit of {@link getQueryIndex} in its fingerprint and every bit of
55
+ * {@link getQueryScreen} in its screen; requiring both lets through about a sixth of the
56
+ * non-matching molecules FragFp alone lets through. The dictionary is 512 OpenChemLib query
57
+ * fragments, matched the way FragFp matches its own keys, and a screen costs about 0.7 times a
58
+ * fingerprint.
59
+ *
60
+ * ```js
61
+ * const isCandidate = (query, molecule) =>
62
+ * query.every((word, i) => (word & molecule[i]) === word);
63
+ * isCandidate(getQueryScreen(query), getScreen(idCode));
64
+ * ```
65
+ * @param idCode - The molecule to screen, as an idcode.
66
+ * @returns Sixteen words. An idcode that will not parse gives sixteen zeros, which no non-empty
67
+ * query screen is a subset of.
68
+ */
69
+ export declare function getScreen(idCode: string): Int32Array;
70
+ /**
71
+ * Builds the 512-bit screen of every idcode, sixteen 32-bit words each.
72
+ *
73
+ * See {@link getScreen}. The screens are written into one buffer and returned as a view per
74
+ * molecule, each 8-byte aligned, as {@link getIndexes} does.
75
+ * @param idCodes - The molecules to screen, as idcodes.
76
+ * @returns One sixteen-word view per idcode, in order.
77
+ */
78
+ export declare function getScreens(idCodes: string[]): Int32Array[];
79
+ /**
80
+ * Builds the screen of a query: the bits every molecule the query matches has in its
81
+ * {@link getScreen} screen.
82
+ *
83
+ * The query is screened on the fragment OpenChemLib's substructure search actually matches, so an
84
+ * exclude group cutting an aromatic ring and the atom ring sizes of the query are taken into account
85
+ * as the search takes them; a query with a "match formal bond order" bond gets no bits.
86
+ * @param idCodeQuery - The query, as an idcode; read as a fragment whatever its own fragment flag.
87
+ * @returns Sixteen words.
88
+ * @throws {Error} If the query cannot be parsed.
89
+ */
90
+ export declare function getQueryScreen(idCodeQuery: string): Int32Array;
91
+ /**
92
+ * Builds the FragFp fingerprint of a query: the bits every molecule the query matches has in its
93
+ * {@link getIndex} fingerprint.
94
+ *
95
+ * It equals OpenChemLib's own query fingerprint, except for the queries that one wrongly rejects
96
+ * true matches of: an exclude group cutting an aromatic ring, or a "match formal bond order" bond
97
+ * (Actelion/openchemlib#177). The first is fingerprinted on the fragment the search matches; the
98
+ * second gets no bits.
99
+ * @param idCodeQuery - The query, as an idcode; read as a fragment whatever its own fragment flag.
100
+ * @returns Sixteen words.
101
+ * @throws {Error} If the query cannot be parsed.
102
+ */
103
+ export declare function getQueryIndex(idCodeQuery: string): Int32Array;
104
+ /**
105
+ * Returns the 512 key fragments of FragFp, in bit order: bit i of {@link getIndex} is set when key i
106
+ * is a substructure of the molecule. They are OpenChemLib's own keys, the list `openchemlib`'s
107
+ * `SSSearcherWithIndex.getKeyIDCode()` returns.
108
+ *
109
+ * Bit i sits in word `i >> 5`, the first key in the highest bit of word 0:
110
+ *
111
+ * ```js
112
+ * const keys = getFragFpKeys();
113
+ * const index = getIndex(idCode);
114
+ * const held = keys.filter((key, i) => index[i >> 5] & (1 << (31 - (i & 31))));
115
+ * ```
116
+ * @returns 512 idcodes, each a query fragment, in bit order. The array is the caller's own.
117
+ */
118
+ export declare function getFragFpKeys(): string[];
119
+ /**
120
+ * Returns the 512 key fragments of the screen, in bit order: bit i of {@link getScreen} is set when
121
+ * key i is a substructure of the molecule. The words are laid out as {@link getFragFpKeys} shows.
122
+ *
123
+ * The list is frozen: changing, adding or reordering a key changes every stored screen, so it only
124
+ * changes in a major release.
125
+ * @returns 512 idcodes, each a query fragment, in bit order. The array is the caller's own.
126
+ */
127
+ export declare function getScreenKeys(): string[];
43
128
  /**
44
129
  * Hashes one idcode to the 64-bit value OpenChemLib identifies a molecule by up to tautomerism and
45
130
  * stereochemistry.
@@ -117,4 +202,57 @@ export declare function getNoStereoHash(idCode: string, options?: HashOptions):
117
202
  * hashed.
118
203
  */
119
204
  export declare function getNoStereoHashes(idCodes: string[], options?: HashOptions): BigInt64Array;
205
+ /**
206
+ * Canonizes one idcode to the form OpenChemLib identifies a molecule by up to stereochemistry.
207
+ *
208
+ * This is the string {@link getNoStereoHash} hashes, for a database that stores the canonical form
209
+ * itself. Prefer the hash where the column is only ever compared: it is a signed 64-bit integer, so
210
+ * it stores and indexes in 8 bytes where these idcodes average around 25 characters.
211
+ *
212
+ * ```js
213
+ * getNoStereoIdCode(idCode); // 'gGX`BDdwMT@@'
214
+ * ```
215
+ * @param idCode - The molecule to canonize, as an idcode.
216
+ * @param options - See {@link HashOptions}.
217
+ * @returns Its canonical no-stereo idcode, or `NO_ID_CODE` (`''`) for an idcode that will not parse
218
+ * or a molecule OpenChemLib cannot canonize.
219
+ */
220
+ export declare function getNoStereoIdCode(idCode: string, options?: HashOptions): string;
221
+ /**
222
+ * Canonizes every idcode to the form OpenChemLib identifies a molecule by up to stereochemistry.
223
+ *
224
+ * See {@link getNoStereoIdCode} for what the form identifies.
225
+ * @param idCodes - The molecules to canonize, as idcodes.
226
+ * @param options - See {@link HashOptions}.
227
+ * @returns One idcode per input, in order, with `NO_ID_CODE` (`''`) for each one that could not be
228
+ * canonized.
229
+ */
230
+ export declare function getNoStereoIdCodes(idCodes: string[], options?: HashOptions): string[];
231
+ /**
232
+ * Canonizes one idcode to the form OpenChemLib identifies a molecule by up to tautomerism and
233
+ * stereochemistry.
234
+ *
235
+ * This is the string {@link getNoStereoTautomerHash} hashes. It is the generic tautomer's idcode, so
236
+ * it is longer than the molecule's own — around twice it for a molecule with tautomeric sites — and
237
+ * it is not a structure: parsing it back gives a molecule with every tautomeric bond normalized, not
238
+ * the compound. Use it as a key, never as something to draw.
239
+ * @param idCode - The molecule to canonize, as an idcode.
240
+ * @param options - See {@link HashOptions}.
241
+ * @returns Its canonical no-stereo generic-tautomer idcode, or `NO_ID_CODE` (`''`) for an idcode that
242
+ * will not parse or a molecule OpenChemLib cannot canonize.
243
+ */
244
+ export declare function getNoStereoTautomerIdCode(idCode: string, options?: HashOptions): string;
245
+ /**
246
+ * Canonizes every idcode to the form OpenChemLib identifies a molecule by up to tautomerism and
247
+ * stereochemistry.
248
+ *
249
+ * See {@link getNoStereoTautomerIdCode} for what the form identifies, and
250
+ * {@link getNoStereoTautomerHashes} for what it costs — the canonization is the expensive part, not
251
+ * the hashing, so these cost what those do.
252
+ * @param idCodes - The molecules to canonize, as idcodes.
253
+ * @param options - See {@link HashOptions}.
254
+ * @returns One idcode per input, in order, with `NO_ID_CODE` (`''`) for each one that could not be
255
+ * canonized.
256
+ */
257
+ export declare function getNoStereoTautomerIdCodes(idCodes: string[], options?: HashOptions): string[];
120
258
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAInD;AAED;;;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