Library Conversion Tool


The LIB2NIST converter can convert


It is possible to convert a subset of spectra, as specified by ID numbers or CAS registry numbers.


The m/z values from text input files can be subject to a specified rounding transformation, usually to reduce reported m/z to integer (nominal) values.

Deselect "Include synonyms" options to omit chemical name synonyms in the output

Deselect "Keep IDs unchanged" to make sure the IDs in the newly created user library are sequential numbers (1, 2, 3,...)

Select "MS/MS spectra only" to process MS/MS spectra

"2008 MS Search compatible" option is for backward compatibility only. It degrades functionality of more recent software. Select this option to create a MS/MS library for use with NIST MS Search program obtained with NIST 08 MS Library.

For more details on the .MSP file structure see NIST MS Search User Guide, section "NIST Text Format of Individual Spectra."

For details of the JCAMP-DX file formats see: P. Lampen, H. Hilling et al, "JCAMP-DX for Mass Spectrometry", Applied Spectroscopy, 1994, 48 No. 12, 1545-1552.

The converter recognizes only (XY..XY) type peak tables.

For more details on MOLfiles and SDFiles see article A. Dalby, J. G. Nourse et al, J. Chem. Inf. Comput. Sci., 1992, 32, 244-255.

Only generic [G] MOLfile features are recognized by the software.

User MS Library Limitations

MS/MS Library Features

Import/Export of Synonyms

Files SYNON.MSP and SYNON.JDX are examples of the converter input files to illustrate how compound name synonyms can be added to the user mass spectral library.

Synonyms in the user libraries are supported by NIST MS Search Program starting from version 1.7.

To export synonyms to NIST user library or .MSP format make sure the "Include Synonyms" option is selected.

Synonyms cannot be exported to a HP-JCAMP file.

Import of Structures from MOLfiles

Molecular structures located in separate MOLfiles can be associated with the spectra located in a single .MSP file and converted into the user library.

To achieve this the MOLfiles should have predefined names and be located in the folder with same name as the name of the input .MSP file and extension .MOL.

MOLfile names

To associate a MOLfile with a compound having, for example, CAS reg. number 50555, the MOLfile should have name s50555.mol

To associate a MOLfile with a compound having, for example, ID=15 (15 is either an ordering number of the spectrum in the .MSP file or the spectrum in the .MSP file has line "ID: 15" or a spectrum in the input library has ID = 15), the MOLfile should have the name id15.mol

MOLfile location

The folder containing MOLfiles should be located in the folder where .MSP file is. For example, if .MSP file is C:\NIST11\MYSPECS.MSP then the folder with MOLfiles MUST be C:\NIST11\MYSPECS.MOL and contain files like C:\NIST11\MYSPECS.MOL\s50555.mol C:\NIST11\MYSPECS.MOL\id15.mol

When converting any .MSP file the converter always looks for a folder with a name derived from the name of the .MSP file. In the case 2 MOLfiles are associated with the particular spectrum (one by CAS reg. number, another by ID) the converter ignores the former and picks up the latter MOLfile.

The names and locations described above are exactly the same as those the converter would produce when converting to a text file in .MSP format with structures saved in MOLfiles.

Other examples

Files TEXTSAMP.MSP and STRUSAMP.SDF are sample input text files for the LIB2NIST converter. They represent two of the text file types recognized by the present version of the LIB2NIST library converter.

TEXTSAMP.MSP is self-explanatory. In addition to a mass spectrum and a name, this kind of file may contain a CAS rn, a formula, and a nominal molecular weight.

Please note the STRUSAMP.SDF format is rather strict. In consists of a series of MOLfiles. A record for each compound is made out of 5 parts, the first of them (structure) may have no atoms or bonds:

  1. Chemical structure in MOL-file format (may have no atoms or bonds)

    The first line (name) and the third line (comment) will be replaced before saving molfile into the NIST User MS library.

    If molfile contains aromatic bonds (type=4), the converter will transform them into alternate single/double bonds and completely change the whole molfile before saving it into the NIST User MS library. Aromatic bonds may be only in even-member rings.

  2. One line separating molfile from mass spectral data part:


  3. Mass spectrum in ASCII form, same as in TEXTSAMP.MSP. It cannot have blank lines.
  4. One blank line.
  5. One line marking the end of the record for the compound: $$$$

Please note there are no blank lines between "$$$$" line and the first line of the next record.

STRUSAM2.SDF was created by Lib2NIST from STRUSAMP.SDF. It is an example of an alternate SDF file format. This format is also recognized by the LIB2NIST.

msms_spectrum.MSP and msms_spectrum.SDF are examples of MSP and SDF files containg MS/MS spectra. A MS/MS spectrum file must have precursor m/z value. Examples of MSP files containing peptide MS/MS spectra may be found here: This site uses term "Library" for MSP files.


The LIB2NIST mass spectral data conversion program consists of the following files (which are contained in a ZIP archive):

lib2nist.exe the conversion program
ctNT66.dll part of conversion program
zlib1.dll part of conversion program
hptrans.tbl transliteration table used by Lib2NIST
synon.jdx JCAMP-DX file example, includes synonyms
synon.MSP MSP file example, includes synonyms
Textsamp.msp compound MSP file example
Strusamp.sdf SDFile chemical structure example
Strusam2.sdf alternate SDFile format
msms_spectrum.MSP example of a MS/MS spectrum
msms_spectrum.SDF example of a MS/MS spectrum
CMDLINE.pdf explains LIB2NIST command line options
Readme_lib2NIST.txt description of the program

Download LIB2NIST (version  build 07/02/2012)

This page was last updated   07/05/2012.