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

multiplet-analysis

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiplet-analysis - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

48

lib/index.js

@@ -514,12 +514,5 @@ 'use strict';

if (correctVerticalOffset) {
let minValue = Number.MAX_SAFE_INTEGER;
for (let index = 0; index < y.length; index++) {
if (minValue > y[index]) {
minValue = y[index];
}
}
const minValue = mlSpectraProcessing.xMinValue(y);
if (minValue > 0) {
for (let index = 0; index < y.length; index++) {
y[index] -= minValue;
}
y = mlSpectraProcessing.xSubtract(y, minValue);
}

@@ -550,16 +543,2 @@ }

[spectrum, scale] = removeShift(spectrum, scale, 95);
if (checkSymmetryFirst) {
let symFactor = getSymFactor(spectrum);
if (symFactor < 0.98) {
let maxAmplitudePosition = mlSpectraProcessing.xyMaxYPoint({ x: scale, y: spectrum });
return {
chemShift: scale[maxAmplitudePosition.index],
js: [],
};
} else {
spectrum = symmetrize(spectrum);
}
}
let incrementForSpeed = 1;

@@ -575,2 +554,25 @@ let curIncrementForSpeed;

let minTestedPt = Math.trunc(minTestedJ / resolutionHz) - incrementForSpeed;
[spectrum, scale] = removeShift(spectrum, scale, 95);
if (checkSymmetryFirst) {
let symFactor = getSymFactor(spectrum);
if (symFactor < 0.98) {
let maxAmplitudePosition = mlSpectraProcessing.xyMaxYPoint({ x: scale, y: spectrum });
result.chemShift = scale[maxAmplitudePosition.index];
let jStarArray = mlSpectraProcessing.xSequentialFillFromStep({
from: 0,
step: resolutionHz,
size: maxTestedPt,
});
let scalProd = new Float64Array(maxTestedPt).fill(-1);
for (let jStar = 0; jStar < minTestedPt + incrementForSpeed; jStar++) {
scalProd[jStar] = 0;
}
appendDebug(scale, spectrum, jStarArray, scalProd, null, result);
return result;
} else {
spectrum = symmetrize(spectrum);
}
}
// will find center of symmetry of the multiplet

@@ -577,0 +579,0 @@ // add zeroes as to make it symetrical if requested... and needed

import { DataXY } from 'cheminfo-types';
export interface AnalizeMultipletOptions {
/**
* @default 400
*/
frequency?: number;
/**
* @default false
*/
debug?: boolean;
/**
* @default 20
*/
maxTestedJ?: number;
/**
* @default 1
*/
minTestedJ?: number;
/**
* @default false
*/
checkSymmetryFirst?: boolean;
/**
* @default 0.01
*/
minimalResolution?: number;
/**
* @default true
*/
correctVerticalOffset?: boolean;
/**
* @default true
*/
makeShortCutForSpeed?: boolean;
/**
* @default 0.9
*/
critFoundJ?: number;
/**
* @default 1
*/
sign?: number;
/**
* @default true
*/
chopTail?: boolean;
/**
* @default 0.5
*/
multiplicity?: number;
/**
* @default false
*/
symmetrizeEachStep?: boolean;
/**
* @default false
*/
takeBestPartMultiplet?: boolean;
/**
* @default 0
*/
addPhaseInterpolation?: number;
/**
* @default 0
*/
forceFirstDeconvolutionToThisValue?: number;
/**
* @default 0
*/
appliedPhaseCorrectionType?: number;
/**
* @default true
*/
decreasingJvalues?: boolean;
/**
* @default 2
*/
jumpUpAfterFoundValue?: number;
}
declare module 'multiplet-analysis' {
export interface AnalizeMultipletOptions {
/**
* @default 400
*/
frequency?: number;
/**
* @default false
*/
debug?: boolean;
/**
* @default 20
*/
maxTestedJ?: number;
/**
* @default 1
*/
minTestedJ?: number;
/**
* @default false
*/
checkSymmetryFirst?: boolean;
/**
* @default 0.01
*/
minimalResolution?: number;
/**
* @default true
*/
correctVerticalOffset?: boolean;
/**
* @default true
*/
makeShortCutForSpeed?: boolean;
/**
* @default 0.9
*/
critFoundJ?: number;
/**
* @default 1
*/
sign?: number;
/**
* @default true
*/
chopTail?: boolean;
/**
* @default 0.5
*/
multiplicity?: number;
/**
* @default false
*/
symmetrizeEachStep?: boolean;
/**
* @default false
*/
takeBestPartMultiplet?: boolean;
/**
* @default 0
*/
addPhaseInterpolation?: number;
/**
* @default 0
*/
forceFirstDeconvolutionToThisValue?: number;
/**
* @default 0
*/
appliedPhaseCorrectionType?: number;
/**
* @default true
*/
decreasingJvalues?: boolean;
/**
* @default 2
*/
jumpUpAfterFoundValue?: number;
}
export function analyseMultiplet(
data: DataXY,
options?: AnalizeMultipletOptions,
);
export function analyseMultiplet(
data: DataXY,
options?: AnalizeMultipletOptions,
);
}
declare module 'multiplet-analysis' {}
{
"name": "multiplet-analysis",
"version": "2.1.4",
"version": "2.1.5",
"description": "Extract coupling constants from a complex NMR multiiplet",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -8,3 +8,9 @@ /**

import { nextPowerOfTwo, xyMaxYPoint } from 'ml-spectra-processing';
import {
nextPowerOfTwo,
xMinValue,
xSequentialFillFromStep,
xSubtract,
xyMaxYPoint,
} from 'ml-spectra-processing';

@@ -67,12 +73,5 @@ import { appendDebug } from './appendDebug';

if (correctVerticalOffset) {
let minValue = Number.MAX_SAFE_INTEGER;
for (let index = 0; index < y.length; index++) {
if (minValue > y[index]) {
minValue = y[index];
}
}
const minValue = xMinValue(y);
if (minValue > 0) {
for (let index = 0; index < y.length; index++) {
y[index] -= minValue;
}
y = xSubtract(y, minValue);
}

@@ -103,16 +102,2 @@ }

[spectrum, scale] = removeShift(spectrum, scale, 95);
if (checkSymmetryFirst) {
let symFactor = getSymFactor(spectrum);
if (symFactor < 0.98) {
let maxAmplitudePosition = xyMaxYPoint({ x: scale, y: spectrum });
return {
chemShift: scale[maxAmplitudePosition.index],
js: [],
};
} else {
spectrum = symmetrize(spectrum);
}
}
let incrementForSpeed = 1;

@@ -128,2 +113,25 @@ let curIncrementForSpeed;

let minTestedPt = Math.trunc(minTestedJ / resolutionHz) - incrementForSpeed;
[spectrum, scale] = removeShift(spectrum, scale, 95);
if (checkSymmetryFirst) {
let symFactor = getSymFactor(spectrum);
if (symFactor < 0.98) {
let maxAmplitudePosition = xyMaxYPoint({ x: scale, y: spectrum });
result.chemShift = scale[maxAmplitudePosition.index];
let jStarArray = xSequentialFillFromStep({
from: 0,
step: resolutionHz,
size: maxTestedPt,
});
let scalProd = new Float64Array(maxTestedPt).fill(-1);
for (let jStar = 0; jStar < minTestedPt + incrementForSpeed; jStar++) {
scalProd[jStar] = 0;
}
appendDebug(scale, spectrum, jStarArray, scalProd, null, result);
return result;
} else {
spectrum = symmetrize(spectrum);
}
}
// will find center of symmetry of the multiplet

@@ -130,0 +138,0 @@ // add zeroes as to make it symetrical if requested... and needed

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