% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PTM-variable.R
\name{addVariableModifications}
\alias{addVariableModifications}
\title{Add variable modifications}
\usage{
addVariableModifications(
  sequences,
  variableModifications = NULL,
  maxMods = Inf
)
}
\arguments{
\item{sequences}{Character vector. Peptide sequences that may have
modifications or not.}

\item{variableModifications}{Named `numeric` or `character`. If a
`character` is given, values must be in UniMod name or UniMod ID format
(e.g. `"Phospho"`, `"UNIMOD:21"`). The annotation style of the values is
preserved in the output.
Specifies which variable modifications are used on which amino acids.
Supplying multiple modifications for the same amino acid is not supported;
call the function consecutively instead:
\preformatted{
  seq |>
    addVariableModifications(c(T = "+57.024")) |>
    addVariableModifications(c(T = "Phospho"))
}}

\item{maxMods}{Numeric. Indicates how many modifications can be applied
at once.}
}
\value{
A named list of character vectors with all possible combinations
of modifications, one element per input sequence.
}
\description{
Generates all possible combinations of variable modifications
for peptide sequences.

The annotation style of modifications already present in `sequences` is
preserved as-is.  The annotation style of newly applied modifications
matches the style supplied in `variableModifications`: numeric values
produce deltaMass notation (e.g. `[+79.966331]`), while character values
are used verbatim (e.g. `[Phospho]` or `[UNIMOD:21]`).
}
\examples{
addVariableModifications(
    "APGHKA",
    variableModifications = c(A = 4, K = 5, S = 8),
    maxMods = 2
)
addVariableModifications(
    "APGHKA",
    variableModifications = c(A = 4, K = 5, S = 8),
    maxMods = 3
)
addVariableModifications(
    c("ATK", "PAK"),
    variableModifications = c(T = "Phospho", A = "UNIMOD:1")
)
addVariableModifications(
    "A[+10]KT[-5]",
    variableModifications = c(A = -20, T = "Phospho")
)

## Apply two modifications to the same residue consecutively
"ATK" |>
    addVariableModifications(c(T = "+57.024")) |>
    addVariableModifications(c(T = "Phospho"))
}
\author{
Guillaume Deflandre <guillaume.deflandre@uclouvain.be>
}
