Learn R Programming

powerHaDeX (version 1.0)

plot_spectra: Draw mass spectra

Description

Graphical visualization of mass spectra obtained using the function simulate_theoretical_spectra.

Usage

plot_spectra(
  spectra,
  time_points = unique(spectra[["Exposure"]]),
  charges = unique(spectra[["Charge"]]),
  control_time = FALSE,
  ...
)

Arguments

spectra

data table. Result of simulate_theoretical_spectra.

time_points

vector of values of exposure times to be displayed on the plot. Default unique(spectra[["Exposure"]]).

charges

vector of charges to be displayed on the plot. Default unique(spectra[["Charge"]]).

control_time

logical. Indicates whether the spectrum at the control time (conventionally equal to 0) should be drawn.

...

additional arguments passing to the theme.

Value

ggplot object

Details

This function draws mass spectra from data obtained via simulate_theoretical_spectra.

Examples

Run this code
# NOT RUN {
theo_spectra <- simulate_theoretical_spectra(sequence = "LVRKDLQN",
                                             charge = c(3, 5),
                                             protection_factor = 100,
                                             times = c(0.167, 5),
                                             pH = 7.5,
                                             temperature = 15,
                                             n_molecules = 500,
                                             time_step_const = 1,
                                             use_markov = TRUE)

plot_spectra(theo_spectra)

# }

Run the code above in your browser using DataLab