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

openchemlib-utils

Package Overview
Dependencies
Maintainers
6
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.2.1 to 0.3.0

10

History.md

@@ -0,1 +1,11 @@

# [0.3.0](https://github.com/cheminfo/openchemlib-utils/compare/v0.2.1...v0.3.0) (2020-02-21)
### Features
* add negative atomicNo option ([44f812f](https://github.com/cheminfo/openchemlib-utils/commit/44f812fbd237240592f89485e4f39e655af6281b))
* add sdta for getConnectivityMatrix ([9fe9640](https://github.com/cheminfo/openchemlib-utils/commit/9fe9640f4e5ab23e2f5837249eff528a2da8bdd6))
## 0.0.1 (2020-01-21)

@@ -2,0 +12,0 @@

@@ -504,3 +504,5 @@ 'use strict';

* @param {boolean} [options.atomicNo=false] set the atomic number of the atom on diagonal
* @param {boolean} [options.negativeAtomicNo=false] set the atomic number * -1 of the atom on diagonal
* @param {boolean} [options.sdt=false] set 1, 2 or 3 depending if single, double or triple bond
* @param {boolean} [options.sdta=false] set 1, 2, 3 or 4 depending if single, double, triple or aromatic bond
*/

@@ -520,2 +522,6 @@ function getConnectivityMatrix(molecule, options = {}) {

}
} else if (options.negativeAtomicNo) {
for (let i = 0; i < nbAtoms; i++) {
result[i][i] = -molecule.getAtomicNo(i);
}
} else if (options.mass) {

@@ -539,2 +545,17 @@ for (let i = 0; i < nbAtoms; i++) {

}
} else if (options.sdta) {
for (let i = 0; i < nbAtoms; i++) {
let l = molecule.getAllConnAtoms(i);
for (let j = 0; j < l; j++) {
let bondNumber = molecule.getConnBond(i, j);
if (molecule.isAromaticBond(bondNumber)) {
result[i][molecule.getConnAtom(i, j)] = 4;
} else {
result[i][molecule.getConnAtom(i, j)] = molecule.getConnBondOrder(
i,
j,
);
}
}
}
} else {

@@ -541,0 +562,0 @@ for (let i = 0; i < nbAtoms; i++) {

2

package.json
{
"name": "openchemlib-utils",
"version": "0.2.1",
"version": "0.3.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -13,3 +13,5 @@ import floydWarshall from 'ml-floyd-warshall';

* @param {boolean} [options.atomicNo=false] set the atomic number of the atom on diagonal
* @param {boolean} [options.negativeAtomicNo=false] set the atomic number * -1 of the atom on diagonal
* @param {boolean} [options.sdt=false] set 1, 2 or 3 depending if single, double or triple bond
* @param {boolean} [options.sdta=false] set 1, 2, 3 or 4 depending if single, double, triple or aromatic bond
*/

@@ -29,2 +31,6 @@ export function getConnectivityMatrix(molecule, options = {}) {

}
} else if (options.negativeAtomicNo) {
for (let i = 0; i < nbAtoms; i++) {
result[i][i] = -molecule.getAtomicNo(i);
}
} else if (options.mass) {

@@ -48,2 +54,17 @@ for (let i = 0; i < nbAtoms; i++) {

}
} else if (options.sdta) {
for (let i = 0; i < nbAtoms; i++) {
let l = molecule.getAllConnAtoms(i);
for (let j = 0; j < l; j++) {
let bondNumber = molecule.getConnBond(i, j);
if (molecule.isAromaticBond(bondNumber)) {
result[i][molecule.getConnAtom(i, j)] = 4;
} else {
result[i][molecule.getConnAtom(i, j)] = molecule.getConnBondOrder(
i,
j,
);
}
}
}
} else {

@@ -50,0 +71,0 @@ for (let i = 0; i < nbAtoms; i++) {

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