openchemlib 9.9.0 → 9.10.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.
- package/dist/openchemlib.d.ts +5 -0
- package/dist/openchemlib.debug.js +20 -6
- package/dist/openchemlib.js +11 -11
- package/package.json +1 -1
package/dist/openchemlib.d.ts
CHANGED
|
@@ -67,6 +67,11 @@ interface ToMolfileOptions {
|
|
|
67
67
|
* @default undefined
|
|
68
68
|
*/
|
|
69
69
|
customLabelPosition?: 'normal' | 'superscript' | 'auto' | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Remove custom atom labels
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
removeCustomAtomLabels?: boolean;
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
export interface AtomQueryFeatures {
|
|
@@ -1369,6 +1369,14 @@ function extendFromMolfile(Molecule2) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
1371
|
// lib/extend/extendToMolfile.js
|
|
1372
|
+
var CUSTOM_ATOMS_LABELS_TAGS = [
|
|
1373
|
+
"M STY",
|
|
1374
|
+
"M SLB",
|
|
1375
|
+
"M SAL",
|
|
1376
|
+
"M SDT",
|
|
1377
|
+
"M SDD",
|
|
1378
|
+
"M SED"
|
|
1379
|
+
];
|
|
1372
1380
|
function extendToMolfile(Molecule2) {
|
|
1373
1381
|
const _toMolfile = Molecule2.prototype.toMolfile;
|
|
1374
1382
|
Molecule2.prototype.toMolfile = function toMolfile(options = {}) {
|
|
@@ -1376,14 +1384,20 @@ function extendToMolfile(Molecule2) {
|
|
|
1376
1384
|
const {
|
|
1377
1385
|
includeCustomAtomLabelsAsALines = false,
|
|
1378
1386
|
includeCustomAtomLabelsAsVLines = false,
|
|
1379
|
-
customLabelPosition
|
|
1387
|
+
customLabelPosition,
|
|
1388
|
+
removeCustomAtomLabels = false
|
|
1380
1389
|
} = options;
|
|
1381
1390
|
changeMolfileCustomLabelPosition(molecule, customLabelPosition);
|
|
1382
1391
|
const molfile = _toMolfile.call(this);
|
|
1383
|
-
if (!includeCustomAtomLabelsAsALines && !includeCustomAtomLabelsAsVLines) {
|
|
1392
|
+
if (!includeCustomAtomLabelsAsALines && !includeCustomAtomLabelsAsVLines && !removeCustomAtomLabels) {
|
|
1384
1393
|
return molfile;
|
|
1385
1394
|
}
|
|
1386
|
-
|
|
1395
|
+
let lines = molfile.split("\n");
|
|
1396
|
+
if (removeCustomAtomLabels) {
|
|
1397
|
+
lines = lines.filter(
|
|
1398
|
+
(line) => !CUSTOM_ATOMS_LABELS_TAGS.some((tag) => line.startsWith(tag))
|
|
1399
|
+
);
|
|
1400
|
+
}
|
|
1387
1401
|
if (lines.length < 4 || !lines[3].includes("V2000")) {
|
|
1388
1402
|
return molfile;
|
|
1389
1403
|
}
|
|
@@ -71143,7 +71157,7 @@ function getExports($wnd) {
|
|
|
71143
71157
|
$sendStats("moduleStartup", "end");
|
|
71144
71158
|
$gwt && $gwt.permProps && __gwtModuleFunction.__moduleStartupDone($gwt.permProps);
|
|
71145
71159
|
const toReturn = $wnd["OCL"];
|
|
71146
|
-
toReturn.version = "9.
|
|
71160
|
+
toReturn.version = "9.10.0";
|
|
71147
71161
|
return toReturn;
|
|
71148
71162
|
}
|
|
71149
71163
|
var isBrowserWindow = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
@@ -71287,8 +71301,8 @@ export {
|
|
|
71287
71301
|
};
|
|
71288
71302
|
/**
|
|
71289
71303
|
* openchemlib - Manipulate molecules
|
|
71290
|
-
* @version v9.
|
|
71291
|
-
* @date 2025-10-
|
|
71304
|
+
* @version v9.10.0
|
|
71305
|
+
* @date 2025-10-08T14:06:44.519Z
|
|
71292
71306
|
* @link https://github.com/cheminfo/openchemlib-js
|
|
71293
71307
|
* @license BSD-3-Clause
|
|
71294
71308
|
*/
|