nmr-simulation
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -32,3 +32,3 @@ 'use strict'; | ||
var i, j; | ||
const { | ||
var { | ||
lineWidth = 1, | ||
@@ -42,2 +42,4 @@ nbPoints = 1024, | ||
nbPoints = Number(nbPoints); | ||
const from = options.from * frequencyMHz || 0; | ||
@@ -44,0 +46,0 @@ const to = (options.to || 10) * frequencyMHz; |
@@ -95,18 +95,24 @@ 'use strict'; | ||
let atomIDs = pred.atomIDs; | ||
for (let i = 0; i < atomIDs.length; i++) { | ||
let tempPred = JSON.parse(JSON.stringify(pred)); | ||
let nmrJ = []; | ||
tempPred.atomIDs = [atomIDs[i]]; | ||
tempPred.integral = 1; | ||
for (let j = 0; j < tempPred.j.length; j++) { | ||
let assignment = tempPred.j[j].assignment; | ||
for (let k = 0; k < assignment.length; k++) { | ||
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j])); | ||
tempJ.assignment = assignment[k]; | ||
nmrJ.push(tempJ); | ||
if (atomIDs instanceof Array) { | ||
for (let i = 0; i < atomIDs.length; i++) { | ||
let tempPred = JSON.parse(JSON.stringify(pred)); | ||
let nmrJ = []; | ||
tempPred.atomIDs = [atomIDs[i]]; | ||
tempPred.integral = 1; | ||
if (tempPred.j instanceof Array) { | ||
for (let j = 0; j < tempPred.j.length; j++) { | ||
let assignment = tempPred.j[j].assignment; | ||
if (assignment instanceof Array) { | ||
for (let k = 0; k < assignment.length; k++) { | ||
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j])); | ||
tempJ.assignment = assignment[k]; | ||
nmrJ.push(tempJ); | ||
} | ||
} | ||
} | ||
} | ||
tempPred.j = nmrJ; | ||
delete tempPred.nbAtoms; | ||
result.push(tempPred); | ||
} | ||
tempPred.j = nmrJ; | ||
delete tempPred.nbAtoms; | ||
result.push(tempPred); | ||
} | ||
@@ -113,0 +119,0 @@ }); |
{ | ||
"name": "nmr-simulation", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Simulate NMR spectra from spin systems", | ||
@@ -38,4 +38,4 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"nmr-predictor": "^1.1.5" | ||
"nmr-predictor": "^1.1.6" | ||
} | ||
} |
@@ -12,3 +12,3 @@ import Matrix from 'ml-matrix'; | ||
var i, j; | ||
const { | ||
var { | ||
lineWidth = 1, | ||
@@ -22,2 +22,4 @@ nbPoints = 1024, | ||
nbPoints = Number(nbPoints); | ||
const from = options.from * frequencyMHz || 0; | ||
@@ -24,0 +26,0 @@ const to = (options.to || 10) * frequencyMHz; |
@@ -77,18 +77,24 @@ import Matrix from 'ml-matrix'; | ||
let atomIDs = pred.atomIDs; | ||
for (let i = 0; i < atomIDs.length; i++) { | ||
let tempPred = JSON.parse(JSON.stringify(pred)); | ||
let nmrJ = []; | ||
tempPred.atomIDs = [atomIDs[i]]; | ||
tempPred.integral = 1; | ||
for (let j = 0; j < tempPred.j.length; j++) { | ||
let assignment = tempPred.j[j].assignment; | ||
for (let k = 0; k < assignment.length; k++) { | ||
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j])); | ||
tempJ.assignment = assignment[k]; | ||
nmrJ.push(tempJ); | ||
if (atomIDs instanceof Array) { | ||
for (let i = 0; i < atomIDs.length; i++) { | ||
let tempPred = JSON.parse(JSON.stringify(pred)); | ||
let nmrJ = []; | ||
tempPred.atomIDs = [atomIDs[i]]; | ||
tempPred.integral = 1; | ||
if (tempPred.j instanceof Array) { | ||
for (let j = 0; j < tempPred.j.length; j++) { | ||
let assignment = tempPred.j[j].assignment; | ||
if (assignment instanceof Array) { | ||
for (let k = 0; k < assignment.length; k++) { | ||
let tempJ = JSON.parse(JSON.stringify(tempPred.j[j])); | ||
tempJ.assignment = assignment[k]; | ||
nmrJ.push(tempJ); | ||
} | ||
} | ||
} | ||
} | ||
tempPred.j = nmrJ; | ||
delete tempPred.nbAtoms; | ||
result.push(tempPred); | ||
} | ||
tempPred.j = nmrJ; | ||
delete tempPred.nbAtoms; | ||
result.push(tempPred); | ||
} | ||
@@ -95,0 +101,0 @@ }); |
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
54818
1306