You can use this script with the following example:
Rscript inst/scripts/prepare_libraries_spectra.R --fil-lib-spe-raw data/source/libraries/spectra/exp/spectral_lib_mini_with_rt.mgf --names-lib internal --ms-pol pos

Usage:
  prepare_libraries_spectra.R [--fil-lib-spe-raw=<fil-lib-spe-raw>] [--names-lib=<names-lib>] [--ms-pol=<ms-pol>] [--names-mgf-ce=<names-mgf-ce>] [--names-mgf-ci=<names-mgf-ci>] [--names-mgf-em=<names-mgf-em>] [--names-mgf-in=<names-mgf-in>] [--names-mgf-io=<names-mgf-io>] [--names-mgf-ik=<names-mgf-ik>] [--names-mgf-il=<names-mgf-il>] [--names-mgf-mf=<names-mgf-mf>] [--names-mgf-na=<names-mgf-na>] [--names-mgf-po=<names-mgf-po>] [--names-mgf-sm=<names-mgf-sm>] [--names-mgf-sn=<names-mgf-sn>] [--names-mgf-si=<names-mgf-si>] [--names-mgf-sp=<names-mgf-sp>] [--names-mgf-sy=<names-mgf-sy>] [--names-mgf-xl=<names-mgf-xl>] [--names-precursor=<names-precursor>] [--names-rt-lib=<names-rt-lib>] [--names-source=<names-source>] [--names-target=<names-target>] [--names-taxon=<names-taxon>]

Arguments:
  fil-lib-spe-raw            List of experimental raw spectral libraries. STRING

  ms-pol                     Polarity used. Must be "pos" or "neg". STRING

  names-lib                  Metadata to identify the library. STRING
  names-mgf-ad               Name of "adduct" in MGF. STRING
  names-mgf-ce               Name of "collision energy" in MGF. STRING
  names-mgf-ci               Name of "compound ID" in MGF. STRING
  names-mgf-em               Name of "exact mass" in MGF. STRING
  names-mgf-in               Name of "InChI" in MGF. STRING
  names-mgf-io               Name of "InChI without stereo" in MGF. STRING
  names-mgf-ik               Name of "InChIKey" in MGF. STRING
  names-mgf-il               Name of "InChIKey without stereo" in MGF. STRING
  names-mgf-mf               Name of "molecular formula" in MGF. STRING
  names-mgf-na               Name of "name" in MGF. STRING
  names-mgf-po               Name of "polarity" in MGF. STRING
  names-mgf-sm               Name of "SMILES" in MGF. STRING
  names-mgf-sn               Name of "SMILES without stereo" in MGF. STRING
  names-mgf-si               Name of "spectrum ID" in MGF. STRING
  names-mgf-sp               Name of "SPLASH" in MGF. STRING
  names-mgf-sy               Name of "synonyms" in MGF. STRING
  names-mgf-xl               Name of "xlogp" in MGF. STRING
  names-precursor            Name of "precursor m/z" variable in the input. STRING
  names-rt-lib               Name of "retention time" variable (lib) in the input. STRING
  names-source               Name of "source IDs" variable in the input. STRING
  names-target               Name of "target IDs" variable in the input. STRING
  names-taxon                Name of the "taxon name" variable in the input. STRING

Options:
  -h --help                  Shows this screen.
  -v --version               Shows version.
