openchemlib 8.21.0 → 9.0.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/README.md +5 -55
- package/{types.d.ts → dist/openchemlib.d.ts} +61 -240
- package/dist/openchemlib.debug.js +69901 -0
- package/dist/openchemlib.js +24 -0
- package/dist/resources.json +37 -0
- package/package.json +26 -44
- package/core.d.ts +0 -15
- package/core.js +0 -24
- package/dist/openchemlib-core.js +0 -283
- package/dist/openchemlib-full.js +0 -310
- package/dist/openchemlib-full.pretty.js +0 -101963
- package/dist/openchemlib-minimal.js +0 -228
- package/full.d.ts +0 -16
- package/full.js +0 -32
- package/full.pretty.d.ts +0 -1
- package/full.pretty.js +0 -32
- package/lib/canvas_editor/clipboard_handler.js +0 -15
- package/lib/canvas_editor/create_editor.js +0 -152
- package/lib/canvas_editor/cursor_manager_16.js +0 -41
- package/lib/canvas_editor/cursor_manager_24.js +0 -43
- package/lib/canvas_editor/cursors_24px.js +0 -21
- package/lib/canvas_editor/draw_context.js +0 -156
- package/lib/canvas_editor/editor_area.js +0 -31
- package/lib/canvas_editor/editor_dialog.js +0 -250
- package/lib/canvas_editor/editor_image.js +0 -46
- package/lib/canvas_editor/editor_stylesheet.js +0 -21
- package/lib/canvas_editor/events.js +0 -144
- package/lib/canvas_editor/init/canvas_editor.js +0 -141
- package/lib/canvas_editor/init/canvas_editor_element.js +0 -359
- package/lib/canvas_editor/init/index.js +0 -70
- package/lib/canvas_editor/toolbar.js +0 -28
- package/lib/canvas_editor/ui_helper.js +0 -57
- package/lib/canvas_editor/utils.js +0 -55
- package/minimal.d.ts +0 -18
- package/minimal.js +0 -14
package/README.md
CHANGED
|
@@ -27,50 +27,8 @@ npm install openchemlib
|
|
|
27
27
|
|
|
28
28
|
## Documentation
|
|
29
29
|
|
|
30
|
-
This library is available in three different builds: `minimal`, `core` and `full`.
|
|
31
|
-
Each larger build contains all functionalities from the smaller ones.
|
|
32
|
-
|
|
33
|
-
The `core` build is the one that you get when you `require('openchemlib')`. It
|
|
34
|
-
contains all functionalities that can be used in Node.js.
|
|
35
|
-
|
|
36
|
-
The `minimal` (`require('openchemlib/minimal')`) build is a smaller one
|
|
37
|
-
(~ half the size of `core`) that is meant to be used in a browser application
|
|
38
|
-
if bundle size matters and prediction functionalities are not needed.
|
|
39
|
-
|
|
40
|
-
The `full` build (`require('openchemlib/full')`) build is the largest build.
|
|
41
|
-
It contains a structure viewer and a structure editor for browser applications.
|
|
42
|
-
|
|
43
30
|
- [TypeDoc home page](https://cheminfo.github.io/openchemlib-js/index.html)
|
|
44
31
|
|
|
45
|
-
### Modules present in minimal, core and full builds
|
|
46
|
-
|
|
47
|
-
- [Molecule](https://cheminfo.github.io/openchemlib-js/classes/Molecule.html)
|
|
48
|
-
- [Reaction](https://cheminfo.github.io/openchemlib-js/classes/Reaction.html)
|
|
49
|
-
- [RingCollection](https://cheminfo.github.io/openchemlib-js/classes/RingCollection.html)
|
|
50
|
-
- [SDFileParser](https://cheminfo.github.io/openchemlib-js/classes/SDFileParser.html)
|
|
51
|
-
- [SSSearcher](https://cheminfo.github.io/openchemlib-js/classes/SSSearcher.html)
|
|
52
|
-
- [SSSearcherWithIndex](https://cheminfo.github.io/openchemlib-js/classes/SSSearcherWithIndex.html)
|
|
53
|
-
- [Util](https://cheminfo.github.io/openchemlib-js/modules/Util.html)
|
|
54
|
-
|
|
55
|
-
### Modules present only in core and full builds
|
|
56
|
-
|
|
57
|
-
- [CanonizerUtil](https://cheminfo.github.io/openchemlib-js/classes/CanonizerUtil.html)
|
|
58
|
-
- [ConformerGenerator](https://cheminfo.github.io/openchemlib-js/classes/ConformerGenerator.html)
|
|
59
|
-
- [DruglikenessPredictor](https://cheminfo.github.io/openchemlib-js/classes/DruglikenessPredictor.html)
|
|
60
|
-
- [DrugScoreCalculator](https://cheminfo.github.io/openchemlib-js/modules/DrugScoreCalculator.html)
|
|
61
|
-
- [ForceFieldMMFF94](https://cheminfo.github.io/openchemlib-js/classes/ForceFieldMMFF94.html)
|
|
62
|
-
- [MoleculeProperties](https://cheminfo.github.io/openchemlib-js/classes/MoleculeProperties.html)
|
|
63
|
-
- [ReactionEncoder](https://cheminfo.github.io/openchemlib-js/classes/ReactionEncoder.html)
|
|
64
|
-
- [Reactor](https://cheminfo.github.io/openchemlib-js/classes/Reactor.html)
|
|
65
|
-
- [ToxicityPredictor](https://cheminfo.github.io/openchemlib-js/classes/ToxicityPredictor.html)
|
|
66
|
-
- [Transformer](https://cheminfo.github.io/openchemlib-js/classes/Transformer.html)
|
|
67
|
-
|
|
68
|
-
### Modules present only in full build
|
|
69
|
-
|
|
70
|
-
- [StructureEditor](https://cheminfo.github.io/openchemlib-js/classes/StructureEditor.html)
|
|
71
|
-
- [StructureView](https://cheminfo.github.io/openchemlib-js/modules/StructureView.html)
|
|
72
|
-
- [SVGRenderer](https://cheminfo.github.io/openchemlib-js/modules/SVGRenderer.html)
|
|
73
|
-
|
|
74
32
|
## Development
|
|
75
33
|
|
|
76
34
|
To build this project, you need :
|
|
@@ -91,26 +49,18 @@ If you want to use a custom JDK installation, set the "jdk" key to be the path t
|
|
|
91
49
|
### npm scripts
|
|
92
50
|
|
|
93
51
|
To run one of the scripts, use `npm run <scriptName>`.
|
|
94
|
-
To pass
|
|
52
|
+
To pass additional options, use `npm run <scriptName> -- --option`.
|
|
95
53
|
|
|
96
|
-
**Options
|
|
54
|
+
**Options** :
|
|
97
55
|
|
|
98
56
|
- -m [name]: only process module "name"
|
|
99
57
|
- -v: verbose output
|
|
100
58
|
|
|
101
|
-
####
|
|
102
|
-
|
|
103
|
-
Execute the GWT compiler.
|
|
104
|
-
|
|
105
|
-
#### export
|
|
106
|
-
|
|
107
|
-
Transform the GWT compiled files to JavaScript modules.
|
|
108
|
-
|
|
109
|
-
#### build:min / build:pretty
|
|
59
|
+
#### build-java
|
|
110
60
|
|
|
111
|
-
Compile and export.
|
|
61
|
+
Compile and export the Java API.
|
|
112
62
|
|
|
113
|
-
#### copy
|
|
63
|
+
#### copy-openchemlib
|
|
114
64
|
|
|
115
65
|
Copy the required java files from the openchemlib project.
|
|
116
66
|
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const Resources: {
|
|
2
|
+
/**
|
|
3
|
+
* Register the static resources.
|
|
4
|
+
* This is needed for some APIs.
|
|
5
|
+
* @param data - Object containing the resources or JSON string for such an object.
|
|
6
|
+
*/
|
|
7
|
+
register(data: string | Record<string, string>): void;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Fetch and register the static resources asynchronously from a URL.
|
|
11
|
+
* @param url - URL to the resources.json file.
|
|
12
|
+
* If omitted, fetch will be done relative to the openchemlib.js module location.
|
|
13
|
+
*/
|
|
14
|
+
registerFromUrl(url?: string): Promise<void>;
|
|
2
15
|
|
|
3
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Read and register the static resources synchronously.
|
|
18
|
+
* This is a convenience method for Node.js.
|
|
19
|
+
* @param path - Path to the resources.json file.
|
|
20
|
+
* If omitted, the file will be read relative to the openchemlib.js module location.
|
|
21
|
+
*/
|
|
22
|
+
registerFromNodejs(path?: string): void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface MoleculeFromSmilesOptions {
|
|
4
26
|
/**
|
|
5
27
|
* Disable coordinate invention.
|
|
6
28
|
* @default false
|
|
@@ -65,7 +87,7 @@ export interface BondQueryFeatures {
|
|
|
65
87
|
brigdeSpan: number;
|
|
66
88
|
}
|
|
67
89
|
|
|
68
|
-
export interface
|
|
90
|
+
export interface MoleculeToSVGOptions extends DepictorOptions {
|
|
69
91
|
/**
|
|
70
92
|
* Factor used to compute the size of text nodes.
|
|
71
93
|
* Default: 1.
|
|
@@ -75,12 +97,12 @@ export interface IMoleculeToSVGOptions extends IDepictorOptions {
|
|
|
75
97
|
/**
|
|
76
98
|
* font-weight attribute of atom labels.
|
|
77
99
|
*/
|
|
78
|
-
fontWeight?: string;
|
|
100
|
+
fontWeight?: number | string;
|
|
79
101
|
|
|
80
102
|
/**
|
|
81
103
|
* stroke-width styling property of bonds.
|
|
82
104
|
*/
|
|
83
|
-
strokeWidth?: string;
|
|
105
|
+
strokeWidth?: number | string;
|
|
84
106
|
|
|
85
107
|
/**
|
|
86
108
|
* Automatically crop the SVG to fit around the molecule.
|
|
@@ -96,7 +118,7 @@ export interface IMoleculeToSVGOptions extends IDepictorOptions {
|
|
|
96
118
|
autoCropMargin?: number;
|
|
97
119
|
}
|
|
98
120
|
|
|
99
|
-
export interface
|
|
121
|
+
export interface HoseCodesOptions {
|
|
100
122
|
/**
|
|
101
123
|
* Maximum number of atoms from the center.
|
|
102
124
|
* Default: 5.
|
|
@@ -112,7 +134,7 @@ export interface IHoseCodesOptions {
|
|
|
112
134
|
type: 0 | 1;
|
|
113
135
|
}
|
|
114
136
|
|
|
115
|
-
export interface
|
|
137
|
+
export interface SmilesGeneratorOptions {
|
|
116
138
|
/**
|
|
117
139
|
* Whether to create SMILES with SMARTS capabilities.
|
|
118
140
|
* @default false
|
|
@@ -451,7 +473,7 @@ export declare class Molecule {
|
|
|
451
473
|
*/
|
|
452
474
|
static fromSmiles(
|
|
453
475
|
smiles: string,
|
|
454
|
-
options?:
|
|
476
|
+
options?: MoleculeFromSmilesOptions,
|
|
455
477
|
): Molecule;
|
|
456
478
|
|
|
457
479
|
/**
|
|
@@ -518,7 +540,7 @@ export declare class Molecule {
|
|
|
518
540
|
|
|
519
541
|
toSmarts(): string;
|
|
520
542
|
|
|
521
|
-
toIsomericSmiles(options?:
|
|
543
|
+
toIsomericSmiles(options?: SmilesGeneratorOptions): string;
|
|
522
544
|
|
|
523
545
|
/**
|
|
524
546
|
* Returns a MDL Molfile V2000 string.
|
|
@@ -542,7 +564,7 @@ export declare class Molecule {
|
|
|
542
564
|
width: number,
|
|
543
565
|
height: number,
|
|
544
566
|
id?: string,
|
|
545
|
-
options?:
|
|
567
|
+
options?: MoleculeToSVGOptions,
|
|
546
568
|
): string;
|
|
547
569
|
|
|
548
570
|
/**
|
|
@@ -597,7 +619,7 @@ export declare class Molecule {
|
|
|
597
619
|
* Spherical Environments) codes represented as diastereotopic actelion IDs.
|
|
598
620
|
* @param options
|
|
599
621
|
*/
|
|
600
|
-
getHoseCodes(options?:
|
|
622
|
+
getHoseCodes(options?: HoseCodesOptions): string[][];
|
|
601
623
|
|
|
602
624
|
getRingSet(): RingCollection;
|
|
603
625
|
|
|
@@ -1757,7 +1779,7 @@ export declare class Molecule {
|
|
|
1757
1779
|
destMol: Molecule,
|
|
1758
1780
|
includeAtom: boolean[],
|
|
1759
1781
|
recognizeDelocalizedBonds: boolean,
|
|
1760
|
-
atomMap: number[],
|
|
1782
|
+
atomMap: number[] | null,
|
|
1761
1783
|
): void;
|
|
1762
1784
|
|
|
1763
1785
|
/**
|
|
@@ -2678,7 +2700,7 @@ export declare class Molecule {
|
|
|
2678
2700
|
setAssignParitiesToNitrogen(b: boolean): void;
|
|
2679
2701
|
}
|
|
2680
2702
|
|
|
2681
|
-
export interface
|
|
2703
|
+
export interface SmilesParserOptions {
|
|
2682
2704
|
/**
|
|
2683
2705
|
* Enable SMARTS parsing with `'smarts'` or `'guess'`.
|
|
2684
2706
|
* @default 'smiles'
|
|
@@ -2702,7 +2724,7 @@ export interface ISmilesParserOptions {
|
|
|
2702
2724
|
createSmartsWarnings?: boolean;
|
|
2703
2725
|
}
|
|
2704
2726
|
|
|
2705
|
-
export interface
|
|
2727
|
+
export interface SmilesParserParseMoleculeOptions {
|
|
2706
2728
|
/**
|
|
2707
2729
|
* Molecule to parse into.
|
|
2708
2730
|
*/
|
|
@@ -2725,7 +2747,7 @@ export declare class SmilesParser {
|
|
|
2725
2747
|
/**
|
|
2726
2748
|
* Create a SMILES parser.
|
|
2727
2749
|
*/
|
|
2728
|
-
constructor(options?:
|
|
2750
|
+
constructor(options?: SmilesParserOptions);
|
|
2729
2751
|
|
|
2730
2752
|
/**
|
|
2731
2753
|
* Set the random seed used to invent coordinates.
|
|
@@ -2738,7 +2760,7 @@ export declare class SmilesParser {
|
|
|
2738
2760
|
*/
|
|
2739
2761
|
parseMolecule(
|
|
2740
2762
|
smiles: string,
|
|
2741
|
-
options?:
|
|
2763
|
+
options?: SmilesParserParseMoleculeOptions,
|
|
2742
2764
|
): Molecule;
|
|
2743
2765
|
|
|
2744
2766
|
/**
|
|
@@ -2772,12 +2794,6 @@ export declare class RingCollection {
|
|
|
2772
2794
|
|
|
2773
2795
|
private constructor();
|
|
2774
2796
|
|
|
2775
|
-
/**
|
|
2776
|
-
* Returns the OCL object.
|
|
2777
|
-
*/
|
|
2778
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2779
|
-
getOCL(): any;
|
|
2780
|
-
|
|
2781
2797
|
getAtomRingSize(atom: number): number;
|
|
2782
2798
|
|
|
2783
2799
|
getBondRingSize(bond: number): number;
|
|
@@ -2853,7 +2869,7 @@ export declare class CanonizerUtil {
|
|
|
2853
2869
|
/**
|
|
2854
2870
|
* All depictor options default to `false`.
|
|
2855
2871
|
*/
|
|
2856
|
-
export interface
|
|
2872
|
+
export interface DepictorOptions {
|
|
2857
2873
|
inflateToMaxAVBL?: boolean;
|
|
2858
2874
|
inflateToHighResAVBL?: boolean;
|
|
2859
2875
|
chiralTextBelowMolecule?: boolean;
|
|
@@ -2909,12 +2925,6 @@ export declare class Reaction {
|
|
|
2909
2925
|
*/
|
|
2910
2926
|
static fromRxn(rxn: string): Reaction;
|
|
2911
2927
|
|
|
2912
|
-
/**
|
|
2913
|
-
* Returns the OCL object.
|
|
2914
|
-
*/
|
|
2915
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2916
|
-
getOCL(): any;
|
|
2917
|
-
|
|
2918
2928
|
/**
|
|
2919
2929
|
* Serialize the `Reaction` to a reaction SMILES string.
|
|
2920
2930
|
*/
|
|
@@ -3201,12 +3211,6 @@ export declare class SDFileParser {
|
|
|
3201
3211
|
*/
|
|
3202
3212
|
constructor(sdf: string, fields: string[]);
|
|
3203
3213
|
|
|
3204
|
-
/**
|
|
3205
|
-
* Returns the OCL object.
|
|
3206
|
-
*/
|
|
3207
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3208
|
-
getOCL(): any;
|
|
3209
|
-
|
|
3210
3214
|
/**
|
|
3211
3215
|
* Move to the next Molfile. Returns `true` if there is one, `false` otherwise.
|
|
3212
3216
|
* @example
|
|
@@ -3258,12 +3262,6 @@ export declare class SSSearcher {
|
|
|
3258
3262
|
*/
|
|
3259
3263
|
constructor();
|
|
3260
3264
|
|
|
3261
|
-
/**
|
|
3262
|
-
* Returns the OCL object.
|
|
3263
|
-
*/
|
|
3264
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3265
|
-
getOCL(): any;
|
|
3266
|
-
|
|
3267
3265
|
/**
|
|
3268
3266
|
* Set the `fragment` to search.
|
|
3269
3267
|
* @param fragment - `Molecule` instance to set as fragment. It has to be
|
|
@@ -3299,12 +3297,6 @@ export declare class SSSearcherWithIndex {
|
|
|
3299
3297
|
*/
|
|
3300
3298
|
constructor();
|
|
3301
3299
|
|
|
3302
|
-
/**
|
|
3303
|
-
* Returns the OCL object.
|
|
3304
|
-
*/
|
|
3305
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3306
|
-
getOCL(): any;
|
|
3307
|
-
|
|
3308
3300
|
/**
|
|
3309
3301
|
* Returns an array of the 512 idcodes that are used for computing indexes.
|
|
3310
3302
|
*/
|
|
@@ -3365,7 +3357,7 @@ export declare namespace Util {
|
|
|
3365
3357
|
*/
|
|
3366
3358
|
export function getHoseCodesFromDiastereotopicID(
|
|
3367
3359
|
diastereotopicID: string,
|
|
3368
|
-
options?:
|
|
3360
|
+
options?: HoseCodesOptions,
|
|
3369
3361
|
): string[];
|
|
3370
3362
|
}
|
|
3371
3363
|
|
|
@@ -3374,9 +3366,7 @@ export declare namespace Util {
|
|
|
3374
3366
|
*/
|
|
3375
3367
|
export declare const version: string;
|
|
3376
3368
|
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
export interface IParameterizedString {
|
|
3369
|
+
export interface ParameterizedString {
|
|
3380
3370
|
type: number;
|
|
3381
3371
|
|
|
3382
3372
|
value: string;
|
|
@@ -3391,15 +3381,15 @@ export declare class MoleculeProperties {
|
|
|
3391
3381
|
|
|
3392
3382
|
logP: number;
|
|
3393
3383
|
|
|
3394
|
-
logPString:
|
|
3384
|
+
logPString: ParameterizedString[];
|
|
3395
3385
|
|
|
3396
3386
|
logS: number;
|
|
3397
3387
|
|
|
3398
|
-
logSString:
|
|
3388
|
+
logSString: ParameterizedString[];
|
|
3399
3389
|
|
|
3400
3390
|
polarSurfaceArea: number;
|
|
3401
3391
|
|
|
3402
|
-
polarSurfaceAreaString:
|
|
3392
|
+
polarSurfaceAreaString: ParameterizedString[];
|
|
3403
3393
|
|
|
3404
3394
|
rotatableBondCount: number;
|
|
3405
3395
|
|
|
@@ -3407,16 +3397,13 @@ export declare class MoleculeProperties {
|
|
|
3407
3397
|
}
|
|
3408
3398
|
|
|
3409
3399
|
export declare class DruglikenessPredictor {
|
|
3400
|
+
/**
|
|
3401
|
+
* Create a new predictor.
|
|
3402
|
+
*/
|
|
3410
3403
|
constructor();
|
|
3411
3404
|
|
|
3412
3405
|
static DRUGLIKENESS_UNKNOWN: number;
|
|
3413
3406
|
|
|
3414
|
-
/**
|
|
3415
|
-
* Returns the OCL object.
|
|
3416
|
-
*/
|
|
3417
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3418
|
-
getOCL(): any;
|
|
3419
|
-
|
|
3420
3407
|
/**
|
|
3421
3408
|
* Returns the calculated drug likeness as a double.
|
|
3422
3409
|
* @param molecule
|
|
@@ -3428,7 +3415,7 @@ export declare class DruglikenessPredictor {
|
|
|
3428
3415
|
/**
|
|
3429
3416
|
* Returns detailed information about the previous drug likeness assessment.
|
|
3430
3417
|
*/
|
|
3431
|
-
getDetail():
|
|
3418
|
+
getDetail(): ParameterizedString[];
|
|
3432
3419
|
}
|
|
3433
3420
|
|
|
3434
3421
|
export declare namespace DrugScoreCalculator {
|
|
@@ -3437,7 +3424,7 @@ export declare namespace DrugScoreCalculator {
|
|
|
3437
3424
|
mSolubility: number,
|
|
3438
3425
|
mMolweight: number,
|
|
3439
3426
|
mDruglikeness: number,
|
|
3440
|
-
toxRisks: number[],
|
|
3427
|
+
toxRisks: number[] | null,
|
|
3441
3428
|
): number;
|
|
3442
3429
|
}
|
|
3443
3430
|
|
|
@@ -3456,12 +3443,6 @@ export declare class ToxicityPredictor {
|
|
|
3456
3443
|
|
|
3457
3444
|
static RISK_NAMES: string[];
|
|
3458
3445
|
|
|
3459
|
-
/**
|
|
3460
|
-
* Returns the OCL object.
|
|
3461
|
-
*/
|
|
3462
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3463
|
-
getOCL(): any;
|
|
3464
|
-
|
|
3465
3446
|
/**
|
|
3466
3447
|
* Returns the calculated risk as an integer.
|
|
3467
3448
|
* @param molecule
|
|
@@ -3475,23 +3456,23 @@ export declare class ToxicityPredictor {
|
|
|
3475
3456
|
* @param molecule
|
|
3476
3457
|
* @param riskType
|
|
3477
3458
|
*/
|
|
3478
|
-
getDetail(molecule: Molecule, riskType: number):
|
|
3459
|
+
getDetail(molecule: Molecule, riskType: number): ParameterizedString[];
|
|
3479
3460
|
}
|
|
3480
3461
|
|
|
3481
|
-
export interface
|
|
3462
|
+
export interface InitializeConformersOptions {
|
|
3482
3463
|
/**
|
|
3483
3464
|
* One of the ConformerGenerator.STRATEGY_ constants.
|
|
3484
|
-
*
|
|
3465
|
+
* @default ConformerGenerator.STRATEGY_LIKELY_RANDOM
|
|
3485
3466
|
*/
|
|
3486
3467
|
strategy?: number;
|
|
3487
3468
|
/**
|
|
3488
|
-
* Maximum
|
|
3489
|
-
*
|
|
3469
|
+
* Maximum amount of distinct torsion sets the strategy will try.
|
|
3470
|
+
* @efault 10_0000
|
|
3490
3471
|
*/
|
|
3491
3472
|
maxTorsionSets?: number;
|
|
3492
3473
|
/**
|
|
3493
3474
|
* Use 60 degree steps for every rotatable bond instead of torsion DB.
|
|
3494
|
-
*
|
|
3475
|
+
* @default false
|
|
3495
3476
|
*/
|
|
3496
3477
|
use60degreeSteps?: boolean;
|
|
3497
3478
|
}
|
|
@@ -3504,12 +3485,6 @@ export declare class ConformerGenerator {
|
|
|
3504
3485
|
|
|
3505
3486
|
constructor(seed: number);
|
|
3506
3487
|
|
|
3507
|
-
/**
|
|
3508
|
-
* Returns the OCL object.
|
|
3509
|
-
*/
|
|
3510
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3511
|
-
getOCL(): any;
|
|
3512
|
-
|
|
3513
3488
|
/**
|
|
3514
3489
|
* Fills all free valences of mol with explicit hydrogens and tries to
|
|
3515
3490
|
* create a reasonable conformer by starting with the most likely torsion set.
|
|
@@ -3536,7 +3511,7 @@ export declare class ConformerGenerator {
|
|
|
3536
3511
|
*/
|
|
3537
3512
|
initializeConformers(
|
|
3538
3513
|
mol: Molecule,
|
|
3539
|
-
options?:
|
|
3514
|
+
options?: InitializeConformersOptions,
|
|
3540
3515
|
): boolean;
|
|
3541
3516
|
|
|
3542
3517
|
/**
|
|
@@ -3571,11 +3546,11 @@ export declare class ConformerGenerator {
|
|
|
3571
3546
|
}
|
|
3572
3547
|
|
|
3573
3548
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
3574
|
-
export interface
|
|
3549
|
+
export interface ForceFieldMMFF94Options {
|
|
3575
3550
|
// TODO
|
|
3576
3551
|
}
|
|
3577
3552
|
|
|
3578
|
-
export interface
|
|
3553
|
+
export interface ForceFieldMinimiseOptions {
|
|
3579
3554
|
/**
|
|
3580
3555
|
* The maximum number of iterations to run for.
|
|
3581
3556
|
* Default: 4000.
|
|
@@ -3609,15 +3584,9 @@ export declare class ForceFieldMMFF94 {
|
|
|
3609
3584
|
constructor(
|
|
3610
3585
|
molecule: Molecule,
|
|
3611
3586
|
tablename: 'MMFF94' | 'MMFF94s' | 'MMFF94s+',
|
|
3612
|
-
options?:
|
|
3587
|
+
options?: ForceFieldMMFF94Options,
|
|
3613
3588
|
);
|
|
3614
3589
|
|
|
3615
|
-
/**
|
|
3616
|
-
* Returns the OCL object.
|
|
3617
|
-
*/
|
|
3618
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3619
|
-
getOCL(): any;
|
|
3620
|
-
|
|
3621
3590
|
/**
|
|
3622
3591
|
* Returns the total number of atoms in this force field.
|
|
3623
3592
|
*/
|
|
@@ -3634,155 +3603,7 @@ export declare class ForceFieldMMFF94 {
|
|
|
3634
3603
|
* @param options
|
|
3635
3604
|
* @returns - Return code, 0 on success.
|
|
3636
3605
|
*/
|
|
3637
|
-
minimise(options?:
|
|
3638
|
-
}
|
|
3639
|
-
|
|
3640
|
-
// Full API
|
|
3641
|
-
|
|
3642
|
-
export declare namespace StructureView {
|
|
3643
|
-
export function showStructures(cssClass: string): void;
|
|
3644
|
-
|
|
3645
|
-
export function renderStructure(id: string): void;
|
|
3646
|
-
|
|
3647
|
-
export function getIDCode(id: string): string;
|
|
3648
|
-
|
|
3649
|
-
export function drawStructure(
|
|
3650
|
-
id: string,
|
|
3651
|
-
idcode: string,
|
|
3652
|
-
coordinates: string,
|
|
3653
|
-
options?: IDepictorOptions,
|
|
3654
|
-
): void;
|
|
3655
|
-
|
|
3656
|
-
export function drawMolecule(
|
|
3657
|
-
el: HTMLCanvasElement,
|
|
3658
|
-
mol: Molecule,
|
|
3659
|
-
options?: IDepictorOptions,
|
|
3660
|
-
): void;
|
|
3661
|
-
|
|
3662
|
-
export function drawStructureWithText(
|
|
3663
|
-
id: string,
|
|
3664
|
-
idcode: string,
|
|
3665
|
-
coordinates: string,
|
|
3666
|
-
options?: IDepictorOptions,
|
|
3667
|
-
atomText?: string[],
|
|
3668
|
-
): void;
|
|
3669
|
-
}
|
|
3670
|
-
|
|
3671
|
-
export declare class StructureEditor {
|
|
3672
|
-
constructor(element: HTMLElement, useSVG?: boolean, scale?: number);
|
|
3673
|
-
|
|
3674
|
-
/**
|
|
3675
|
-
* Create a new structure editor.
|
|
3676
|
-
* @param id - Id of the DOM element
|
|
3677
|
-
*/
|
|
3678
|
-
static createEditor(id: string): StructureEditor;
|
|
3679
|
-
|
|
3680
|
-
/**
|
|
3681
|
-
* Create a new structure editor with an SVG toolbar.
|
|
3682
|
-
* @param id - Id of the DOM element
|
|
3683
|
-
* @param scale
|
|
3684
|
-
*/
|
|
3685
|
-
static createSVGEditor(id: string, scale: number): StructureEditor;
|
|
3686
|
-
|
|
3687
|
-
/**
|
|
3688
|
-
* Returns the OCL object.
|
|
3689
|
-
*/
|
|
3690
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3691
|
-
getOCL(): any;
|
|
3692
|
-
|
|
3693
|
-
getMolecule(): Molecule;
|
|
3694
|
-
|
|
3695
|
-
/**
|
|
3696
|
-
* Returns the current molecule as a string that contains its ID Code and
|
|
3697
|
-
* coordinates separated by a space.
|
|
3698
|
-
*/
|
|
3699
|
-
getIDCode(): string;
|
|
3700
|
-
|
|
3701
|
-
/**
|
|
3702
|
-
* Sets the current molecule to the provided ID code. The string can optionally
|
|
3703
|
-
* contain coordinates separated by a space.
|
|
3704
|
-
* @param idCode
|
|
3705
|
-
*/
|
|
3706
|
-
setIDCode(idCode: string): void;
|
|
3707
|
-
|
|
3708
|
-
/**
|
|
3709
|
-
* Switches the current molecule in the editor in fragment mode or not.
|
|
3710
|
-
* @param isFragment
|
|
3711
|
-
*/
|
|
3712
|
-
setFragment(isFragment: boolean): void;
|
|
3713
|
-
|
|
3714
|
-
/**
|
|
3715
|
-
* Returns whether the current molecule is a fragment.
|
|
3716
|
-
*/
|
|
3717
|
-
isFragment(): boolean;
|
|
3718
|
-
|
|
3719
|
-
/**
|
|
3720
|
-
* Returns the current molecule as a MDL Molfile V2000.
|
|
3721
|
-
*/
|
|
3722
|
-
getMolFile(): string;
|
|
3723
|
-
|
|
3724
|
-
/**
|
|
3725
|
-
* Sets the editor content to the molecule represented by this Molfile
|
|
3726
|
-
* (V2000 or V3000)
|
|
3727
|
-
* @param molfile
|
|
3728
|
-
*/
|
|
3729
|
-
setMolFile(molfile: string): void;
|
|
3730
|
-
|
|
3731
|
-
/**
|
|
3732
|
-
* Returns the current molecule as a MDL Molfile V3000.
|
|
3733
|
-
*/
|
|
3734
|
-
getMolFileV3(): string;
|
|
3735
|
-
|
|
3736
|
-
/**
|
|
3737
|
-
* Returns the current molecule as a SMILES string.
|
|
3738
|
-
*/
|
|
3739
|
-
getSmiles(): string;
|
|
3740
|
-
|
|
3741
|
-
/**
|
|
3742
|
-
* Sets the editor content to the molecule represented by this SMILES.
|
|
3743
|
-
* @param smiles
|
|
3744
|
-
*/
|
|
3745
|
-
setSmiles(smiles: string): void;
|
|
3746
|
-
|
|
3747
|
-
/**
|
|
3748
|
-
* Sets a callback function which is called whenever an atom is hovered/unhovered
|
|
3749
|
-
* by the mouse.
|
|
3750
|
-
* @param callback
|
|
3751
|
-
*/
|
|
3752
|
-
setAtomHightlightCallback(callback: AtomHighlightCallback): void;
|
|
3753
|
-
|
|
3754
|
-
/**
|
|
3755
|
-
* Sets a callback function which is called whenever a bond is hovered/unhovered
|
|
3756
|
-
* by the mouse.
|
|
3757
|
-
* @param callback
|
|
3758
|
-
*/
|
|
3759
|
-
setBondHightlightCallback(callback: BondHighlightCallback): void;
|
|
3760
|
-
|
|
3761
|
-
/**
|
|
3762
|
-
* Sets a callback function which is called whenever the structure in the editor
|
|
3763
|
-
* is changed.
|
|
3764
|
-
* @param callback
|
|
3765
|
-
*/
|
|
3766
|
-
setChangeListenerCallback(callback: ChangeListenerCallback): void;
|
|
3767
|
-
|
|
3768
|
-
hasFocus(): boolean;
|
|
3769
|
-
}
|
|
3770
|
-
|
|
3771
|
-
export type AtomHighlightCallback = (atom: number, selected: boolean) => void;
|
|
3772
|
-
|
|
3773
|
-
export type BondHighlightCallback = (bond: number, selected: boolean) => void;
|
|
3774
|
-
|
|
3775
|
-
export type ChangeListenerCallback = (
|
|
3776
|
-
idcode: string,
|
|
3777
|
-
molecule: Molecule,
|
|
3778
|
-
) => void;
|
|
3779
|
-
|
|
3780
|
-
export declare namespace SVGRenderer {
|
|
3781
|
-
export function renderMolecule(
|
|
3782
|
-
idCode: string,
|
|
3783
|
-
width: number,
|
|
3784
|
-
height: number,
|
|
3785
|
-
): string;
|
|
3606
|
+
minimise(options?: ForceFieldMinimiseOptions): number;
|
|
3786
3607
|
}
|
|
3787
3608
|
|
|
3788
3609
|
export type OnChangeEventType =
|
|
@@ -3915,7 +3736,7 @@ interface CanvasEditorElementConstructor extends CustomElementConstructor {
|
|
|
3915
3736
|
*
|
|
3916
3737
|
* In Javascript:
|
|
3917
3738
|
* ```js
|
|
3918
|
-
* import {registerCustomElement, Molecule, ReactionEncoder} from 'openchemlib
|
|
3739
|
+
* import {registerCustomElement, Molecule, ReactionEncoder} from 'openchemlib';
|
|
3919
3740
|
*
|
|
3920
3741
|
* // register CanvasEditorElement with `openchemlib-editor` tag name
|
|
3921
3742
|
* const CanvasEditorElement = registerCustomElement();
|