CMDLINE
CMDLINE
Starting from version 1.0.0.6 (beta), the Lib2NIST library conversion utility can be run from a batch file. This
possibility is reserved for advanced users and is not necessary for most conversions.
Important: In all input text files, lines must end with Carriage Return/Line Feed characters (CRLF, "\r\n")
The following command line options are recognized. Whenever a file name without the path is used as a command
line option, the current path or the default path from the Registry or .INI file is used.
Page 1 of 8
written to this file instead of the Registry. This option prevents Registry from changing.
InputFile or InputLibrary One or more Input datafiles or library names with full pathnames.
This option suppresses normally displayed on startup "Select Input Library or DataFile" dialog and starts
conversion immediately.
Datafiles must have extensions from the following list: .SDF, .MSP, .JDX, .DX, .HPJ, .JX, .JC, .JCM
HP/Agilent MS library folders should have extension “.L”
NIST MS User library is recognized according to the contents of the library directory.
Full pathname overrides .INI and Registry input path settings
INI file setting of [Directory] Input= overrides Registry settings
/UCP option (see below) overrides .INI and Registry input path settings unless full pathname is specified.
=OutputName Set single destination file or library name. No spaces after “=” allowed. .
Write conversion results of all input files and/or libraries to the specified destination. This option creates one
library or datafile out of several input libraries and/or files. The option turns off after the completion of the first
successful conversion. If the name is invalid, then the option is ignored.
=OutputPath\OutputName Set single destination file or library. No spaces after “=” allowed. .
Write conversion results of all input files and/or libraries to the specified destination. This option creates one
library or datafile out of several input libraries and/or files. If OutputPath does not exist it will be created. The
option turns off after the completion of the first successful conversion; however, it overrides .INI file setting of
[Directory] Output= . If the pathname is invalid, then the option is ignored.
/1stID=nnn Set the first output spectrum ID; create sequential IDs. No spaces allowed.
Set the value of the ID of the first spectrum to be converted. All other spectra will have sequential ID values. This
option temporarily overrides ini or Registry [Output]KeepIDs=1 setting and forces the IDs to be written into the
output file(s). This option does not apply to HP-JCAMP output.
Example: /1stID=1500
/NoAlias Do not create a folder with file alias.msd in NIST MS Search folder.
Normally, when Lib2NIST creates a library, it also creates a subfolder in NIST MS Search base folder that
contains file ALIAS.MSD. The only line in this folder is the path pointing to the newly created library. After
NIST MS Search has been restarted, this file provides to the MS Search a link to the new library. The
ALIAS.MSD creation may be prevented in two ways: use /NoAlias option or line NIST=<None> in the Directory
section of the ini file.
/AllowNoPeaks Do not require mass spectral peaks. Useful for creating chemical structure library.
/Z Do not discard mass spectral peaks that have zero abundances; see also /Z:S below.
Page 2 of 8
/KeepAbund Copy original peak abundances from HP/Agilent MS library to the output text file
/StdRounding Round m/z in imported EI spectra to the nearest integer.
/OutLib Output MS Library. Equivalent to Output Format = NIST MS Library)
/OutMSP Output .MSP file. Equivalent to Output Format = Text File (.MSP)
/OutSDF Output SDfile. Equivalent to Output Format = SDFile (.SDF)
/OutJCAMP Output JAMP file. Equivalent to Output Format = HP JCAMP File (.HPJ)
/com2tag Extract and remove tagged expressions1 from the comment. An example of tagged
expression is Ion_type=[M+H]+. Technically, tagged expressions are moved into $:nn-
type synonyms. Supported formats are NIST MS library, text files in MSP and SDF
formats.
/MsmsIncNames In case of MS/MS library output, create MS Search Names window content specific for
NIST 14 MS/MS libraries. Precursor type or in-source spectrum type entries in the
spectra are required. Incompatible with /PepIncNames option.
/PepIncNames In case of MS/MS library output, create MS Search Names window content specific for
NIST Tandem Peptide Libraries. Incompatible with /MsmsIncNames option.
/MSKEY=ms_label /SDFKEY=sdf_label Merge linked mass spectral file and SDfile into one output. No spaces
around “=” allowed
Convert mass spectral data from .MSP or JCAMP format and data (including structures) from the linked to it
SDfile. ms_label and sdf_label in the command line should be substituted with corresponding labels located in
the input files.
The SDfile must have the same name as the mass spectral datafile and have extension .SDF; it should be located
in the same directory as the mass spectral datafile.
Mass spectra and SDfile data blocks are linked into pairs by character-to-character identical ms-value and
sdf-value located within them:
and
Leading and trailing spaces in ms-value and sdf-value are ignored. Letter case is not ignored.
Names of the labels ms_label, sdf_label should not contain white spaces, ?, /, +, -, <, >,(, ), [,
], |, *, or punctuation characters ( , ; : ).
One SDfile block can be linked to several mass spectra.
1 In /com2tag mode, tagged expressions are expected to have format Tag=value or Tag="value" and are separated by spaces.
Inside the tagged expression, spaces are allowed only in the quoted value. Letter case in the Tag is ignored. Accepted tags are
AUX, Charge, Collision_energy or CollisionV, Collision_gas, Compound_type, Cone_voltage or In-source_voltage or ConeV,
Instrument, Instrument_type, Ion_Formula, Ion_mode, Ion_MW, Ion_name, Ionization, Known_impurity, Mass_range,
Maximum_intensity, Peptide_mods or Mods, Peptide_sequence, Precursor_m/z or Mz_exact, Precursor_type, Pressure,
Related_CAS#, Salt, Salt/mix_CAS#, Sample_inlet, Special_fragmentation, Spectrum_type. MW with a decimal point and value
1 is interpreted as exact mass. If the same tag is already present in the spectrum then it is not extracted and left in the
comment.
Page 3 of 8
Example: Word NAME can serve as an example of both ms_label and sdf_label if names in the mass spectra and
SDfile blocks can be used for linking, that is, are identical and unique. In this case, word HYDROGEN could be
both ms-value and sdf-value to link hydrogen mass spectrum and structure together.
Minimal set of command line options to add structures from str.SDF to inp.SDF and write results to out.SDF:
/OutSdf /CopySdf2Sdf "inp.SDF" "=out.SDF" "/StructSource=str.SDF" /MSKEY=inp_label /SDFKEY=str_label
where labels inp_label are in inp.SDF, str_label - in str.SDF. Double quotes are used to allow spaces inside.
inp.SDF, out.SDF, str.SDF may be full pathnames to SDFiles.
/msp2peplib Convert NIST peptide library MSP file (typically, *_consensus_final_true_lib.MSP) into
a peptide MS/MS library. Implies options /IncludeSynonyms:Y /KeepIDs:N
/MwFromFormula:N /MsmsOnly:Y /Msms2008-Compat:N /UseSubset:N /Z
/NOEXTRA /StdRounding /OutLib. It is not advisable to change these options. Option
/msp2peplib sorts library spectra by precursor m/z values for faster searching, shortens
protein names, truncates lists of homologues, encodes references and removes unused
ones into an overflow file. It creates two peptide library-specific files, "references.txt"
and "overflow.txt". Created in the library folder file "__log.txt" may be safely deleted.
/MspLinkedByNISTrn Add "Text File (.MSP) + MOLfiles linked by NIST#" option to Output Format drop
down list box, which creates molfiles named N<NIST r.n.>.MOL. When converting a
filename.MSP file accompanied by filename.MOL folder containing molfiles, the
molfiles are picked up according to (1) NIST r.n., (2) CAS r.n., (3) ID number.
/PeakMzDecPlaces=n Round peak m/z values to n decimal places. This may be overridden in the input MSP or
SDF file2; n = keep means do not change m/z values by removing trailing zeroes
/PrecurMzDecPlaces=n Round precursor m/z values to n decimal places. n = keep means do not change m/z
values by removing trailing zeroes
/AccuratePeakMZ In MS/MS Spectra Only mode (also set by /MsmsOnly:S option), accurate peak m/z and
intensities in the range 0.01-999 are saved in a MS/MS library even though a spectrum
does not have precursor m/z and Spectrum type does not begin with in-source or
accurate 3. The integer m/z peaks used for EI search are saved as for an EI spectrum.
In options below, S is letter Y or N
/IncludeSynonyms:S Same as “Include Synonyms” check box in Options dialog.
2 For example, to set maximal number of peak m/z decimal places to 4 in a MSP file spectrum, include in the spectrum line
Max_m/z_decimal_places: 4
Include in SDfile the following 2 lines followed by a blank line in a SDfile spectrum:
> <MAX M/Z DECIMAL PLACES>
4
Note that this entry, as well as precursor m/z entry must precede mass spectral peaks.
3In an MSP file, line Spectrum_type: in-source or Spectrum_type: accurate makes Lib2NIST save the accurate product peak m/z
even though the spectrum does not have precursor m/z. In an SDfile, the following 3 lines
> <SPECTRUM TYPE>
in-source
(the 3rd line is blank) have the same effect. This line should be located before the peak list. In these cases, integer m/z peaks
used for EI search are saved as if the spectrum were MS/MS.
Page 4 of 8
/KeepIDs:S 4 Same as “KeepIDs Unchanged” check box in Options dialog.
/MakeInChIKeys:S Calculate InChIKey from each input chemical structure, add it to the spectrum, and use it
for indexing output library. Default:Y except JCAMP output. In case of N, InChIKey, if
present in the input spectrum, is used for indexing. If no InChIKeys were found or
created, file inchikey.inu contains strings “None” instead of missing InChIKeys..
/MwFromFormula:S Same as “MW from chem. formula” check box in Options dialog.
/MsmsOnly:S Same as “MS/MS spectra only” check box in Options dialog. Create MS/MS or in-source
library
/Msms2008-Compat:S Same as “2008 MS Search compatible” check box in Options dialog.
/UseSubset:S Same as check box “Use subset”.
/Z:S Y – the same as /Z. N – discard mass spectral peaks that have zero abundances even
though the spectra are treated as MS/MS
/TranslateTextInput:S Y – apply character translation table from HPTRANS.TBL file to text input file(s)
(Default). N – do not apply (behavior before v.1.0.4.26.)
Concurrency issues
Since Lib2NIST normally reads and stores conversion parameters into the Windows Registry, two instances of
Lib2NIST running simultaneously may interfere with unpredictable consequences. To avoid this, each copy of
Lib2NIST may be run with its own .INI file. Lib2NIST running with .INI file does not change contents of the
Registry. Lib2NIST reads from the Registry only if the needed conversion parameter is missing from the specified
in the command line .INI file.
If the amount of data to be converted is significant, it may be convenient to run Lib2NIST at low priority in case of a
single core processor. To do that you may run it from the batch file using “START” command:
Example
The following example shows how to transform HP/Agilent MS library C:\Mylib.L into the NIST User library
Mylib.HP located in the C:\NIST98\MSSEARCH directory
4 S=Y is ignored, as well as “KeepIDs Unchanged” check box in Options dialog, when creating a read-only (e.g. MS/MS) library.
To override, use /KeepIDs=Yes. However, note that in this case the conversion will fail if it encounters spectrum ID = 65,536×N,
where N=1, 2, 3, ... or two equal IDs. If input spectra do not have IDs, not more than 65,535 spectra may be converted into a
library.
Page 5 of 8
/log9: Lib2NIST will produce the most detailed output to the logfile
Mylib.log the logfile Mylib.log will be located in the current directory
Mylib.ini Lib2NIST will read conversion options from Mylib.ini located in the current directory
C:\Mylib.L Input HP/Agilent type library location
c:\nist11\mssearch\ the result will be directed to this directory
Mylib.ini contents:
[Directory]
NIST=C:\NIST98\MSSEARCH
[Output]
Text=0
TextFileType=0
DB=1
CalcMW=1
IncludeSynonyms=1
KeepIDs=1
LinkMOLfile=0
MzAdd=0
MzMpy=1
NeedSubset=0
Without .ini file the same may be accomplished by the following command line options:
Currently, there is no command line option to set or ignore previously saved linking to molfiles
;==============================================
; Lib2NIST.ini contents explanations
; Lines starting with semicolons are comments.
;==============================================
;==============================================
[Directory]
;==============================================
Page 6 of 8
; NIST MS Search base directory (where alias.msd goes) or <None>
NIST=S:\NIST98\MSSEARCH
;NIST=<None>
;==========================================
[Output]
;==========================================
; 0=>Auto Assign IDs (1,2,3,...), 1=> get IDs from the input
KeepIDs=0
; 1=>Output MS/MS library is compatible with 2008 MS Search; 0=>Compatible with newer software
Msms2008-Compat=1
;==========================================
[Subset]
;==========================================
Page 7 of 8
; 1=>apply subset to all input
; 0=>to the 1st input file or library only, then ask.
ForAll=1
Page 8 of 8