Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openchemlib-utils

Package Overview
Dependencies
Maintainers
4
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openchemlib-utils - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

src/features/getAtomFeatures.js

59

lib/index.js

@@ -1904,2 +1904,60 @@ 'use strict';

function getAtomFeatures(originalMolecule) {
const OCL = originalMolecule.getOCL();
let sphere = 1;
let fragment = new OCL.Molecule(0, 0);
let results = [];
for (
let rootAtom = 0;
rootAtom < originalMolecule.getAllAtoms();
rootAtom++
) {
let min = 0;
let max = 0;
let atomMask = new Array(originalMolecule.getAtoms());
let atomList = new Array(originalMolecule.getAtoms());
const molecule = originalMolecule.getCompactCopy();
for (let currentSphere = 0; currentSphere <= sphere; currentSphere++) {
if (max === 0) {
atomList[max] = rootAtom;
atomMask[rootAtom] = true;
max++;
} else {
let newMax = max;
for (let i = min; i < max; i++) {
let atom = atomList[i];
for (let j = 0; j < molecule.getAllConnAtoms(atom); j++) {
let connAtom = molecule.getConnAtom(atom, j);
if (!atomMask[connAtom]) {
atomMask[connAtom] = true;
atomList[newMax++] = connAtom;
}
}
}
min = max;
max = newMax;
}
molecule.copyMoleculeByAtoms(fragment, atomMask, true, null);
if (currentSphere === sphere) {
makeRacemic(fragment);
results.push(fragment.getCanonizedIDCode());
}
}
}
const atoms = {};
for (let result of results) {
if (!atoms[result]) {
atoms[result] = 1;
} else {
atoms[result]++;
}
}
return atoms;
}
function toVisualizerMolfile(molecule, options = {}) {

@@ -2025,2 +2083,3 @@ const { diastereotopic, heavyAtomHydrogen } = options;

exports.fragmentAcyclicSingleBonds = fragmentAcyclicSingleBonds;
exports.getAtomFeatures = getAtomFeatures;
exports.getAtomsInfo = getAtomsInfo;

@@ -2027,0 +2086,0 @@ exports.getConnectivityMatrix = getConnectivityMatrix;

30

package.json
{
"name": "openchemlib-utils",
"version": "1.10.0",
"version": "1.11.0",
"description": "Various utilities that extends openchemlib-js like HOSE codes or diastereotopic IDs",

@@ -42,22 +42,22 @@ "main": "lib/index.js",

"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
"@types/jest": "^27.4.0",
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
"@types/jest": "^27.4.1",
"cheminfo-build": "^1.1.11",
"eslint": "^8.8.0",
"eslint-config-cheminfo": "^7.2.2",
"eslint-plugin-import": "^2.25.4",
"eslint": "^8.13.0",
"eslint-config-cheminfo": "^7.3.0",
"eslint-plugin-import": "^2.26.0",
"esm": "^3.2.25",
"jest": "^27.5.0",
"jest": "^27.5.1",
"jest-matcher-deep-close-to": "^3.0.2",
"openchemlib": "7.4.0",
"prettier": "^2.5.1",
"rollup": "^2.67.1"
"prettier": "^2.6.2",
"rollup": "^2.70.2"
},
"dependencies": {
"atom-sorter": "^1.1.9",
"ensure-string": "^1.1.0",
"ml-floyd-warshall": "^1.0.3",
"ml-matrix": "^6.8.2",
"papaparse": "^5.3.1",
"sdf-parser": "^5.0.0"
"atom-sorter": "^1.1.10",
"ensure-string": "^1.2.0",
"ml-floyd-warshall": "^1.0.4",
"ml-matrix": "^6.9.0",
"papaparse": "^5.3.2",
"sdf-parser": "^5.0.1"
},

@@ -64,0 +64,0 @@ "peerDependencies": {

@@ -32,4 +32,6 @@ export * from './diastereotopic/addDiastereotopicMissingChirality';

export * from './features/getAtomFeatures';
export * from './misc/toVisualizerMolfile';
export * from './fragment/fragmentAcyclicSingleBonds';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc