Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
This module provides simple mgf file parsing
npm install js-mgf --save
Quickstart example:
var fs = require('fs');
var mgf = require('js-mgf');
var filename = 'test.mgf';
fs.readFile(filename, 'utf8', function(err, data){
if (err) throw err;
spectra = mgf.parse(data);
console.log(spectra);
});
Output:
[ { title: 'First spectrum',
rt: 500,
pepmass: 432,
pepintensity: 12000,
charge: 2,
mz: [ 123, 549, 567, 657 ],
intensity: [ 54, 12, 100, 34 ] },
{ title: 'Second spectrum = something cool',
rt: 510,
pepmass: 679.32,
charge: -3,
mz: [ 123.4, 549.6, 567.8, 657.1 ],
intensity: [ 54.12, 12.89, 100.67, 34.45 ] } ]
Contents of test.mgf
BEGIN IONS
TITLE=First spectrum
RTINSECONDS=500
PEPMASS=432 12000
CHARGE=2+
123 54
549 12
567 100
657 34
END IONS
BEGIN IONS
TITLE=Second spectrum = something cool
RTINSECONDS=510
PEPMASS=679.32
CHARGE=3-
123.4 54.12
549.6 12.89
567.8 100.67
657.1 34.45
END IONS
This module only has the one parse
method and takes as input the text content of an mgf file. This module will read the following information:
title
rt
pepmass
and pepintensity
if the second intensity value is presentcharge
mz
and intensity
arrays.No other fields will be read from the mgf file.
You can run npm test
to run the tests after installing the development dependencies.
No future functionality is planned.
This software is released under the MIT license.
FAQs
A general purpose module for parsing mgf files
The npm package js-mgf receives a total of 6 weekly downloads. As such, js-mgf popularity was classified as not popular.
We found that js-mgf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.