-
Notifications
You must be signed in to change notification settings - Fork 22
/
types.d.ts
4014 lines (3462 loc) · 127 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Minimal API
export interface IMoleculeFromSmilesOptions {
/**
* Disable coordinate invention.
* @default false
*/
noCoordinates?: boolean;
/**
* Disable stereo features parsing.
* @default false
*/
noStereo?: boolean;
}
export interface AtomQueryFeatures {
aromatic: boolean;
notAromatic: boolean;
notChain: boolean;
not2RingBonds: boolean;
not3RingBonds: boolean;
not4RingBonds: boolean;
noMoreNeighbours: boolean;
moreNeighbours: boolean;
matchStereo: boolean;
not0PiElectrons: boolean;
not1PiElectron: boolean;
not2PiElectrons: boolean;
not0Hydrogen: boolean;
not1Hydrogen: boolean;
not2Hydrogen: boolean;
not3Hydrogen: boolean;
not0Neighbours: boolean;
not1Neighbour: boolean;
not2Neighbours: boolean;
not3Neighbours: boolean;
not4Neighbours: boolean;
notChargeNeg: boolean;
notCharge0: boolean;
noChargePos: boolean;
ringSize0: boolean;
ringSize3: boolean;
ringSize4: boolean;
ringSize5: boolean;
ringSize6: boolean;
ringSize7: boolean;
ringSizeLarge: boolean;
}
export interface BondQueryFeatures {
single: boolean;
double: boolean;
triple: boolean;
delocalized: boolean;
metalLigand: boolean;
quadruple: boolean;
quintuple: boolean;
notRing: boolean;
ring: boolean;
aromatic: boolean;
nonAromatic: boolean;
ringSize: number;
brigdeMin: number;
brigdeSpan: number;
}
export interface IMoleculeToSVGOptions extends IDepictorOptions {
/**
* Factor used to compute the size of text nodes.
* Default: 1.
*/
factorTextSize?: number;
/**
* font-weight attribute of atom labels.
*/
fontWeight?: string;
/**
* stroke-width styling property of bonds.
*/
strokeWidth?: string;
/**
* Automatically crop the SVG to fit around the molecule.
* This changes the size of the SVG.
* Default: false.
*/
autoCrop?: boolean;
/**
* Margin (in px) to keep around the molecule when `autoCrop` is `true`.
* Default: 5.
*/
autoCropMargin?: number;
}
export interface IHoseCodesOptions {
/**
* Maximum number of atoms from the center.
* Default: 5.
*/
maxSphereSize: number;
/**
* Type of HOSE code.
* 0: normal HOSE code.
* 1: stop if Csp3-Csp3.
* Default: 0.
*/
type: 0 | 1;
}
export interface ISmilesGeneratorOptions {
/**
* Whether to create SMILES with SMARTS capabilities.
* @default false
*/
createSmarts?: boolean;
/**
* Whether to include mapping information (atomMapNo) in the SMILES.
* @default false
*/
includeMapping?: boolean;
/**
* Should localisation of double bonds be attempted?
* @default false
*/
kekulizedOutput?: boolean;
}
export interface Rectangle {
/**
* X-coordinate of the top-left corner.
*/
x: number;
/**
* Y-coordinate of the top-left corner.
*/
y: number;
/**
* Width of the shape.
*/
width: number;
/**
* Height of the shape.
*/
height: number;
}
export declare class Molecule {
/**
* Construct a new molecule.
* @param maxAtoms - Maximum number of initialized atoms. Default: 256.
* @param maxBonds - Maximum number of initialized bonds. Default: 256.
*/
constructor(maxAtoms: number, maxBonds: number);
// based on JSMolecule.java you can do a regexp ".*static.* (int|long|double)(.*) = .*;" and replace with "$2: number;"
// bonds to represent aromaticity
static CANONIZER_CREATE_SYMMETRY_RANK: number;
static CANONIZER_CONSIDER_DIASTEREOTOPICITY: number;
static CANONIZER_CONSIDER_ENANTIOTOPICITY: number;
static CANONIZER_CONSIDER_STEREOHETEROTOPICITY: number;
static CANONIZER_ENCODE_ATOM_CUSTOM_LABELS: number;
static CANONIZER_ENCODE_ATOM_SELECTION: number;
static CANONIZER_ASSIGN_PARITIES_TO_TETRAHEDRAL_N: number;
static CANONIZER_COORDS_ARE_3D: number;
static CANONIZER_CREATE_PSEUDO_STEREO_GROUPS: number;
static CANONIZER_DISTINGUISH_RACEMIC_OR_GROUPS: number;
static CANONIZER_TIE_BREAK_FREE_VALENCE_ATOMS: number;
static CANONIZER_ENCODE_ATOM_CUSTOM_LABELS_WITHOUT_RANKING: number;
static CANONIZER_NEGLECT_ANY_STEREO_INFORMATION: number;
static cMaxAtomicNo: number;
static cAtomParityNone: number;
static cAtomParity1: number;
static cAtomParity2: number;
static cAtomParityUnknown: number;
static cAtomParityIsPseudo: number;
static cAtomRadicalState: number;
static cAtomRadicalStateShift: number;
static cAtomRadicalStateNone: number;
static cAtomRadicalStateS: number;
static cAtomRadicalStateD: number;
static cAtomRadicalStateT: number;
static cAtomColorNone: number;
static cAtomColorBlue: number;
static cAtomColorRed: number;
static cAtomColorGreen: number;
static cAtomColorMagenta: number;
static cAtomColorOrange: number;
static cAtomColorDarkGreen: number;
static cAtomColorDarkRed: number;
static cAtomCIPParityNone: number;
static cAtomCIPParityRorM: number;
static cAtomCIPParitySorP: number;
static cAtomCIPParityProblem: number;
static cESRTypeAbs: number;
static cESRTypeAnd: number;
static cESRTypeOr: number;
static cESRMaxGroups: number;
static cESRGroupBits: number;
static cAtomQFNoOfBits: number;
static cAtomQFAromStateBits: number;
static cAtomQFAromStateShift: number;
static cAtomQFRingStateBits: number;
static cAtomQFRingStateShift: number;
static cAtomQFHydrogenBits: number;
static cAtomQFHydrogenShift: number;
static cAtomQFPiElectronBits: number;
static cAtomQFPiElectronShift: number;
static cAtomQFNeighbourBits: number;
static cAtomQFNeighbourShift: number;
static cAtomQFSmallRingSizeBits: number;
static cAtomQFSmallRingSizeShift: number;
static cAtomQFChargeBits: number;
static cAtomQFChargeShift: number;
static cAtomQFRxnParityBits: number;
static cAtomQFRxnParityShift: number;
static cAtomQFNewRingSizeBits: number;
static cAtomQFNewRingSizeShift: number;
static cAtomQFENeighbourBits: number;
static cAtomQFENeighbourShift: number;
static cAtomQFStereoStateBits: number;
static cAtomQFStereoStateShift: number;
static cAtomQFSimpleFeatures: number;
static cAtomQFNarrowing: number;
static cAtomQFAny: number;
static cAtomQFAromState: number;
static cAtomQFAromatic: number;
static cAtomQFNotAromatic: number;
static cAtomQFRingState: number;
static cAtomQFNotChain: number;
static cAtomQFNot2RingBonds: number;
static cAtomQFNot3RingBonds: number;
static cAtomQFNot4RingBonds: number;
static cAtomQFHydrogen: number;
static cAtomQFNot0Hydrogen: number;
static cAtomQFNot1Hydrogen: number;
static cAtomQFNot2Hydrogen: number;
static cAtomQFNot3Hydrogen: number;
static cAtomQFNoMoreNeighbours: number;
static cAtomQFMoreNeighbours: number;
static cAtomQFMatchStereo: number;
static cAtomQFPiElectrons: number;
static cAtomQFNot0PiElectrons: number;
static cAtomQFNot1PiElectron: number;
static cAtomQFNot2PiElectrons: number;
static cAtomQFNeighbours: number;
static cAtomQFNot0Neighbours: number;
static cAtomQFNot1Neighbour: number;
static cAtomQFNot2Neighbours: number;
static cAtomQFNot3Neighbours: number;
static cAtomQFNot4Neighbours: number;
static cAtomQFSmallRingSize: number;
static cAtomQFCharge: number;
static cAtomQFNotChargeNeg: number;
static cAtomQFNotCharge0: number;
static cAtomQFNotChargePos: number;
static cAtomQFFlatNitrogen: number;
static cAtomQFExcludeGroup: number;
static cAtomQFRxnParityHint: number;
static cAtomQFRxnParityRetain: number;
static cAtomQFRxnParityInvert: number;
static cAtomQFRxnParityRacemize: number;
static cAtomQFNewRingSize: number;
static cAtomQFRingSize0: number;
static cAtomQFRingSize3: number;
static cAtomQFRingSize4: number;
static cAtomQFRingSize5: number;
static cAtomQFRingSize6: number;
static cAtomQFRingSize7: number;
static cAtomQFRingSizeLarge: number;
static cAtomQFENeighbours: number;
static cAtomQFNot0ENeighbours: number;
static cAtomQFNot1ENeighbour: number;
static cAtomQFNot2ENeighbours: number;
static cAtomQFNot3ENeighbours: number;
static cAtomQFNot4ENeighbours: number;
static cAtomQFStereoState: number;
static cAtomQFIsStereo: number;
static cAtomQFIsNotStereo: number;
static cAtomQFHeteroAromatic: number;
static cBondTypeSingle: number;
static cBondTypeDouble: number;
static cBondTypeTriple: number;
static cBondTypeQuadruple: number;
static cBondTypeQuintuple: number;
static cBondTypeMetalLigand: number;
static cBondTypeDelocalized: number;
static cBondTypeDown: number;
static cBondTypeUp: number;
static cBondTypeCross: number;
static cBondTypeDeleted: number;
static cBondTypeIncreaseOrder: number;
static cBondTypeMaskSimple: number;
static cBondTypeMaskStereo: number;
static cBondFlagsHelper2: number;
static cBondFlagsHelper3: number;
static cBondParityNone: number;
static cBondParityEor1: number;
static cBondParityZor2: number;
static cBondParityUnknown: number;
static cBondCIPParityNone: number;
static cBondCIPParityEorP: number;
static cBondCIPParityZorM: number;
static cBondCIPParityProblem: number;
static cBondQFNoOfBits: number;
static cBondQFBondTypesBits: number;
static cBondQFBondTypesShift: number;
static cBondQFRareBondTypesBits: number;
static cBondQFRareBondTypesShift: number;
static cBondQFRingStateBits: number;
static cBondQFRingStateShift: number;
static cBondQFBridgeBits: number;
static cBondQFBridgeShift: number;
static cBondQFBridgeMinBits: number;
static cBondQFBridgeMinShift: number;
static cBondQFBridgeSpanBits: number;
static cBondQFBridgeSpanShift: number;
static cBondQFRingSizeBits: number;
static cBondQFRingSizeShift: number;
static cBondQFAromStateBits: number;
static cBondQFAromStateShift: number;
static cBondQFAllFeatures: number;
static cBondQFSimpleFeatures: number;
static cBondQFNarrowing: number;
static cBondQFBondTypes: number;
static cBondQFRareBondTypes: number;
static cBondQFSingle: number;
static cBondQFDouble: number;
static cBondQFTriple: number;
static cBondQFDelocalized: number;
static cBondQFMetalLigand: number;
static cBondQFQuadruple: number;
static cBondQFQuintuple: number;
static cBondQFRingState: number;
static cBondQFNotRing: number;
static cBondQFRing: number;
static cBondQFBridge: number;
static cBondQFBridgeMin: number;
static cBondQFBridgeSpan: number;
static cBondQFRingSize: number;
static cBondQFMatchStereo: number;
static cBondQFAromState: number;
static cBondQFAromatic: number;
static cBondQFNotAromatic: number;
static cBondQFMatchFormalOrder: number;
static cHelperAll: number;
static cHelperNone: number;
static cHelperBitNeighbours: number;
static cHelperBitRingsSimple: number;
static cHelperBitRings: number;
static cHelperBitParities: number;
static cHelperBitCIP: number;
static cHelperBitSymmetrySimple: number;
static cHelperBitSymmetryStereoHeterotopicity: number;
static cHelperBitIncludeNitrogenParities: number;
static cHelperBitsStereo: number;
static cHelperNeighbours: number;
static cHelperRingsSimple: number;
static cHelperRings: number;
static cHelperParities: number;
static cHelperCIP: number;
static cHelperSymmetrySimple: number;
static cHelperSymmetryStereoHeterotopicity: number;
static cChiralityIsomerCountMask: number;
static cChiralityUnknown: number;
static cChiralityNotChiral: number;
static cChiralityMeso: number;
static cChiralityRacemic: number;
static cChiralityKnownEnantiomer: number;
static cChiralityUnknownEnantiomer: number;
static cChiralityEpimers: number;
static cChiralityDiastereomers: number;
static cDefaultAVBL: number;
static cMoleculeColorDefault: number;
static cMoleculeColorNeutral: number;
static cPseudoAtomsHydrogenIsotops: number;
static cPseudoAtomsRGroups: number;
static cPseudoAtomsAGroups: number;
static cPseudoAtomR: number;
static cPseudoAtomA: number;
static cPseudoAtomX: number;
static cPseudoAtomsAminoAcids: number;
static cPseudoAtomPolymer: number;
static cPseudoAtomAttachmentPoint: number;
static cPseudoAtomsAll: number;
static cDefaultAllowedPseudoAtoms: number;
static cAtomLabel: string[];
static cRoundedMass: number[];
static cDefaultAtomValence: number;
static cAtomValence: number[][];
static cCommonOxidationState: number[][];
static FISCHER_PROJECTION_LIMIT: number;
static FISCHER_PROJECTION_RING_LIMIT: number;
static STEREO_ANGLE_LIMIT: number;
static cMaxConnAtoms: number;
static VALIDATION_ERROR_ESR_CENTER_UNKNOWN: string;
static VALIDATION_ERROR_OVER_UNDER_SPECIFIED: string;
static VALIDATION_ERROR_AMBIGUOUS_CONFIGURATION: string;
static VALIDATION_ERRORS_STEREO: string[];
/**
* Parse the provided `smiles` and return a `Molecule`.
* By default, stereo features are parsed, which triggers itself a coordinate
* computation and coordinates are computed again after parsing to guarantee that
* they are always the same.
* If you do not need stereo features and want the fastest parsing, use this method
* with `{noCoordinates: true, noStereo: true}`.
* @param smiles
* @param options
*/
static fromSmiles(
smiles: string,
options?: IMoleculeFromSmilesOptions,
): Molecule;
/**
* Parse the provided `molfile` and return a `Molecule`.
* @param molfile - MDL Molfile string in V2000 or V3000
*/
static fromMolfile(molfile: string): Molecule;
/**
* Parse the provided `molfile` and return an object with `Molecule` and map.
* @param molfile - MDL Molfile string in V2000 or V3000.
*/
static fromMolfileWithAtomMap(molfile: string): {
molecule: Molecule;
map: number[];
};
/**
* Parse the provided `idcode` and return a `Molecule`.
* @param idcode
* @param coordinates
*/
static fromIDCode(idcode: string, coordinates?: string): Molecule;
/**
* Parse the provided `idcode` and return a `Molecule`.
* @param idcode
* @param ensure2DCoordinates - boolean indicating if the 2D coordinates
* should be computed. Default: true.
*/
static fromIDCode(idcode: string, ensure2DCoordinates?: boolean): Molecule;
static getAtomicNoFromLabel(
atomLabel: string,
allowedPseudoAtomGroups?: number,
): number;
static getAngle(x1: number, y1: number, x2: number, y2: number): number;
static getAngleDif(angle1: number, angle2: number): number;
static getDefaultAverageBondLength(): number;
/**
* When the molecule adds a new bond to a new atom or a new ring, then atoms are
* positioned such that the lengths of the new bonds are equal to the average
* length of existing bonds. If there are no existing bonds, then this default
* is used. If the default is not set by this function, then it is 24.
* @param defaultAVBL
*/
static setDefaultAverageBondLength(defaultAVBL: number): void;
static isAtomicNoElectronegative(atomicNo: number): boolean;
static isAtomicNoElectropositive(atomicNo: number): boolean;
/**
* Returns the OCL object.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getOCL(): any;
toSmiles(): string;
toSmarts(): string;
toIsomericSmiles(options?: ISmilesGeneratorOptions): string;
/**
* Returns a MDL Molfile V2000 string.
*/
toMolfile(): string;
/**
* Returns a MDL Molfile V3000 string.
*/
toMolfileV3(): string;
/**
* Returns an SVG string representing the structure in two dimensions.
* @param width
* @param height
* @param id - Id attribute of the resulting svg element. Defaults to "id"
* followed by an automatically incremented number.
* @param options
*/
toSVG(
width: number,
height: number,
id?: string,
options?: IMoleculeToSVGOptions,
): string;
/**
* Get an ID code for the molecule
* @param flag
*/
getCanonizedIDCode(flag: number): string;
/**
* Returns the canonic numbering of the atoms.
*/
getFinalRanks(flag: number): number[];
/**
* Returns an object with both the ID code and coordinates of the molecule.
*/
getIDCodeAndCoordinates(): { idCode: string; coordinates: string };
getMolecularFormula(): MolecularFormula;
/**
* Returns the `int[]` index array that can be used for substructure search.
*/
getIndex(): number[];
/**
* Compute and set atom coordinates for this molecule.
*/
inventCoordinates(): void;
/**
* Expand and find a position for all the hydrogens of the 2D molecule. If
* `atomNumber` is specified, the function only applies for the hydrogens of
* the given atom.
*/
addImplicitHydrogens(atomNumber?: number): void;
/**
* Returns the count of hydrogens in the molecule.
*/
getNumberOfHydrogens(): number;
/**
* Returns the diastereotopic Ids of all the atoms in the molecule.
*/
getDiastereotopicAtomIDs(): string[];
addMissingChirality(esrType?: number): void;
/**
* This function returns an array of HOSE(Hierarchical Organisation of
* Spherical Environments) codes represented as diastereotopic actelion IDs.
* @param options
*/
getHoseCodes(options?: IHoseCodesOptions): string[][];
getRingSet(): RingCollection;
/**
* Returns the rectangle that bounds the molecule.
*/
getBounds(): Rectangle;
addAtom(atomicNo: number): number;
/**
* Suggests either cBondTypeSingle or cBondTypeMetalLigand whatever seems more
* appropriate for a new bond between the two atoms.
* @param atom1
* @param atom2
*/
suggestBondType(atom1: number, atom2: number): number;
/**
* Adds a single or metal bond between the two atoms depending on whether one
* of them is a metal atom.
* @param atom1
* @param atom2
*/
addBond(atom1: number, atom2: number): number;
addOrChangeAtom(
x: number,
y: number,
atomicNo: number,
mass: number,
abnormalValence: number,
radical: number,
customLabel: string,
): boolean;
addOrChangeBond(atm1: number, atm2: number, type: number): number;
addRing(
x: number,
y: number,
ringSize: number,
aromatic: boolean,
bondLength: number,
): boolean;
addRingToAtom(
atom: number,
ringSize: number,
aromatic: boolean,
bondLength: number,
): boolean;
addRingToBond(
bond: number,
ringSize: number,
aromatic: boolean,
bondLength: number,
): boolean;
changeAtom(
atom: number,
atomicNo: number,
mass: number,
abnormalValence: number,
radical: number,
): boolean;
changeAtomCharge(atom: number, positive: boolean): boolean;
changeBond(bnd: number, type: number): boolean;
/**
* Copies all atoms and bonds of mol to the end of this Molecule's atom and bond
* tables. If mol is a fragment then this Molecule's fragment flag is set to
* true and all query features of mol are also copied.
* @param mol
* @returns Atom mapping from original mol to this molecule after incorporation of mol.
*/
addMolecule(mol: Molecule): number[];
/**
* Adds and connects the substituent molecule to the connectionAtom of this molecule.
* Substituent atoms with atomicNo=0 are not copied and considered to represent the connectionAtom.
* Bonds leading to them, however, are copied and connected to the connectionAtom.
* High level function for constructing a molecule.
* @param substituent
* @param connectionAtom
* @return atom mapping from substituent to this molecule after addition of substituent
*/
addSubstituent(substituent: Molecule, connectionAtom: number): number[];
/**
* Copies this molecule including parity settings, if valid. The original
* content of destMol is replaced. Helper arrays are not copied and need to be
* recalculated if needed.
* @param destMol
*/
copyMolecule(destMol: Molecule): void;
/**
* Creates a new atom in destMol and copies all source atom properties including
* atom list, custom label, flags, and mapNo to it.
* @param destMol
* @param sourceAtom
* @param esrGroupOffsetAND - -1 to create new ESR group or destMol ESR group
* count from esrGroupCountAND()
* @param esrGroupOffsetOR - -1 to create new ESR group or destMol ESR group
* count from esrGroupCountOR()
* @returns Index of new atom in destMol.
*/
copyAtom(
destMol: Molecule,
sourceAtom: number,
esrGroupOffsetAND: number,
esrGroupOffsetOR: number,
): number;
/**
*
* @param destMol
* @param sourceBond
* @param esrGroupOffsetAND - -1 to create new ESR group or destMol ESR group
* count from esrGroupCountAND()
* @param esrGroupOffsetOR - -1 to create new ESR group or destMol ESR group
* count from esrGroupCountOR()
*/
copyBond(
destMol: Molecule,
sourceBond: number,
esrGroupOffsetAND: number,
esrGroupOffsetOR: number,
): number;
/**
* Copies name,isFragment,chirality and validity of parity & CIP flags. When
* copying molecules parts only or when changing the atom order during copy,
* then atom parities or CIP parities may not be valid anymore and
* invalidateHelperArrays([affected bits]) should be called in these cases.
* @param destMol
*/
copyMoleculeProperties(destMol: Molecule): void;
/**
* Clears helperBits from mValidHelperArrays.
* @param helperBits
*/
invalidateHelperArrays(helperBits: number): void;
/**
* For the given ESR type (AND or OR) renumbers all group indexes starting from
* 0. Use this, if stereo center deletion or other operations caused an
* inconsisten ESR number state. Molecule and derived methods do this
* automatically.
* @param type - cESRTypeAnd or cESRTypeOr
* @returns number of ESR groups
*/
renumberESRGroups(type: number): number;
/**
* Swaps two atoms' indexes/locations in the atom table.
* @param atom1
* @param atom2
*/
swapAtoms(atom1: number, atom2: number): void;
/**
* Swaps two bonds' indexes/locations in the atom table.
* @param bond1
* @param bond2
*/
swapBonds(bond1: number, bond2: number): void;
/**
* After the deletion the original order of atom and bond indexes is retained.
* @param atom
*/
deleteAtom(atom: number): void;
deleteAtomOrBond(x: number, y: number): boolean;
/**
* After the deletion the original order of atom and bond indexes is retained.
* @param bond
*/
deleteBond(bond: number): void;
/**
* After the deletion the original order of atom and bond indexes is retained.
* @param bond
*/
deleteBondAndSurrounding(bond: number): void;
/**
* After the deletion the original order of atom and bond indexes is retained.
* @param atomList
*/
deleteAtoms(atomList: number[]): number[];
/**
* Delete all selected atoms
* and all bonds attached to them. After the deletion the original order of atom
* and bond indexes is retained.
*/
deleteSelectedAtoms(): boolean;
/**
* Marks this atom to be deleted in a later call to deleteMarkedAtomsAndBonds().
* @param atom
*/
markAtomForDeletion(atom: number): void;
/**
* Marks this bond to be deleted in a later call to deleteMarkedAtomsAndBonds().
* @param bond
*/
markBondForDeletion(bond: number): void;
/**
* Checks whether this atom was marked to be deleted and not deleted yet.
* @param atom
*/
isAtomMarkedForDeletion(atom: number): boolean;
/**
* Checks whether this bond was marked to be deleted and not deleted yet.
* @param bond
*/
isBondMarkedForDeletion(bond: number): boolean;
/**
* Deletes all atoms and bonds
* from the molecule, which were marked before for deletion by calling
* markAtomForDeletion() or markBondForDeletion(). Bonds connecting atoms of
* which at least one is marked for deletion, are deleted automatically and
* don't require to be explicitly marked.<br>
* When multiple atoms and/or bonds need to be deleted, marking them and calling
* this method is more efficient than deleting them individually with
* deleteAtom() and deleteBond(). Bonds, whose atoms carry opposite charges are
* treated in the following manner: If only one of the two bond atoms is kept,
* then its absolute charge will be reduced by 1. After the deletion the
* original order of atom and bond indexes is retained.
* @returns mapping from old to new atom indices; null if no atoms nor bonds were deleted.
*/
deleteMarkedAtomsAndBonds(): number[];
/**
* @deprecated Use clear() instead of this method.
*/
deleteMolecule(): void;
/**
* Empties the molecule to serve as container for constructing a new molecule,
* e.g. by multiply calling addAtom(...), addBond(...) and other high level methods.
*/
clear(): void;
removeAtomSelection(): void;
removeAtomColors(): void;
removeAtomCustomLabels(): void;
removeAtomMarkers(): void;
removeBondHiliting(): void;
/**
*
* @param pickx
* @param picky
* @returns index of closest of nearby atoms or -1, if no atom is close.
*/
findAtom(pickx: number, picky: number): number;
/**
*
* @param pickx
* @param picky
* @returns index of closest of nearby bonds or -1, if no bond is close.
*/
findBond(pickx: number, picky: number): number;
/**
* @returns the number of all atoms, which includes hydrogen atoms.
*/
getAllAtoms(): number;
/**
* @returns the number of all bonds, which includes those connecting hydrogen atoms.
*/
getAllBonds(): number;
/**
* Get an atom's defined maximum valance if different from the default one.
* @param atom
* @returns valence 0-14: new maximum valence; -1: use default
*/
getAtomAbnormalValence(atom: number): number;
/**
*
* @param atom
* @returns The formal atom charge.
*/
getAtomCharge(atom: number): number;
/**
* The atom Cahn-Ingold-Prelog parity is a calculated property available
* above/equal helper level cHelperCIP. It encodes the stereo configuration of
* an atom with its neighbors using up/down-bonds or 3D-atom-coordinates,
* whatever is available. It depends on the atom indices of the neighbor atoms
* and their orientation is space. This method is called by the Canonizer and
* usually should not be called otherwise.
* @param atom
* @returns one of
* cAtomCIPParityNone,cAtomCIPParityRorM,cAtomCIPParitySorP,cAtomCIPParityProblem
*/
getAtomCIPParity(atom: number): number;
getAtomColor(atom: number): number;
/**
* This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds
* with the same ESR type (AND or OR) and the same ESR group number are in the
* same group, i.e. within this group they have the defined (relative) stereo
* configuration.
* @param atom
* @returns group index starting with 0
*/
getAtomESRGroup(atom: number): number;
/**
* This is MDL's enhanced stereo representation (ESR). Stereo atoms and bonds
* with the same ESR type (AND or OR) and the same ESR group number are in the
* same group, i.e. within this group they have the defined (relative) stereo
* configuration.
* @param atom
* @returns one of cESRTypeAbs,cESRTypeAnd,cESRTypeOr
*/
getAtomESRType(atom: number): number;
/**
* In addition to the natural atomic numbers, we support additional pseudo
* atomic numbers. Most of these are for compatibility with the MDL atom table,
* e.g. for amino acids and R-groups. D and T are accepted for setting, but are
* on-the-fly translated to H with the proper atom mass.
* @param atom
*/
getAtomicNo(atom: number): number;
/**
* If a custom atom label is set, a molecule depiction displays the custom label
* instead of the original one.
* @param atom
* @returns null or previously defined atom custom label
*/
getAtomCustomLabel(atom: number): string;
/**
*
* @param atom
* @returns standard atom label of the atom: C,Li,Sc,...
*/
getAtomLabel(atom: number): string;
/**
* Get the atomic query features as an object
* @param atom
*/
getAtomQueryFeaturesObject(atom: number): AtomQueryFeatures;
/**
* Get the bond query features as an object
* @param bond
*/
getBondQueryFeaturesObject(bond: number): BondQueryFeatures;
/**
* The list of atoms that are allowed at this position during sub-structure
* search. (or refused atoms, if atom query feature cAtomQFAny is set).
* @param atom
* @returns null or sorted list of unique atomic numbers, if defined.
*/
getAtomList(atom: number): number[];
getAtomListString(atom: number): string;
/**
* Returns an atom mapping number within the context of a reaction. Atoms that
* that share the same mapping number on the reactant and product side are
* considered to be the same atom.
* @param atom
*/
getAtomMapNo(atom: number): number;
/**
*
* @param atom
* @returns atom mass, if is specific isotop, otherwise 0 for natural abundance
*/
getAtomMass(atom: number): number;
/**
* The atom parity is a calculated property available above/equal helper level
* cHelperParities. It describes the stereo configuration of a chiral atom and
* is calculated either from 2D-atom-coordinates and up/down-bonds or from