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

openchemlib-utils

Package Overview
Dependencies
Maintainers
8
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 0.5.0 to 0.5.1

9

History.md

@@ -0,1 +1,10 @@

## [0.5.1](https://github.com/cheminfo/openchemlib-utils/compare/v0.5.0...v0.5.1) (2020-09-09)
### Bug Fixes
* allow to call initOCL multiple times with the same OCL ([843a4c6](https://github.com/cheminfo/openchemlib-utils/commit/843a4c6fd9c24dbcef61769f6fa4cf3e0bc0cbd0))
# [0.5.0](https://github.com/cheminfo/openchemlib-utils/compare/v0.4.0...v0.5.0) (2020-06-28)

@@ -2,0 +11,0 @@

29

lib/index.js

@@ -5,8 +5,11 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var floydWarshall = _interopDefault(require('ml-floyd-warshall'));
var floydWarshall = require('ml-floyd-warshall');
var mlMatrix = require('ml-matrix');
var atomSorter = _interopDefault(require('atom-sorter'));
var atomSorter = require('atom-sorter');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var floydWarshall__default = /*#__PURE__*/_interopDefaultLegacy(floydWarshall);
var atomSorter__default = /*#__PURE__*/_interopDefaultLegacy(atomSorter);
let OCL;

@@ -22,4 +25,4 @@

function initOCL(newOCL) {
if (OCL) {
throw new Error('OCL-utils was already initialized with OCL');
if (OCL && OCL !== newOCL) {
throw new Error('OCL-utils was already initialized with a different OCL');
}

@@ -200,3 +203,3 @@ OCL = newOCL;

let hydrogenInfo = {};
getDiastereotopicAtomIDsAndH(molecule).forEach(function(line) {
getDiastereotopicAtomIDsAndH(molecule).forEach(function (line) {
hydrogenInfo[line.oclID] = line;

@@ -210,3 +213,3 @@ });

let groupedDiaIDs = molecule.getGroupedDiastereotopicAtomIDs();
groupedDiaIDs.forEach(function(diaID) {
groupedDiaIDs.forEach(function (diaID) {
if (

@@ -229,3 +232,3 @@ hydrogenInfo[diaID.oclID] &&

svg = svg.replace(/Atom:[0-9]+"/g, function(value) {
svg = svg.replace(/Atom:[0-9]+"/g, function (value) {
let atom = value.replace(/[^0-9]/g, '');

@@ -419,3 +422,3 @@ return `${value} data-diaid="${diaIDs[atom].join(',')}"`;

// TODO: seems like a very slow approach
diaIDs.forEach(function(diaID) {
diaIDs.forEach(function (diaID) {
const hoses = getHoseCodesFromDiastereotopicID(diaID.oclID, options);

@@ -610,3 +613,3 @@ diaID.hoses = [];

if (options.pathLength) {
result = floydWarshall(new mlMatrix.Matrix(result)).to2DArray();
result = floydWarshall__default['default'](new mlMatrix.Matrix(result)).to2DArray();
}

@@ -628,3 +631,3 @@ return result;

entries.forEach(function(entry) {
entries.forEach(function (entry) {
let mf = getFragmentMF(entry, allAtoms);

@@ -688,3 +691,3 @@ parts.push(mf);

let mf = '';
let keys = Object.keys(mfs).sort(atomSorter);
let keys = Object.keys(mfs).sort(atomSorter__default['default']);
for (let key of keys) {

@@ -691,0 +694,0 @@ mf += key;

{
"name": "openchemlib-utils",
"version": "0.5.0",
"version": "0.5.1",
"description": "",

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

"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
"cheminfo-build": "^1.0.5",
"eslint": "^6.8.0",
"eslint-config-cheminfo": "^2.0.4",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.7.0",
"eslint-plugin-prettier": "^3.1.2",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"cheminfo-build": "^1.1.4",
"eslint": "^7.8.1",
"eslint-config-cheminfo": "^5.1.3",
"esm": "^3.2.25",
"jest": "^25.1.0",
"jest": "^26.4.2",
"openchemlib": "^7.2.3",
"prettier": "^1.19.1",
"rollup": "^1.31.0"
"prettier": "^2.1.1",
"rollup": "^2.26.11"
},
"dependencies": {
"atom-sorter": "^0.12.0",
"atom-sorter": "^1.1.5",
"ml-floyd-warshall": "^1.0.3",
"ml-matrix": "^6.4.1"
"ml-matrix": "^6.5.1"
}
}

@@ -0,0 +0,0 @@ # openchemlib-utils

import OCL from 'openchemlib';
import { initOCL } from '../../OCL';
import { addDiastereotopicMissingChirality } from '../addDiastereotopicMissingChirality';
import { initOCL } from '../../OCL';

@@ -6,0 +6,0 @@ initOCL(OCL);

import OCL from 'openchemlib';
import { initOCL } from '../../OCL';
import { getDiastereotopicAtomIDs } from '../getDiastereotopicAtomIDs';
import { initOCL } from '../../OCL';

@@ -6,0 +6,0 @@ initOCL(OCL);

import OCL from 'openchemlib';
import { initOCL } from '../../OCL';
import { getDiastereotopicAtomIDsAndH } from '../getDiastereotopicAtomIDsAndH';
import { initOCL } from '../../OCL';

@@ -6,0 +6,0 @@ initOCL(OCL);

import OCL from 'openchemlib';
import { initOCL } from '../../OCL';
import { getGroupedDiastereotopicAtomIDs } from '../getGroupedDiastereotopicAtomIDs';
import { initOCL } from '../../OCL';

@@ -6,0 +6,0 @@ initOCL(OCL);

import OCL from 'openchemlib';
import { initOCL } from '../../OCL';
import { toDiastereotopicSVG } from '../toDiastereotopicSVG';
import { initOCL } from '../../OCL';

@@ -6,0 +6,0 @@ initOCL(OCL);

@@ -0,3 +1,3 @@

import { getOCL } from '../OCL';
import { tagAtom } from '../util/tagAtom';
import { getOCL } from '../OCL';

@@ -4,0 +4,0 @@ /**

@@ -0,4 +1,4 @@

import { getOCL } from '../OCL';
import { makeRacemic } from '../util/makeRacemic';
import { tagAtom } from '../util/tagAtom';
import { makeRacemic } from '../util/makeRacemic';
import { getOCL } from '../OCL';

@@ -5,0 +5,0 @@ import { addDiastereotopicMissingChirality } from './addDiastereotopicMissingChirality';

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

@@ -0,0 +0,0 @@ import { getDiastereotopicAtomIDs } from './getDiastereotopicAtomIDs';

@@ -19,3 +19,3 @@ import { getDiastereotopicAtomIDsAndH } from './getDiastereotopicAtomIDsAndH';

let hydrogenInfo = {};
getDiastereotopicAtomIDsAndH(molecule).forEach(function(line) {
getDiastereotopicAtomIDsAndH(molecule).forEach(function (line) {
hydrogenInfo[line.oclID] = line;

@@ -29,3 +29,3 @@ });

let groupedDiaIDs = molecule.getGroupedDiastereotopicAtomIDs();
groupedDiaIDs.forEach(function(diaID) {
groupedDiaIDs.forEach(function (diaID) {
if (

@@ -48,3 +48,3 @@ hydrogenInfo[diaID.oclID] &&

svg = svg.replace(/Atom:[0-9]+"/g, function(value) {
svg = svg.replace(/Atom:[0-9]+"/g, function (value) {
let atom = value.replace(/[^0-9]/g, '');

@@ -51,0 +51,0 @@ return `${value} data-diaid="${diaIDs[atom].join(',')}"`;

@@ -16,3 +16,3 @@ import { getDiastereotopicAtomIDs } from '../diastereotopic/getDiastereotopicAtomIDs';

// TODO: seems like a very slow approach
diaIDs.forEach(function(diaID) {
diaIDs.forEach(function (diaID) {
const hoses = getHoseCodesFromDiastereotopicID(diaID.oclID, options);

@@ -19,0 +19,0 @@ diaID.hoses = [];

import { getOCL } from '../OCL';
import { tagAtom } from '../util/tagAtom';
import { isCsp3 } from '../util/isCsp3';
import { makeRacemic } from '../util/makeRacemic';
import { tagAtom } from '../util/tagAtom';

@@ -6,0 +6,0 @@ export const FULL_HOSE_CODE = 1;

@@ -1,4 +0,4 @@

import { tagAtom } from '../util/tagAtom';
import { getOCL } from '../OCL';
import { makeRacemic } from '../util/makeRacemic';
import { tagAtom } from '../util/tagAtom';

@@ -5,0 +5,0 @@ let fragment;

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

@@ -0,0 +0,0 @@ export * from './diastereotopic/addDiastereotopicMissingChirality';

@@ -11,6 +11,6 @@ let OCL;

export function initOCL(newOCL) {
if (OCL) {
throw new Error('OCL-utils was already initialized with OCL');
if (OCL && OCL !== newOCL) {
throw new Error('OCL-utils was already initialized with a different OCL');
}
OCL = newOCL;
}

@@ -1,5 +0,5 @@

import { getConnectivityMatrix } from '../util/getConnectivityMatrix';
import { getAtomsInfo } from '../util/getAtomsInfo';
import { getOCL } from '../OCL';
import { getHoseCodesForPath } from '../hose/getHoseCodesForPath';
import { getAtomsInfo } from '../util/getAtomsInfo';
import { getConnectivityMatrix } from '../util/getConnectivityMatrix';

@@ -6,0 +6,0 @@ let fragment;

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

@@ -0,0 +0,0 @@ import floydWarshall from 'ml-floyd-warshall';

@@ -15,3 +15,3 @@ import atomSorter from 'atom-sorter';

entries.forEach(function(entry) {
entries.forEach(function (entry) {
let mf = getFragmentMF(entry, allAtoms);

@@ -18,0 +18,0 @@ parts.push(mf);

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

@@ -0,0 +0,0 @@ import { getOCL } from '../OCL';

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