Learn R Programming

powerHaDeX (version 1.0)

add_noise_to_spectra: Creates spectra with technical replicates and noise

Description

Creates spectra with technical replicates and noise

Usage

add_noise_to_spectra(
  spectra,
  n_replicates = 4,
  n_experiments = 100,
  undeuterated_mass,
  mass_deviations = 50,
  intensity_deviations = NULL
)

Arguments

spectra

list created by the get_spectra_list function

n_replicates

number of technical replicates to create

n_experiments

number of replicates of an experiment for power calculation.

undeuterated_mass

the value of mass of an undeuterated peptide computed by get_undeuterated_mass.

mass_deviations

mass deviation in parts per million. Either a single number (then the error at each time point will be the same) or a vector of the same length as number of unique time points in the experiment. The error will be sampled from normal distribution with standard deviation equal to $$mass_deviations * undeuterated_mass/1e6$$ Default to 50.

intensity_deviations

optional, standard deviations of random noise that will be added to intensities. Either a single number (then the error at each time point will be the same) or a vector of the same length as number of unique time points in the experiment. The error will be sampled from normal distribution with these standard deviations.Default NULL.

Value

list of lists of data.tables

Details

This function uses make_experimental_design and make_noisy_spectra.