ms-spectrum
Advanced tools
Comparing version 3.6.10 to 3.7.0
@@ -10,2 +10,4 @@ /** | ||
* @param {number} [options.to] - max X value of the window to consider | ||
* @param {number} [options.minValue=Number.NEGATIVE_INFINITY] - min Y value of the window to consider | ||
* @param {number} [options.maxValue=Number.POSITIVE_INFINITY] - max Y value of the window to consider | ||
* @param {number} [options.searchMonoisotopicRatio=0] - search previous peaks with at least ratio height | ||
@@ -21,2 +23,4 @@ * @param {number} [options.limit=20] - max number of peaks | ||
to?: number; | ||
minValue?: number; | ||
maxValue?: number; | ||
searchMonoisotopicRatio?: number; | ||
@@ -23,0 +27,0 @@ limit?: number; |
@@ -14,2 +14,4 @@ "use strict"; | ||
* @param {number} [options.to] - max X value of the window to consider | ||
* @param {number} [options.minValue=Number.NEGATIVE_INFINITY] - min Y value of the window to consider | ||
* @param {number} [options.maxValue=Number.POSITIVE_INFINITY] - max Y value of the window to consider | ||
* @param {number} [options.searchMonoisotopicRatio=0] - search previous peaks with at least ratio height | ||
@@ -23,3 +25,3 @@ * @param {number} [options.limit=20] - max number of peaks | ||
function getBestPeaks(peaks, options = {}) { | ||
const { searchMonoisotopicRatio = 0, from = (0, ml_spectra_processing_1.xyObjectMinXPoint)(peaks).x, to = (0, ml_spectra_processing_1.xyObjectMaxXPoint)(peaks).x, limit = 20, threshold = 0.01, numberCloseSlots = 50, numberSlots = 10, } = options; | ||
const { searchMonoisotopicRatio = 0, from = (0, ml_spectra_processing_1.xyObjectMinXPoint)(peaks).x, to = (0, ml_spectra_processing_1.xyObjectMaxXPoint)(peaks).x, limit = 20, threshold = 0.01, numberCloseSlots = 50, numberSlots = 10, minValue = Number.NEGATIVE_INFINITY, maxValue = Number.POSITIVE_INFINITY, } = options; | ||
let slot = (to - from) / numberSlots; | ||
@@ -29,2 +31,3 @@ let closeSlot = (to - from) / numberCloseSlots; | ||
.filter((peak) => peak.x >= from && peak.x <= to) | ||
.filter((peak) => peak.y >= minValue && peak.y <= maxValue) | ||
.map((peak) => { | ||
@@ -31,0 +34,0 @@ return { |
{ | ||
"name": "ms-spectrum", | ||
"version": "3.6.10", | ||
"version": "3.7.0", | ||
"description": "A mass spectrum", | ||
@@ -24,6 +24,6 @@ "main": "lib/src/index.js", | ||
"cheminfo-types": "^1.8.0", | ||
"emdb": "^3.3.10", | ||
"emdb": "^3.3.11", | ||
"is-any-array": "^2.0.1", | ||
"mf-parser": "^3.2.5", | ||
"mf-utilities": "^3.2.6", | ||
"mf-utilities": "^3.3.0", | ||
"ml-gsd": "^12.1.8", | ||
@@ -39,3 +39,3 @@ "ml-regression-power": "^3.0.0", | ||
}, | ||
"gitHead": "ead08ac8b436c6d4eb0016e938cb17a0dc5e2b06" | ||
"gitHead": "78eda3ed5d6830f7570d3867af21af2d5345a39e" | ||
} |
@@ -12,2 +12,4 @@ import { xyObjectMaxXPoint, xyObjectMinXPoint } from 'ml-spectra-processing'; | ||
* @param {number} [options.to] - max X value of the window to consider | ||
* @param {number} [options.minValue=Number.NEGATIVE_INFINITY] - min Y value of the window to consider | ||
* @param {number} [options.maxValue=Number.POSITIVE_INFINITY] - max Y value of the window to consider | ||
* @param {number} [options.searchMonoisotopicRatio=0] - search previous peaks with at least ratio height | ||
@@ -30,2 +32,4 @@ * @param {number} [options.limit=20] - max number of peaks | ||
numberSlots = 10, | ||
minValue = Number.NEGATIVE_INFINITY, | ||
maxValue = Number.POSITIVE_INFINITY, | ||
} = options; | ||
@@ -36,2 +40,3 @@ let slot = (to - from) / numberSlots; | ||
.filter((peak) => peak.x >= from && peak.x <= to) | ||
.filter((peak) => peak.y >= minValue && peak.y <= maxValue) | ||
.map((peak) => { | ||
@@ -38,0 +43,0 @@ return { |
Sorry, the diff of this file is not supported yet
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
172943
2539
Updatedemdb@^3.3.11
Updatedmf-utilities@^3.3.0