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

nucleotide

Package Overview
Dependencies
Maintainers
0
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nucleotide - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

lib/src/addFiveTerm.d.ts

13

package.json

@@ -8,6 +8,5 @@ {

},
"bundleDependencies": false,
"deprecated": false,
"description": "Deal with nucleotides and molecular formula",
"main": "lib/index.js",
"main": "lib/src/index.js",
"module": "src/index.js",

@@ -26,11 +25,11 @@ "files": [

},
"version": "3.1.0",
"version": "3.1.1",
"devDependencies": {
"mf-parser": "^3.2.0"
"mf-parser": "^3.2.1"
},
"dependencies": {
"chemical-groups": "^2.2.0",
"mf-utilities": "^3.2.0"
"chemical-groups": "^2.2.1",
"mf-utilities": "^3.2.1"
},
"gitHead": "28dae91d3b42556a23097ee08acfe4061f276ed0"
"gitHead": "838f98a30846d4b1721b8ed7aa94a55e854d7521"
}

@@ -7,3 +7,3 @@ import { baseLoss } from './baseLoss.js';

loss.forEach((mf) => {
for (const mf of loss) {
if (options.a) {

@@ -21,3 +21,3 @@ mfs.push(`${mf}`.replace('$', `O-1H-1$a${i} `));

}
});
}
}

@@ -7,3 +7,3 @@ import { baseLoss } from './baseLoss.js';

loss.forEach((mf) => {
for (const mf of loss) {
if (options.w) {

@@ -21,3 +21,3 @@ mfs.push(`HO${mf}`.replace('$', `$w${i} `));

}
});
}
}
import { mfDiff } from 'mf-utilities';
const mfLosses = {};
['Amp', 'Tmp', 'Cmp', 'Gmp', 'Ump'].forEach((nucleotide) => {
for (const nucleotide of ['Amp', 'Tmp', 'Cmp', 'Gmp', 'Ump']) {
mfLosses[nucleotide] = {

@@ -9,5 +9,5 @@ code: nucleotide.charAt(0),

};
});
}
['Damp', 'Dtmp', 'Dcmp', 'Dgmp', 'Dump'].forEach((nucleotide) => {
for (const nucleotide of ['Damp', 'Dtmp', 'Dcmp', 'Dgmp', 'Dump']) {
mfLosses[nucleotide] = {

@@ -17,3 +17,3 @@ code: nucleotide.charAt(1).toUpperCase(),

};
});
}

@@ -20,0 +20,0 @@ export function baseLoss(nucleotide) {

@@ -5,4 +5,4 @@ export function baseLossExhaustive(nucleotide) {

let parts = nucleotide
.replace(/ /g, '')
.replace(/([a-zA-Z0-9)])(?=[A-Z])/g, '$1 ')
.replaceAll(' ', '')
.replaceAll(/([\d)A-Za-z])(?=[A-Z])/g, '$1 ')
.split(/ /);

@@ -13,6 +13,6 @@ let counter = 0;

let middle = '';
if (part.match(/^D[atcgu]mp$/)) {
if (part.match(/^D[acgtu]mp$/)) {
middle = 'Drmp';
counter++;
} else if (part.match(/^[ATCGU]mp$/)) {
} else if (part.match(/^[ACGTU]mp$/)) {
middle = 'Rmp';

@@ -19,0 +19,0 @@ counter++;

export function furanThreeTerm(nucleotide) {
// last residue should become a furan
let parts = nucleotide
.replace(/ /g, '')
.replace(/([a-z)0-9])([A-Z][a-z](?=[a-z]))/g, '$1 $2')
.replaceAll(' ', '')
.replaceAll(/([\d)a-z])([A-Z][a-z](?=[a-z]))/g, '$1 $2')
.split(/ /);
let last = parts.pop();
if (!last.match(/D[atcg]mp(.*)$/)) {
if (!last.match(/D[acgt]mp(.*)$/)) {
// eslint-disable-next-line no-console

@@ -15,3 +15,3 @@ console.warn(

}
return parts.join('') + last.replace(/D[atcg]mp(.*)$/, 'Furp');
return parts.join('') + last.replace(/D[acgt]mp(.*)$/, 'Furp');
}

@@ -33,3 +33,3 @@ import { addFiveTerm } from './addFiveTerm';

let mfparts = mf
.replace(/([a-z)0-9])([A-Z][a-z](?=[a-z]))/g, '$1 $2')
.replaceAll(/([\d)a-z])([A-Z][a-z](?=[a-z]))/g, '$1 $2')
.split(/ /);

@@ -45,8 +45,5 @@

if (mfparts[mfparts.length - 1].includes('(')) {
threeTerm += mfparts[mfparts.length - 1].replace(/^[^()]*/, '');
mfparts[mfparts.length - 1] = mfparts[mfparts.length - 1].replace(
/\(.*/,
'',
);
if (mfparts.at(-1).includes('(')) {
threeTerm += mfparts.at(-1).replace(/^[^()]*/, '');
mfparts[mfparts.length - 1] = mfparts.at(-1).replace(/\(.*/, '');
}

@@ -53,0 +50,0 @@

@@ -32,3 +32,3 @@ import { groups } from 'chemical-groups';

let { kind, circular, fivePrime = 'monophosphate' } = options;
fivePrime = fivePrime.replace(/[^a-zA-Z]/g, '').toLowerCase();
fivePrime = fivePrime.replaceAll(/[^A-Za-z]/g, '').toLowerCase();

@@ -43,3 +43,3 @@ if (!kind) {

kind = kind.replace(/[^A-Za-z]/g, '').toLowerCase();
kind = kind.replaceAll(/[^A-Za-z]/g, '').toLowerCase();

@@ -98,3 +98,3 @@ if (sequence.includes('(') && kind === 'dsdna') {

currentSymbol = currentSymbol.replace(/[ \t\r\n]/, '');
currentSymbol = currentSymbol.replace(/[\t\n\r ]/, '');
if (!currentSymbol) continue;

@@ -122,4 +122,4 @@

if (!circular) {
results.forEach((result) => result.unshift(fivePrimeTerminal));
results.forEach((result) => result.push(threePrimeTerminal));
for (const result of results) result.unshift(fivePrimeTerminal);
for (const result of results) result.push(threePrimeTerminal);
}

@@ -144,41 +144,31 @@

groups
.filter((group) => group.kind === 'DNA')
.forEach((group) => {
if (group.oneLetter) {
desoxyNucleotides.alcohol[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'DNA')) {
if (group.oneLetter) {
desoxyNucleotides.alcohol[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'DNAp')
.forEach((group) => {
if (group.oneLetter) {
desoxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'DNAp')) {
if (group.oneLetter) {
desoxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'NucleotideP')
.forEach((group) => {
if (group.oneLetter) {
desoxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'NucleotideP')) {
if (group.oneLetter) {
desoxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'DNApp')
.forEach((group) => {
if (group.oneLetter) {
desoxyNucleotides.diphosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'DNApp')) {
if (group.oneLetter) {
desoxyNucleotides.diphosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'DNAppp')
.forEach((group) => {
if (group.oneLetter) {
desoxyNucleotides.triphosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'DNAppp')) {
if (group.oneLetter) {
desoxyNucleotides.triphosphate[group.oneLetter] = group.symbol;
}
}

@@ -192,40 +182,30 @@ const oxyNucleotides = {

groups
.filter((group) => group.kind === 'RNA')
.forEach((group) => {
if (group.oneLetter) {
oxyNucleotides.alcohol[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'RNA')) {
if (group.oneLetter) {
oxyNucleotides.alcohol[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'RNAp')
.forEach((group) => {
if (group.oneLetter) {
oxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'RNAp')) {
if (group.oneLetter) {
oxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'NucleotideP')
.forEach((group) => {
if (group.oneLetter) {
oxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'NucleotideP')) {
if (group.oneLetter) {
oxyNucleotides.monophosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'RNApp')
.forEach((group) => {
if (group.oneLetter) {
oxyNucleotides.diphosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'RNApp')) {
if (group.oneLetter) {
oxyNucleotides.diphosphate[group.oneLetter] = group.symbol;
}
}
groups
.filter((group) => group.kind === 'RNAppp')
.forEach((group) => {
if (group.oneLetter) {
oxyNucleotides.triphosphate[group.oneLetter] = group.symbol;
}
});
for (const group of groups.filter(({ kind }) => kind === 'RNAppp')) {
if (group.oneLetter) {
oxyNucleotides.triphosphate[group.oneLetter] = group.symbol;
}
}
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