calculateFragments: Calculate ions produced by fragmentation with variable...

calculateFragmentsR Documentation

Calculate ions produced by fragmentation with variable modifications

Description

This method calculates a-, b-, c-, x-, y- and z-ions produced by fragmentation.

Available methods

  • The default method with signature sequence = "character" and object = "missing" calculates the theoretical fragments for a peptide sequence. It returns a data.frame with the columns mz, ion, type, pos, z, seq and peptide.

  • Additional method can be defined that will adapt their behaviour based on spectra defined in object. See for example the MSnbase package that implements a method for objects of class Spectrum2.

Usage

## S4 method for signature 'character,missing'
calculateFragments(
  sequence,
  type = c("b", "y"),
  z = 1,
  fixed_modifications = c(C = 57.02146),
  variable_modifications = numeric(),
  max_mods = Inf,
  neutralLoss = defaultNeutralLoss(),
  verbose = TRUE,
  modifications = NULL
)

Arguments

sequence

character() providing a peptide sequence.

type

character vector of target ions; possible values: c("a", "b", "c", "x", "y", "z"). Default is type = c("b", "y").

z

numeric with a desired charge state; default is 1.

fixed_modifications

A named numeric vector of used fixed modifications. The name must correspond to the one-letter-code of the modified amino acid and the numeric value must represent the mass that should be added to the original amino accid mass, default: Carbamidomethyl modifications = c(C = 57.02146). Use Nterm or Cterm as names for modifications that should be added to the amino respectively carboxyl-terminus.

variable_modifications

A named numeric vector of variable modifications. Depending on the maximum number of modifications (max_mods), all possible combinations are returned.

max_mods

A numeric indicating the maximum number of variable modifications allowed on the sequence at once. Does not include fixed modifications. Default value is positive infinity.

neutralLoss

list, it has to have two named elments, namely water and ammonia that contain a character vector which type of neutral loss should be calculated. Currently neutral loss on the C terminal "Cterm", at the amino acids c("D", "E", "S", "T") for "water" (shown with an ⁠_⁠) and c("K", "N", "Q", "R") for "ammonia" (shown with an *) are supported.

There is a helper function `defaultNeutralLoss()` that returns
the correct list. It has two arguments `disableWaterLoss` and
`disableAmmoniaLoss` to remove single neutral loss options. See
the example section for use cases.
verbose

logical(1). If TRUE (default) the used modifications are printed.

modifications

Named numeric(). Deprecated modifications parameter. Will override fixed_modifications but is set to NULL by default. Please refrain from using it, opt for fixed_modifications instead.

Value

A data.frame showing all the ions produced by fragmentation with all possible combinations of modifications. The used variable modifications are displayed in the peptide column through the use of amino acids followed by the modification within brackets. Fixed modifications are not displayed.

Author(s)

Sebastian Gibb mail@sebastiangibb.de

Guillaume Deflandre guillaume.deflandre@uclouvain.be

Examples

## General use
calculateFragments(sequence = "ARGSHKATC", type = c("b", "y"), z = 1, 
fixed_modifications = c(C = 57), variable_modifications = c(S = 79, Y = 79, T = 79),
max_mods = 2)

## calculate fragments for ACE with default modification
calculateFragments("ACE", fixed_modifications = c(C = 57.02146))

#' ## calculate fragments for ACE with an added variable modification
calculateFragments("ACE", variable_modifications = c(A = 43.25))

## calculate fragments for ACE with an added N-terminal modification
calculateFragments("ACE", fixed_modifications = c(C = 57.02146, Nterm = 229.1629))

## calculate fragments for ACE without any modifications
calculateFragments("ACE", fixed_modifications = NULL)

calculateFragments("VESITARHGEVLQLRPK",
                   type = c("a", "b", "c", "x", "y", "z"),
                   z = 1:2)

## neutral loss
defaultNeutralLoss()

## disable water loss on the C terminal
defaultNeutralLoss(disableWaterLoss="Cterm")

## real example
calculateFragments("PQR")
calculateFragments("PQR",
                   neutralLoss=defaultNeutralLoss(disableWaterLoss="Cterm"))
calculateFragments("PQR",
                   neutralLoss=defaultNeutralLoss(disableAmmoniaLoss="Q"))

## disable neutral loss completely
calculateFragments("PQR", neutralLoss=NULL)
 

rformassspectrometry/PSM documentation built on Jan. 23, 2025, 1:05 p.m.