nucleotide
Advanced tools
Comparing version 1.2.25 to 1.3.0
@@ -11,9 +11,7 @@ { | ||
"description": "Deal with nucleotides and molecular formula", | ||
"main": "lib/index.js", | ||
"module": "src/index.js", | ||
"main": "src/index.js", | ||
"files": [ | ||
"src", | ||
"lib" | ||
"src" | ||
], | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/main/packages/nucleotide#readme", | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/master/packages/nucleotide#readme", | ||
"keywords": [], | ||
@@ -26,11 +24,11 @@ "license": "MIT", | ||
}, | ||
"version": "1.2.25", | ||
"version": "1.3.0", | ||
"devDependencies": { | ||
"mf-parser": "^1.4.8" | ||
"mf-parser": "^1.5.0" | ||
}, | ||
"dependencies": { | ||
"chemical-groups": "^1.2.2", | ||
"mf-utilities": "^1.4.2" | ||
"chemical-groups": "^1.3.0", | ||
"mf-utilities": "^1.5.0" | ||
}, | ||
"gitHead": "bd2c06e05f2196c5f9c6ff011cf3ef41e1b6a0f9" | ||
"gitHead": "ade929b07af4e2f0f8b3fe1aaf0df70c50f4b2db" | ||
} |
@@ -1,3 +0,5 @@ | ||
import { generateFragments } from '../generateFragments'; | ||
'use strict'; | ||
const generateFragments = require('../generateFragments'); | ||
describe('addFiveTermBaseLoss', () => { | ||
@@ -4,0 +6,0 @@ it('nucleotide to sequence of HODampDtmpDcmpH', () => { |
@@ -1,3 +0,5 @@ | ||
import { generateFragments } from '../generateFragments'; | ||
'use strict'; | ||
const generateFragments = require('../generateFragments'); | ||
describe('addFiveTermBaseLoss', () => { | ||
@@ -4,0 +6,0 @@ it('nucleotide to sequence of HODampDtmpDcmpH', () => { |
@@ -1,3 +0,5 @@ | ||
import { baseLoss } from '..'; | ||
'use strict'; | ||
const { baseLoss } = require('..'); | ||
describe('baseLoss', () => { | ||
@@ -4,0 +6,0 @@ it('Base loss of HAlaDampDtmpDcmpDcmpOH', () => { |
@@ -1,3 +0,5 @@ | ||
import { baseLossExhaustive } from '../baseLossExhaustive'; | ||
'use strict'; | ||
const baseLossExhaustive = require('../baseLossExhaustive'); | ||
describe('test base loss', () => { | ||
@@ -4,0 +6,0 @@ it('Base loss of HAlaDampDtmpDcmpDcmpOH', () => { |
@@ -1,3 +0,5 @@ | ||
import { ensureUppercaseSequence } from '../ensureUppercaseSequence'; | ||
'use strict'; | ||
const ensureUppercaseSequence = require('../ensureUppercaseSequence'); | ||
describe('ensureUppercaseSequence', () => { | ||
@@ -4,0 +6,0 @@ it('aattccgg', () => { |
@@ -1,5 +0,7 @@ | ||
import { MF } from 'mf-parser'; | ||
'use strict'; | ||
import { furanThreeTerm } from '..'; | ||
const { MF } = require('mf-parser'); | ||
const { furanThreeTerm } = require('..'); | ||
describe('test nucleotide', () => { | ||
@@ -6,0 +8,0 @@ it('remove base of three terminal of HDampDtmpDcmp', () => { |
@@ -1,3 +0,5 @@ | ||
import { generateFragments } from '..'; | ||
'use strict'; | ||
const { generateFragments } = require('..'); | ||
describe('test generate internal fragments', () => { | ||
@@ -4,0 +6,0 @@ it('nucleotide HODampDtmpDcmpDgmpDampH internal abw fragments', () => { |
@@ -1,3 +0,5 @@ | ||
import { generateFragments } from '..'; | ||
'use strict'; | ||
const { generateFragments } = require('..'); | ||
describe('test generate fragments', () => { | ||
@@ -4,0 +6,0 @@ it('nucleotide to sequence of HODampDtmpDcmpH', () => { |
@@ -1,5 +0,7 @@ | ||
import { MF } from 'mf-parser'; | ||
'use strict'; | ||
import { sequenceToMF } from '../sequenceToMF.js'; | ||
const MF = require('mf-parser').MF; | ||
const sequenceToMF = require('../sequenceToMF'); | ||
describe('sequenceToMF', () => { | ||
@@ -6,0 +8,0 @@ it('emtpy string', () => { |
@@ -1,4 +0,6 @@ | ||
import { furanThreeTerm } from './furanThreeTerm.js'; | ||
'use strict'; | ||
export function addFiveTerm(mfs, fiveTerm, i, options) { | ||
const furanThreeTerm = require('./furanThreeTerm'); | ||
function addFiveTerm(mfs, fiveTerm, i, options) { | ||
if (options.a) mfs.push(`${fiveTerm}O-1H-1$a${i}`); // neutral ok | ||
@@ -11,1 +13,3 @@ if (options.ab && i > 1) mfs.push(`${furanThreeTerm(fiveTerm)}$a${i}-B`); // A minus base | ||
} | ||
module.exports = addFiveTerm; |
@@ -1,4 +0,6 @@ | ||
import { baseLoss } from './baseLoss.js'; | ||
'use strict'; | ||
export function addFiveTermBaseLoss(mfs, fiveTerm, i, options) { | ||
const baseLoss = require('./baseLoss'); | ||
function addFiveTermBaseLoss(mfs, fiveTerm, i, options) { | ||
if (!options.abcdBaseLoss) return; | ||
@@ -22,1 +24,3 @@ let loss = baseLoss(fiveTerm); | ||
} | ||
module.exports = addFiveTermBaseLoss; |
@@ -1,6 +0,8 @@ | ||
import { furanThreeTerm } from './furanThreeTerm.js'; | ||
'use strict'; | ||
const furanThreeTerm = require('./furanThreeTerm'); | ||
// https://books.google.ch/books?id=B57e37bJjqAC&pg=PA172&lpg=PA172&dq=oligonucleotide+b+fragmentation&source=bl&ots=mRr29Pexx2&sig=1NUQcWV-wuj6o9q81my86AVoRto&hl=fr&sa=X&ved=2ahUKEwjI5M3yn-7fAhUJMewKHQR6Bcs4ChDoATADegQIBhAB#v=onepage&q=oligonucleotide%20b%20fragmentation&f=false | ||
export function addInternalTerm(mfs, internal, ter3, ter5, options = {}) { | ||
function addInternalTerm(mfs, internal, ter3, ter5, options = {}) { | ||
if (options.aw) { | ||
@@ -28,1 +30,3 @@ // without base loss | ||
} | ||
module.exports = addInternalTerm; |
@@ -1,2 +0,4 @@ | ||
export function addThreeTerm(mfs, threeTerm, i, options) { | ||
'use strict'; | ||
function addThreeTerm(mfs, threeTerm, i, options) { | ||
if (options.w) mfs.push(`HO${threeTerm}$w${i}`); // neutral ok | ||
@@ -8,1 +10,3 @@ if (options.x) mfs.push(`H-1${threeTerm}$x${i}`); // neutral ok | ||
} | ||
module.exports = addThreeTerm; |
@@ -1,4 +0,6 @@ | ||
import { baseLoss } from './baseLoss.js'; | ||
'use strict'; | ||
export function addThreeTermBaseLoss(mfs, threeTerm, i, options) { | ||
const baseLoss = require('./baseLoss'); | ||
function addThreeTermBaseLoss(mfs, threeTerm, i, options) { | ||
if (!options.wxyzBaseLoss) return; | ||
@@ -22,1 +24,3 @@ let loss = baseLoss(threeTerm); | ||
} | ||
module.exports = addThreeTermBaseLoss; |
@@ -1,3 +0,5 @@ | ||
import { mfDiff } from 'mf-utilities'; | ||
'use strict'; | ||
const mfDiff = require('mf-utilities/src/mfDiff'); | ||
const mfLosses = {}; | ||
@@ -18,3 +20,3 @@ ['Amp', 'Tmp', 'Cmp', 'Gmp', 'Ump'].forEach((nucleotide) => { | ||
export function baseLoss(nucleotide) { | ||
function baseLoss(nucleotide) { | ||
// any residue can loose a base | ||
@@ -32,1 +34,3 @@ let results = []; | ||
} | ||
module.exports = baseLoss; |
@@ -1,2 +0,4 @@ | ||
export function baseLossExhaustive(nucleotide) { | ||
'use strict'; | ||
function baseLossExhaustive(nucleotide) { | ||
// any residue can loose a base | ||
@@ -29,1 +31,3 @@ let results = []; | ||
} | ||
module.exports = baseLossExhaustive; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
/** | ||
@@ -6,3 +8,3 @@ * Ensure that the sequence is in uppercase taking into account possible modifications | ||
export function ensureUppercaseSequence(sequence) { | ||
function ensureUppercaseSequence(sequence) { | ||
let parenthesisCounter = 0; | ||
@@ -33,1 +35,3 @@ let parts = []; | ||
} | ||
module.exports = ensureUppercaseSequence; |
@@ -1,2 +0,4 @@ | ||
export function furanThreeTerm(nucleotide) { | ||
'use strict'; | ||
function furanThreeTerm(nucleotide) { | ||
// last residue should become a furan | ||
@@ -17,1 +19,3 @@ let parts = nucleotide | ||
} | ||
module.exports = furanThreeTerm; |
@@ -1,8 +0,10 @@ | ||
import { addFiveTerm } from './addFiveTerm'; | ||
import { addFiveTermBaseLoss } from './addFiveTermBaseLoss'; | ||
import { addInternalTerm } from './addInternalTerm'; | ||
import { addThreeTerm } from './addThreeTerm'; | ||
import { addThreeTermBaseLoss } from './addThreeTermBaseLoss'; | ||
'use strict'; | ||
export function generateFragments(mf, options) { | ||
const addFiveTerm = require('./addFiveTerm'); | ||
const addFiveTermBaseLoss = require('./addFiveTermBaseLoss'); | ||
const addInternalTerm = require('./addInternalTerm'); | ||
const addThreeTerm = require('./addThreeTerm'); | ||
const addThreeTermBaseLoss = require('./addThreeTermBaseLoss'); | ||
module.exports = function generateFragments(mf, options) { | ||
if (options === undefined) { | ||
@@ -73,2 +75,2 @@ options = { | ||
return mfs; | ||
} | ||
}; |
@@ -1,4 +0,8 @@ | ||
export * from './sequenceToMF.js'; | ||
export * from './generateFragments.js'; | ||
export * from './furanThreeTerm.js'; | ||
export * from './baseLoss.js'; | ||
'use strict'; | ||
module.exports = { | ||
sequenceToMF: require('./sequenceToMF'), | ||
generateFragments: require('./generateFragments'), | ||
furanThreeTerm: require('./furanThreeTerm'), | ||
baseLoss: require('./baseLoss'), | ||
}; |
@@ -1,5 +0,7 @@ | ||
import { groups } from 'chemical-groups'; | ||
'use strict'; | ||
import { ensureUppercaseSequence } from './ensureUppercaseSequence'; | ||
const { groups } = require('chemical-groups'); | ||
const ensureUppercaseSequence = require('./ensureUppercaseSequence'); | ||
/** | ||
@@ -14,3 +16,3 @@ * Convert a nucleic sequence to a MF | ||
export function sequenceToMF(sequence, options = {}) { | ||
function sequenceToMF(sequence, options = {}) { | ||
let fivePrimeTerminal = 'HO'; | ||
@@ -127,2 +129,4 @@ let threePrimeTerminal = 'H'; | ||
module.exports = sequenceToMF; | ||
const complementary = { | ||
@@ -129,0 +133,0 @@ A: 'T', |
32816
25
871
Updatedchemical-groups@^1.3.0
Updatedmf-utilities@^1.5.0