# get-ms2-spectrum

## Usage:

`crux get-ms2-spectrum [options] <ms2 file>`

## Description:

Extract one or more MS-MS spectra from an MS2 file by scan number. Optionally output summary statistics for each spectrum.

## Input:

- `ms2 file` – The name of one or more files from which to parse the fragmentation spectra, in any of the file formats supported by ProteoWizard.

## Output:

- `stdout` – the requested spectrum or spectra in MS2 format.

## Options:

- ### get-ms2-spectrum options

  - `--stats T|F` – Rather than the spectrum, output summary statistics to standard output. Each statistic is placed on a separate line, in the format : (e.g. "TIC:1000.0").
    The following statistics are reported for the entire spectrum:
    - Precursor m/z
    - Total Ion Current
    - Base Peak Intensity
    - Number of peaks
    - Minimum m/z
    - Maximum m/z
    In addition, for each possible spectrum charge state, the following statistics are reported:
    - Charge state
    - Neutral mass
    - Charged mass
    - M+H+ mass
    Default = `false`.

- ### Search parameters

  - `--scan-number <string>` – A single scan number or a range of numbers to be searched. Range should be specified as 'first-last' which will include scans 'first' and 'last'. Default = `<empty>`.
  - `--remove-precursor-tolerance <float>` – This parameter specifies the tolerance (in Th) around each precursor m/z that is removed when the --remove-precursor-peak option is invoked. Default = `1.5`.

- ### Input and output

  - `--verbosity <integer>` – Specify the verbosity of the current processes. Each level prints the following messages, including all those at lower verbosity levels: 0-fatal errors, 10-non-fatal errors, 20-warnings, 30-information on the progress of execution, 40-more progress information, 50-debug info, 60-detailed debug info. Default = `30`.
  - `--spectrum-parser pwiz|mstoolkit` – Specify the parser to use for reading in MS/MS spectra. The default, ProteoWizard parser can read the MS/MS file formats listed here. The alternative is MSToolkit parser. If the ProteoWizard parser fails to read your files properly, you may want to try the MSToolkit parser instead. Default = `pwiz`.
  - `--use-z-line T|F` – Specify whether, when parsing an MS2 spectrum file, Crux obtains the precursor mass information from the "S" line or the "Z" line. Default = `true`.