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

nmr-predictor

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nmr-predictor - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/predict_2d.js

4

package.json
{
"name": "nmr-predictor",
"version": "0.0.2",
"version": "0.0.3",
"description": "NMR chemical shift predictor",

@@ -29,3 +29,3 @@ "keywords": [],

"dependencies": {
"openchemlib-extended": "1.9.0",
"openchemlib-extended": "1.9.1",
"ml-matrix": "^1.1.2",

@@ -32,0 +32,0 @@ "new-array": "^1.0.0"

@@ -27,13 +27,30 @@ 'use strict'

}
var prediction;
if(typeof this.db === "object") {
return this._askErno(mol, param1);
prediction = this._askErno(mol, param1);
}
if(this.db === "spinus") {
//The molfile whitout hydrogens
return this._fromSpinus(mol, param1, param2);
prediction = this._fromSpinus(mol, param1, param2);
}
if(this.db === "nmrshiftdb2") {
return this._fromNnmrshiftdb2(mol, param1);
prediction = this._fromNnmrshiftdb2(mol, param1);
}
if(param1 && param1.group||param2 && param2.group){
prediction.sort(function(a, b) {
if(a.diaIDs[0] < b.diaIDs[0]) return -1;
if(a.diaIDs[0] > b.diaIDs[0]) return 1;
return 0;
});
for(var i = prediction.length-2; i >= 0; i--){
if(prediction[i].diaIDs[0]===prediction[i+1].diaIDs[0]){
prediction[i].integral+=prediction[i+1].integral;
prediction[i].atomIDs=prediction[i].atomIDs.concat(prediction[i+1].atomIDs);
prediction.splice(i+1,1);
}
}
}
return prediction;
}

@@ -40,0 +57,0 @@

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