For each value \(z\) in charge_states, the function calculates

  • the corresponding mass-to-charge ratio \(m / z + m_c\) (\(m_c\): charge agent mass);

  • upper and lower tolerances for this ratio, so that these values form a window of width \(mz \times ppm / 10^6\) centered at \(mz\).

ionize(p, charge_states, ppm = 400, charge_agent_mass = NULL)

Arguments

p

A data frame describing proteoform masses (see details).

charge_states

Vector of charge states for which m/z values should be calculated.

ppm

Width of the m/z window in parts per million.

charge_agent_mass

Mass of the charge carrier. If NULL, use the average IUPAC mass of the proton.

Value

A data frame containing all columns of the input data frame plus four additional columns: z (charge state), mz (exact mass-to-charge ratio), mz_min, and mz_max. The latter two columns represent lower and upper tolerances for the mass-to-charge ratio and are used as integration boundaries by quantify_ions(). If the supplied data frame has \(r\) rows and \(c\) charge states were specified, the resulting data frame has \(r * c\) rows.

Details

The data frame passed to the first argument must contain at least one column named mass; each of its value represents the mass of a single proteoform. The data frame may contain any number of additional columns, which will be returned unchanged.

Examples

masses <- data.frame(name = c("p1", "p2"), mass = c(140000, 145000)) ionize(masses, 36L:40L)
#> # A tibble: 10 x 6 #> name mass z mz mz_min mz_max #> <chr> <dbl> <int> <dbl> <dbl> <dbl> #> 1 p1 140000 36 3890. 3889. 3891. #> 2 p1 140000 37 3785. 3784. 3786. #> 3 p1 140000 38 3685. 3684. 3686. #> 4 p1 140000 39 3591. 3590. 3591. #> 5 p1 140000 40 3501. 3500. 3502. #> 6 p2 145000 36 4029. 4028. 4030. #> 7 p2 145000 37 3920. 3919. 3921. #> 8 p2 145000 38 3817. 3816. 3818. #> 9 p2 145000 39 3719. 3718. 3720. #> 10 p2 145000 40 3626. 3625. 3627.