openchemlib-utils
Advanced tools
Comparing version 1.5.1 to 1.6.0
# Changelog | ||
## [1.6.0](https://www.github.com/cheminfo/openchemlib-utils/compare/v1.5.1...v1.6.0) (2021-10-14) | ||
### Features | ||
* update dependencies ([00bae71](https://www.github.com/cheminfo/openchemlib-utils/commit/00bae71d7648362256eaefb4eb20525afe94e31b)) | ||
### [1.5.1](https://www.github.com/cheminfo/openchemlib-utils/compare/v1.5.0...v1.5.1) (2021-08-29) | ||
@@ -4,0 +11,0 @@ |
@@ -17,3 +17,2 @@ 'use strict'; | ||
var Papa__default = /*#__PURE__*/_interopDefaultLegacy(Papa); | ||
var sdfParser__default = /*#__PURE__*/_interopDefaultLegacy(sdfParser); | ||
@@ -191,3 +190,3 @@ let xAtomicNumber = 0; | ||
let hydrogenInfo = {}; | ||
getDiastereotopicAtomIDsAndH(molecule).forEach(function (line) { | ||
getDiastereotopicAtomIDsAndH(molecule).forEach((line) => { | ||
hydrogenInfo[line.oclID] = line; | ||
@@ -201,3 +200,3 @@ }); | ||
let groupedDiaIDs = molecule.getGroupedDiastereotopicAtomIDs(); | ||
groupedDiaIDs.forEach(function (diaID) { | ||
groupedDiaIDs.forEach((diaID) => { | ||
if ( | ||
@@ -220,3 +219,3 @@ hydrogenInfo[diaID.oclID] && | ||
svg = svg.replace(/Atom:[0-9]+"/g, function (value) { | ||
svg = svg.replace(/Atom:[0-9]+"/g, (value) => { | ||
let atom = value.replace(/[^0-9]/g, ''); | ||
@@ -406,3 +405,3 @@ return `${value} data-diaid="${diaIDs[atom].join(',')}"`; | ||
// TODO: seems like a very slow approach | ||
diaIDs.forEach(function (diaID) { | ||
diaIDs.forEach((diaID) => { | ||
const hoses = getHoseCodesFromDiastereotopicID( | ||
@@ -767,3 +766,3 @@ OCL.Molecule.fromIDCode(diaID.oclID), | ||
if (options.pathLength) { | ||
result = floydWarshall__default['default'](new mlMatrix.Matrix(result)).to2DArray(); | ||
result = floydWarshall__default["default"](new mlMatrix.Matrix(result)).to2DArray(); | ||
} | ||
@@ -785,3 +784,3 @@ return result; | ||
entries.forEach(function (entry) { | ||
entries.forEach((entry) => { | ||
let mf = getFragmentMF(entry, allAtoms); | ||
@@ -845,3 +844,3 @@ parts.push(mf); | ||
let mf = ''; | ||
let keys = Object.keys(mfs).sort(atomSorter__default['default']); | ||
let keys = Object.keys(mfs).sort(atomSorter__default["default"]); | ||
for (let key of keys) { | ||
@@ -1076,3 +1075,3 @@ mf += key; | ||
function getMoleculeCreators (Molecule) { | ||
function getMoleculeCreators(Molecule) { | ||
const fields = new Map(); | ||
@@ -1104,3 +1103,3 @@ | ||
const parsed = Papa__default['default'].parse(csv, options); | ||
const parsed = Papa__default["default"].parse(csv, options); | ||
const fields = parsed.meta.fields; | ||
@@ -1219,3 +1218,3 @@ const stats = new Array(fields.length); | ||
} | ||
const parsed = sdfParser__default['default'](sdf); | ||
const parsed = sdfParser.parse(sdf); | ||
moleculesDB.statistics = parsed.statistics; | ||
@@ -1404,3 +1403,3 @@ for (let i = 0; i < parsed.molecules.length; i++) { | ||
searchResult.sort(function (a, b) { | ||
searchResult.sort((a, b) => { | ||
return ( | ||
@@ -1440,3 +1439,3 @@ Math.abs(queryMW - a.properties.mw) - Math.abs(queryMW - b.properties.mw) | ||
} | ||
searchResult.sort(function (a, b) { | ||
searchResult.sort((a, b) => { | ||
return b.similarity - a.similarity; | ||
@@ -1709,3 +1708,3 @@ }); | ||
result.atomMap = []; | ||
let includeAtom = fragmentMap.map(function (id) { | ||
let includeAtom = fragmentMap.map((id) => { | ||
return id === i; | ||
@@ -1712,0 +1711,0 @@ }); |
{ | ||
"name": "openchemlib-utils", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Various utilities that extends openchemlib-js like HOSE codes or diastereotopic IDs", | ||
@@ -42,19 +42,20 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.14.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.15.4", | ||
"cheminfo-build": "^1.1.11", | ||
"eslint": "^7.32.0", | ||
"eslint-config-cheminfo": "^5.2.4", | ||
"eslint-config-cheminfo": "^5.6.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
"esm": "^3.2.25", | ||
"jest": "^27.0.6", | ||
"jest": "^27.2.5", | ||
"openchemlib": "7.4.0", | ||
"prettier": "^2.3.2", | ||
"rollup": "^2.55.1" | ||
"prettier": "^2.4.1", | ||
"rollup": "^2.58.0" | ||
}, | ||
"dependencies": { | ||
"atom-sorter": "^1.1.9", | ||
"ensure-string": "^1.0.0", | ||
"ensure-string": "^1.1.0", | ||
"ml-floyd-warshall": "^1.0.3", | ||
"ml-matrix": "^6.8.0", | ||
"papaparse": "^5.3.1", | ||
"sdf-parser": "^4.0.2" | ||
"sdf-parser": "^5.0.0" | ||
}, | ||
@@ -61,0 +62,0 @@ "peerDependencies": { |
import { ensureString } from 'ensure-string'; | ||
import sdfParser from 'sdf-parser'; | ||
import { parse } from 'sdf-parser'; | ||
@@ -10,3 +10,3 @@ export default async function appendSDF(moleculesDB, sdf, options = {}) { | ||
} | ||
const parsed = sdfParser(sdf); | ||
const parsed = parse(sdf); | ||
moleculesDB.statistics = parsed.statistics; | ||
@@ -13,0 +13,0 @@ for (let i = 0; i < parsed.molecules.length; i++) { |
@@ -1,2 +0,2 @@ | ||
export default function (Molecule) { | ||
export default function getMoleculeCreators(Molecule) { | ||
const fields = new Map(); | ||
@@ -3,0 +3,0 @@ |
@@ -71,3 +71,3 @@ import getMoleculeCreators from './getMoleculeCreators'; | ||
searchResult.sort(function (a, b) { | ||
searchResult.sort((a, b) => { | ||
return ( | ||
@@ -107,3 +107,3 @@ Math.abs(queryMW - a.properties.mw) - Math.abs(queryMW - b.properties.mw) | ||
} | ||
searchResult.sort(function (a, b) { | ||
searchResult.sort((a, b) => { | ||
return b.similarity - a.similarity; | ||
@@ -110,0 +110,0 @@ }); |
@@ -19,3 +19,3 @@ import { getDiastereotopicAtomIDsAndH } from './getDiastereotopicAtomIDsAndH'; | ||
let hydrogenInfo = {}; | ||
getDiastereotopicAtomIDsAndH(molecule).forEach(function (line) { | ||
getDiastereotopicAtomIDsAndH(molecule).forEach((line) => { | ||
hydrogenInfo[line.oclID] = line; | ||
@@ -29,3 +29,3 @@ }); | ||
let groupedDiaIDs = molecule.getGroupedDiastereotopicAtomIDs(); | ||
groupedDiaIDs.forEach(function (diaID) { | ||
groupedDiaIDs.forEach((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, (value) => { | ||
let atom = value.replace(/[^0-9]/g, ''); | ||
@@ -51,0 +51,0 @@ return `${value} data-diaid="${diaIDs[atom].join(',')}"`; |
@@ -47,3 +47,3 @@ import { getMF } from '../util/getMF'; | ||
result.atomMap = []; | ||
let includeAtom = fragmentMap.map(function (id) { | ||
let includeAtom = fragmentMap.map((id) => { | ||
return id === i; | ||
@@ -50,0 +50,0 @@ }); |
@@ -17,3 +17,3 @@ import { getDiastereotopicAtomIDs } from '../diastereotopic/getDiastereotopicAtomIDs'; | ||
// TODO: seems like a very slow approach | ||
diaIDs.forEach(function (diaID) { | ||
diaIDs.forEach((diaID) => { | ||
const hoses = getHoseCodesFromDiastereotopicID( | ||
@@ -20,0 +20,0 @@ OCL.Molecule.fromIDCode(diaID.oclID), |
@@ -15,3 +15,3 @@ import atomSorter from 'atom-sorter'; | ||
entries.forEach(function (entry) { | ||
entries.forEach((entry) => { | ||
let mf = getFragmentMF(entry, allAtoms); | ||
@@ -18,0 +18,0 @@ parts.push(mf); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121966
10
3304
+ Addedsdf-parser@5.0.2(transitive)
+ Addedsplit2@4.2.0(transitive)
- Removedsdf-parser@4.0.2(transitive)
- Removedsplit2@3.2.2(transitive)
- Removedthrough2@3.0.2(transitive)
Updatedensure-string@^1.1.0
Updatedsdf-parser@^5.0.0