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

brukerconverter

Package Overview
Dependencies
Maintainers
6
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brukerconverter - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1-pre.1670358817

8

brukerconverter.d.ts

@@ -24,3 +24,3 @@ import { DoubleArray } from 'cheminfo-types';

*/
processingNumber?: number | number[];
processingNumbern?: number[];
/**

@@ -30,3 +30,3 @@ * experiment number to select, default all

*/
experimentNumber?: number | number[];
experimentNumbers?: number[];
/**

@@ -151,4 +151,4 @@ * should we ignore fid

ntuples: any;
meta: Record<string, string | number>;
info: Record<string, string | number>;
meta: Record<string, any>;
info: Record<string, any>;
title: string;

@@ -155,0 +155,0 @@ dataType: string;

@@ -13,8 +13,8 @@ 'use strict';

* @param {object} [options={}]
* @param {number|number[]} [options.processingNumber] - processing number to select, default the smallest number
* @param {number|number[]} [options.experimentNumber] - experiment number to select, default all
* @param {boolean} [options.ignoreFID=false] - should we ignore fid
* @param {boolean} [options.ignoreFT=false] - should we ignore the ft transformed fid
* @param {boolean} [options.ignore1D=false] - should we ignore 1D spectra
* @param {boolean} [options.ignore2D=false] - should we ignore 2D spectra
* @param {number[]} [options.processingNumbers] - processing number to select, default the smallest number
* @param {number[]} [options.experimentNumbers] - experiment number to select, default all
* @param {boolean} [options.keepFID=true] - should we keep fid
* @param {boolean} [options.keepFT=true] - should we keep the ft transformed fid
* @param {boolean} [options.keep1D=true] - should we keep 1D spectra
* @param {boolean} [options.keep2D=true] - should we keep 2D spectra
* @param {boolean} [options.onlyFirstProcessedData=true] - should we take only the first processed data (procno).

@@ -24,16 +24,10 @@ */

let {
processingNumber,
experimentNumber,
ignoreFID = false,
ignoreFT = false,
ignore1D = false,
ignore2D = false,
processingNumbers,
experimentNumbers,
keepFID = true,
keepFT = true,
keep1D = true,
keep2D = true,
onlyFirstProcessedData = true,
} = options;
if (typeof processingNumber === 'number') {
processingNumber = [processingNumber];
}
if (typeof experimentNumber === 'number') {
experimentNumber = [experimentNumber];
}

@@ -61,3 +55,3 @@ const experiments = {};

if (experimentNumber && !experimentNumber.includes(currentExperimentNo)) {
if (experimentNumbers && !experimentNumbers.includes(currentExperimentNo)) {
continue;

@@ -111,4 +105,4 @@ }

}
if (processingNumber) {
// we need to deal with the list of processingNumber that is specified
if (processingNumbers) {
// we need to deal with the list of processingNumbers that is specified
for (const key in experiments) {

@@ -118,3 +112,3 @@ const processedData = experiments[key].processedData;

for (let key in processedData) {
if (!processingNumber.includes(parseInt(key, 10))) continue;
if (!processingNumbers.includes(parseInt(key, 10))) continue;
newProcessedData[key] = processedData[key];

@@ -178,12 +172,12 @@ }

// we can not easily filter
if (ignoreFID) {
if (!keepFID) {
experimentsArray = experimentsArray.filter((item) => !item.isFID);
}
if (ignoreFT) {
if (!keepFT) {
experimentsArray = experimentsArray.filter((item) => !item.isFT);
}
if (ignore1D) {
if (!keep1D) {
experimentsArray = experimentsArray.filter((item) => !item.is1D);
}
if (ignore2D) {
if (!keep2D) {
experimentsArray = experimentsArray.filter((item) => !item.is2D);

@@ -190,0 +184,0 @@ }

{
"name": "brukerconverter",
"version": "6.0.0",
"version": "6.0.1-pre.1670358817",
"description": "Parse and convert Bruker raw data",

@@ -53,2 +53,2 @@ "main": "lib/index.js",

}
}
}

@@ -14,4 +14,4 @@ import { getCoffee } from 'bruker-data-test';

const results = groupByExperiments(fileCollection, {
ignore2D: true,
ignoreFID: true,
keep2D: false,
keepFID: false,
});

@@ -31,4 +31,4 @@ expect(results).toHaveLength(8);

const results = groupByExperiments(fileCollection, {
ignore2D: true,
ignoreFT: true,
keep2D: false,
keepFT: false,
});

@@ -48,4 +48,4 @@ expect(results).toHaveLength(7);

const results = groupByExperiments(fileCollection, {
ignore1D: true,
ignoreFID: true,
keep1D: false,
keepFID: false,
});

@@ -57,4 +57,4 @@ expect(results).toHaveLength(1);

const results = groupByExperiments(fileCollection, {
ignore1D: true,
ignoreFT: true,
keep1D: false,
keepFT: false,
});

@@ -66,3 +66,3 @@ expect(results).toHaveLength(2);

const results = groupByExperiments(fileCollection, {
processingNumber: 1,
processingNumbers: [1],
});

@@ -75,3 +75,3 @@ expect(results).toHaveLength(18);

onlyFirstProcessedData: false,
ignoreFID: true,
keepFID: false,
});

@@ -83,4 +83,4 @@ expect(results).toHaveLength(9);

const results = groupByExperiments(fileCollection, {
processingNumber: 2,
ignoreFID: true,
processingNumbers: [2],
keepFID: false,
});

@@ -92,4 +92,4 @@ expect(results).toHaveLength(0);

const results = groupByExperiments(fileCollection, {
processingNumber: 1,
ignoreFID: true,
processingNumbers: [1],
keepFID: false,
});

@@ -96,0 +96,0 @@ expect(results).toHaveLength(9);

@@ -5,8 +5,8 @@ /**

* @param {object} [options={}]
* @param {number|number[]} [options.processingNumber] - processing number to select, default the smallest number
* @param {number|number[]} [options.experimentNumber] - experiment number to select, default all
* @param {boolean} [options.ignoreFID=false] - should we ignore fid
* @param {boolean} [options.ignoreFT=false] - should we ignore the ft transformed fid
* @param {boolean} [options.ignore1D=false] - should we ignore 1D spectra
* @param {boolean} [options.ignore2D=false] - should we ignore 2D spectra
* @param {number[]} [options.processingNumbers] - processing number to select, default the smallest number
* @param {number[]} [options.experimentNumbers] - experiment number to select, default all
* @param {boolean} [options.keepFID=true] - should we keep fid
* @param {boolean} [options.keepFT=true] - should we keep the ft transformed fid
* @param {boolean} [options.keep1D=true] - should we keep 1D spectra
* @param {boolean} [options.keep2D=true] - should we keep 2D spectra
* @param {boolean} [options.onlyFirstProcessedData=true] - should we take only the first processed data (procno).

@@ -16,16 +16,10 @@ */

let {
processingNumber,
experimentNumber,
ignoreFID = false,
ignoreFT = false,
ignore1D = false,
ignore2D = false,
processingNumbers,
experimentNumbers,
keepFID = true,
keepFT = true,
keep1D = true,
keep2D = true,
onlyFirstProcessedData = true,
} = options;
if (typeof processingNumber === 'number') {
processingNumber = [processingNumber];
}
if (typeof experimentNumber === 'number') {
experimentNumber = [experimentNumber];
}

@@ -53,3 +47,3 @@ const experiments = {};

if (experimentNumber && !experimentNumber.includes(currentExperimentNo)) {
if (experimentNumbers && !experimentNumbers.includes(currentExperimentNo)) {
continue;

@@ -103,4 +97,4 @@ }

}
if (processingNumber) {
// we need to deal with the list of processingNumber that is specified
if (processingNumbers) {
// we need to deal with the list of processingNumbers that is specified
for (const key in experiments) {

@@ -110,3 +104,3 @@ const processedData = experiments[key].processedData;

for (let key in processedData) {
if (!processingNumber.includes(parseInt(key, 10))) continue;
if (!processingNumbers.includes(parseInt(key, 10))) continue;
newProcessedData[key] = processedData[key];

@@ -170,12 +164,12 @@ }

// we can not easily filter
if (ignoreFID) {
if (!keepFID) {
experimentsArray = experimentsArray.filter((item) => !item.isFID);
}
if (ignoreFT) {
if (!keepFT) {
experimentsArray = experimentsArray.filter((item) => !item.isFT);
}
if (ignore1D) {
if (!keep1D) {
experimentsArray = experimentsArray.filter((item) => !item.is1D);
}
if (ignore2D) {
if (!keep2D) {
experimentsArray = experimentsArray.filter((item) => !item.is2D);

@@ -182,0 +176,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