nmr-processing
Advanced tools
Comparing version 0.4.0 to 0.5.0
# Changelog | ||
## [0.5.0](https://www.github.com/cheminfo/nmr-processing/compare/v0.4.0...v0.5.0) (2020-12-16) | ||
### Features | ||
* by default filter solvent and impurity in rangesToACS ([319e595](https://www.github.com/cheminfo/nmr-processing/commit/319e595462a17c834699249dea8757bd87008dca)) | ||
## [0.4.0](https://www.github.com/cheminfo/nmr-processing/compare/v0.3.1...v0.4.0) (2020-11-16) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "nmr-processing", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "", | ||
@@ -43,24 +43,24 @@ "main": "lib/index.js", | ||
"@babel/plugin-transform-modules-commonjs": "^7.12.1", | ||
"@types/jest": "^26.0.15", | ||
"@types/jest": "^26.0.19", | ||
"cheminfo-build": "^1.1.8", | ||
"eslint": "^7.12.1", | ||
"eslint": "^7.15.0", | ||
"eslint-config-cheminfo": "^5.2.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-prettier": "^3.3.0", | ||
"esm": "^3.2.25", | ||
"jest": "^26.6.1", | ||
"jest": "^26.6.3", | ||
"jest-matcher-deep-close-to": "^2.0.1", | ||
"ml-array-median": "^1.1.4", | ||
"nmr-xy-testdata": "^0.2.1", | ||
"prettier": "^2.1.2", | ||
"rollup": "^2.32.1" | ||
"prettier": "^2.2.1", | ||
"rollup": "^2.35.1" | ||
}, | ||
"dependencies": { | ||
"ml-gsd": "^6.1.1", | ||
"ml-gsd": "^6.3.0", | ||
"ml-matrix-convolution": "^0.5.2", | ||
"ml-matrix-peaks-finder": "^0.3.2", | ||
"ml-simple-clustering": "^0.1.0", | ||
"ml-spectra-processing": "^4.5.1" | ||
"ml-spectra-processing": "^4.10.0" | ||
} | ||
} |
@@ -25,2 +25,12 @@ import { signalJoinCouplings } from '../signal/signalJoinCouplings'; | ||
/** | ||
* | ||
* @param {array} ranges | ||
* @param {object} [options={}] | ||
* @param {boolean} [options.filter=true] remove annotated signals as solvent and impurities | ||
* @param {number} [options.nucleus] | ||
* @param {number} [options.nbDecimalDelta] default value depends of nucleus | ||
* @param {number} [options.nbDecimalJ] default value depends of nucleus | ||
* @param {number} [options.observedFrequency] default value depends of nucleus 1H: 400MHz | ||
*/ | ||
export function rangesToACS(ranges, options = {}) { | ||
@@ -57,2 +67,3 @@ if (!options.nucleus) options.nucleus = '1H'; | ||
for (let range of ranges) { | ||
if (uselessKind(range.kind, options.filter)) continue; | ||
pushDelta(range, acsRanges, options); | ||
@@ -88,2 +99,9 @@ } | ||
let fromTo = [range.from, range.to]; | ||
if (Array.isArray(range.signal)) { | ||
range.signal = range.signal.filter( | ||
(signal) => !uselessKind(signal.kind, options.filter), | ||
); | ||
} | ||
if (Array.isArray(range.signal) && range.signal.length > 0) { | ||
@@ -227,1 +245,7 @@ let signals = range.signal; | ||
} | ||
function uselessKind(kind = '', filter = true) { | ||
kind = kind.toLowerCase(); | ||
if (filter && (kind === 'impurity' || kind === 'solvent')) return true; | ||
return false; | ||
} |
Sorry, the diff of this file is too big to display
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
244476
10128
Updatedml-gsd@^6.3.0