Skip to contents

calculate_peptide_mass() computes the neutral monoisotopic mass of one or more unmodified peptide sequences using residue masses stored in aa_properties. When charge > 0, the function returns monoisotopic m/z values using the proton mass 1.007276 Da.

Usage

calculate_peptide_mass(sequence, charge = 0L)

Arguments

sequence

Peptide sequence supplied as a character vector. Amino-acid codes must be one-letter uppercase or lowercase symbols from the 22 supported residues in aa_properties. If NULL, raises an error.

charge

Optional non-negative integer scalar or integer vector with length matching sequence. Defaults to 0L. 0L returns neutral masses. Positive values return m/z. If NULL, raises an error.

Value

A numeric vector of neutral masses or m/z values. Names are preserved from sequence when present.

Details

This function computes masses for unmodified peptide sequences only. It does not account for chemical labels such as TMT or iTRAQ, isotopic labels such as SILAC, or post-translational modifications.

Limitations

This function computes monoisotopic mass only. Average mass is not supported.

See also

Examples

calculate_peptide_mass("PEPTIDE")
#> [1] 799.36
calculate_peptide_mass(c(a = "PEPTIDE", b = "AAAAAAAR"), charge = 2L)
#>        a        b 
#> 400.6873 336.6930