# lfq

## Usage:

`crux lfq [options] <lfq-peptide-spectrum matches> <spectrum files>`

## Description:

This command reads a set of PSMs and a corresponding set of spectrum files and carries out label-free quantification (LFQ) for each detected peptide.The algorithm follows that of FlashLFQ: Millikin RJ, Solntsev SK, Shortreed MR, Smith LM. "Ultrafast Peptide Label-Free Quantification with FlashLFQ."Journal of Proteome Research. 17(1):386-391, 2018.

## Input:

- `lfq-peptide-spectrum matches` – A file in mzTab or Percolator tab-delimited format listing peptide-spectrum matches.
- `spectrum files` – The name of one or more files from which to parse the MS1 spectra, in any of the file formats supported by ProteoWizard.

## Output:

The program writes files to the folder `crux-output` by default. The name of the output folder can be set by the user using the `--output-dir` option. The following files will be created:

- `crux-lfq-mod-pep.txt` – A tab-delimited text file in which rows are peptides, columns correspond to the different spectrum files, and values are peptide quantifications. If a peptide is not detected in a given run, then its corresponding quantification value is NaN.
- `crux-lfq-peaks.txt` – A tab-delimited text file in which rows are peaks, columns correspond to meta-data about the peaks
- `crux-lfq.params.txt` – A file containing the name and value of all parameters/options for the current operation. Not all parameters in the file may have been used in the operation. The resulting file can be used with the --parameter-file option for other Crux programs.
- `crux-lfq.log.txt` – A log file containing a copy of all messages that were printed to the screen during execution.

## Options:

- ### lfq options

  - `--specfile-replicates <string>` – The file containing spectrum file replicates used in normalization. Default = `<empty>`.

- ### Amino acid modifications

  - `--mods-spec <string>` – The general form of a modification specification has three components, as exemplified by 1STY+79.966331.
    The three components are: [max_per_peptide]residues[+/-]mass_change
    In the example, max_per_peptide is 1, residues are STY, and mass_change is +79.966331. To specify a static modification, the number preceding the amino acid must be omitted; i.e., C+57.02146 specifies a static modification of 57.02146 Da to cysteine. Note that Tide allows at most one modification per amino acid. Also, the default modification (C+57.02146) will be added to every mods-spec string unless an explicit C+0 is included. Default = `C+57.02146`.
  - `--nterm-peptide-mods-spec <string>` – Specify peptide n-terminal modifications. Like --mods-spec, this specification has three components, but with a slightly different syntax. The max_per_peptide can be either "1", in which case it defines a variable terminal modification, or missing, in which case the modification is static. The residues field indicates which amino acids are subject to the modification, with the residue X corresponding to any amino acid. Finally, added_mass is defined as before. Default = `<empty>`.
  - `--cterm-peptide-mods-spec <string>` – Specify peptide c-terminal modifications. See nterm-peptide-mods-spec for syntax. Default = `<empty>`.

- ### CPU threads

  - `--num-threads <integer>` – 0=poll CPU to set num threads; else specify num threads directly. Default = `1`.

- ### Input and output

  - `--fileroot <string>` – The fileroot string will be added as a prefix to all output file names. Default = `<empty>`.
  - `--output-dir <string>` – The name of the directory where output files will be created. Default = `crux-output`.
  - `--overwrite T|F` – Replace existing files if true or fail when trying to overwrite a file if false. Default = `false`.
  - `--parameter-file <string>` – A file containing parameters. See the parameter documentation page for details. Default = `<empty>`.
  - `--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`.

- ### crux-lfq

  - `--num-isotopes-required <integer>` – The number of isotopic peaks required to be present in the spectrum for a peptide to be considered. Default = 2. Default = `2`.
  - `--peak-finding-ppm-tolerance <float>` – The tolerance (in ppm) used to find isotopic peaks. Default = 20.0. Default = `20`.
  - `--ppm-tolerance <float>` – The tolerance (in ppm). Default = 10.0. Default = `10`.
  - `--id-specific-charge-state T|F` – Indicate whether to use the charge state of the peptide-spectrum match (T) or the charge state of the peptide (F) when computing the theoretical m/z values. Default = F. Default = `false`.
  - `--missed-scans-allowed <integer>` – The number of scans allowed to be missing between the scans containing the isotopic peaks. Default = 1. Default = `1`.
  - `--isotope-tolerance-ppm <float>` – The tolerance (in ppm) used to determine whether two peaks are isotopic. Default = 5.0. Default = `5`.
  - `--integrate T|F` – Indicate whether to integrate the area under the curve (T) or use the maximum intensity (F) when computing the intensity of the isotopic peaks. Default = F. Default = `false`.
  - `--discrimination-factor-to-cut-peak <float>` – The factor by which the intensity of the isotopic peak must be greater than the intensity of the next highest peak in order to be considered a true peak. Default = 6.0. Default = `0.6`.
  - `--quantify-ambiguous-peptides T|F` – Indicate whether to quantify peptides that are not unique to a single protein (T) or not (F). Default = F. Default = `false`.
  - `--use-shared-peptides-for-protein-quant T|F` – Indicate whether to use peptides that are shared between proteins when quantifying proteins (T) or not (F). Default = F. Default = `false`.
  - `--normalize T|F` – Indicate whether to normalize the intensities of the peptides (T) or not (F). Default = F. Default = `false`.
  - `--psm-file-format <string>` – The format of the PSM file. Possible options are; tide-search and assign-confidence Default = assign-confidence. Default = `assign-confidence`.
  - `--is-rt-seconds T|F` – Indicate whether retention time is in seconds or minutes (T) or not (F). Default = F. Default = `false`.
  - `--lfq-q-value-threshold <float>` – The q-value threshold used by Default = `0.01`.
  - `--is-psm-filtered T|F` – Indicate whether the PSM file is filtered or not (T) or not (F). Default = F. Default = `false`.