chromatography
Advanced tools
Comparing version 3.10.0 to 3.11.0
@@ -8,3 +8,3 @@ 'use strict'; | ||
var mlGsd = require('ml-gsd'); | ||
var max = _interopDefault(require('ml-array-max')); | ||
var arrayMax = _interopDefault(require('ml-array-max')); | ||
var IsotopicDistribution = _interopDefault(require('isotopic-distribution')); | ||
@@ -295,3 +295,3 @@ var binarySearch = _interopDefault(require('binary-search')); | ||
if (massSpectrum[1].length > 0) { | ||
bpc.push(max(massSpectrum[1])); | ||
bpc.push(arrayMax(massSpectrum[1])); | ||
} else { | ||
@@ -792,3 +792,3 @@ bpc.push(0); | ||
let max$$1 = -1; | ||
let max = -1; | ||
let massList = new Array(massXYObject.x.length); | ||
@@ -801,4 +801,4 @@ for (let i = 0; i < massXYObject.x.length; ++i) { | ||
if (massXYObject.y[i] > max$$1) { | ||
max$$1 = massXYObject.y[i]; | ||
if (massXYObject.y[i] > max) { | ||
max = massXYObject.y[i]; | ||
} | ||
@@ -808,4 +808,4 @@ } | ||
// filters based in thresholdFactor | ||
max$$1 *= thresholdFactor; | ||
let filteredList = massList.filter((val) => val.y > max$$1); | ||
max *= thresholdFactor; | ||
let filteredList = massList.filter((val) => val.y > max); | ||
@@ -1121,5 +1121,3 @@ // filters based in maxNumberPeaks | ||
function meanFilter(chromatogram, serieName, options = {}) { | ||
const { | ||
factor = 2 | ||
} = options; | ||
const { factor = 2 } = options; | ||
@@ -1136,4 +1134,5 @@ var serie = chromatogram.getSerie(serieName); | ||
function applyFilter(serie, factor) { | ||
var filtered = [[], []]; | ||
if (serie[1].length === 0) return filtered; | ||
const meanIntensity = factor * arrayMean(serie[1]); | ||
var filtered = [[], []]; | ||
for (var i = 0; i < serie[0].length; i++) { | ||
@@ -1166,3 +1165,3 @@ if (serie[1][i] > meanIntensity) { | ||
try { | ||
basePeak = max(serie[1]); | ||
basePeak = arrayMax(serie[1]); | ||
} catch (e) { | ||
@@ -1717,3 +1716,3 @@ basePeak = 0; | ||
for (let i = 0; i < sample.peaks.length; ++i) { | ||
let max$$1 = { similarity: -3 }; | ||
let max = { similarity: -3 }; | ||
let biggerCounter = 0; | ||
@@ -1723,4 +1722,4 @@ for (let j = 0; j < reference.peaks.length; ++j) { | ||
if (sim > options.similarityThreshold && sim > max$$1.similarity) { | ||
max$$1 = { | ||
if (sim > options.similarityThreshold && sim > max.similarity) { | ||
max = { | ||
similarity: sim, | ||
@@ -1736,5 +1735,5 @@ chrom1: reference.peaks[j], | ||
if (biggerCounter === 1) { | ||
similarityPeaks.chrom1[similarLen] = max$$1.chrom1; | ||
similarityPeaks.chrom2[similarLen] = max$$1.chrom2; | ||
similarityPeaks.similarity[similarLen++] = max$$1.similarity; | ||
similarityPeaks.chrom1[similarLen] = max.chrom1; | ||
similarityPeaks.chrom2[similarLen] = max.chrom2; | ||
similarityPeaks.similarity[similarLen++] = max.similarity; | ||
} | ||
@@ -1741,0 +1740,0 @@ } |
{ | ||
"name": "chromatography", | ||
"version": "3.10.0", | ||
"version": "3.11.0", | ||
"description": "Tools for storing, search and analize GC/MS spectra", | ||
@@ -39,34 +39,34 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"babel-jest": "^21.2.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-jest": "^24.5.0", | ||
"babel-loader": "^8.0.5", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"babel-preset-env": "^1.7.0", | ||
"cheminfo-tools": "^1.22.4", | ||
"codecov": "^3.0.0", | ||
"documentation": "^8.1.2", | ||
"eslint": "^5.9.0", | ||
"eslint-config-cheminfo": "^1.15.1", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-jest": "^21.27.2", | ||
"eslint-plugin-no-only-tests": "^2.0.0", | ||
"jest": "^23.5.0", | ||
"jest-matcher-deep-close-to": "^1.2.1", | ||
"npm-run-all": "^4.1.2", | ||
"rollup": "^0.52.3" | ||
"codecov": "^3.2.0", | ||
"documentation": "^9.3.1", | ||
"eslint": "^5.15.1", | ||
"eslint-config-cheminfo": "^1.20.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jest": "^22.3.2", | ||
"eslint-plugin-no-only-tests": "^2.1.0", | ||
"jest": "^24.5.0", | ||
"jest-matcher-deep-close-to": "^1.3.0", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^1.6.0" | ||
}, | ||
"dependencies": { | ||
"binary-search": "^1.3.3", | ||
"isotopic-distribution": "^0.6.4", | ||
"jcampconverter": "^2.9.2", | ||
"mf-parser": "^0.6.4", | ||
"ml-array-max": "^1.1.0", | ||
"ml-array-mean": "^1.1.0", | ||
"ml-gsd": "^2.0.3", | ||
"ml-regression-polynomial": "^1.0.2", | ||
"binary-search": "^1.3.5", | ||
"isotopic-distribution": "^0.9.1", | ||
"jcampconverter": "^3.0.0", | ||
"mf-parser": "^0.9.1", | ||
"ml-array-max": "^1.1.1", | ||
"ml-array-mean": "^1.1.1", | ||
"ml-gsd": "^2.0.5", | ||
"ml-regression-polynomial": "^1.0.3", | ||
"mzdata": "^1.1.0", | ||
"mzmjs": "^0.2.0", | ||
"netcdf-gcms": "^1.2.3", | ||
"netcdf-gcms": "^1.3.1", | ||
"num-sort": "^1.0.0", | ||
"xy-parser": "^2.2.0" | ||
"xy-parser": "^2.2.2" | ||
} | ||
} |
@@ -6,5 +6,3 @@ import arrayMean from 'ml-array-mean'; | ||
export function meanFilter(chromatogram, serieName, options = {}) { | ||
const { | ||
factor = 2 | ||
} = options; | ||
const { factor = 2 } = options; | ||
@@ -21,4 +19,5 @@ var serie = chromatogram.getSerie(serieName); | ||
function applyFilter(serie, factor) { | ||
var filtered = [[], []]; | ||
if (serie[1].length === 0) return filtered; | ||
const meanIntensity = factor * arrayMean(serie[1]); | ||
var filtered = [[], []]; | ||
for (var i = 0; i < serie[0].length; i++) { | ||
@@ -25,0 +24,0 @@ if (serie[1][i] > meanIntensity) { |
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
126522
3366
+ Addedatom-sorter@0.9.1(transitive)
+ Addedchemical-elements@0.9.1(transitive)
+ Addedchemical-groups@0.9.1(transitive)
+ Addedisotopic-distribution@0.9.1(transitive)
+ Addedjcampconverter@3.0.4(transitive)
+ Addedmf-parser@0.9.1(transitive)
+ Addedmf-utilities@0.9.1(transitive)
- Removedatom-sorter@0.6.4(transitive)
- Removedchemical-elements@0.6.4(transitive)
- Removedchemical-groups@0.6.4(transitive)
- Removedisotopic-distribution@0.6.4(transitive)
- Removedjcampconverter@2.11.0(transitive)
- Removedmf-parser@0.6.4(transitive)
- Removedmf-utilities@0.6.4(transitive)
Updatedbinary-search@^1.3.5
Updatedisotopic-distribution@^0.9.1
Updatedjcampconverter@^3.0.0
Updatedmf-parser@^0.9.1
Updatedml-array-max@^1.1.1
Updatedml-array-mean@^1.1.1
Updatedml-gsd@^2.0.5
Updatednetcdf-gcms@^1.3.1
Updatedxy-parser@^2.2.2