calculate_hdx_power: Calculate power of statistical tests for HDX experiments

View source: R/power.R

calculate_hdx_powerR Documentation

Calculate power of statistical tests for HDX experiments

Description

This function estimates power of statistical tests for HDX experiments.

Usage

calculate_hdx_power(
  deuteration_curves,
  tests,
  significance_level = 0.05,
  summarized = TRUE
)

Arguments

deuteration_curves

list returned by the get_noisy_deuteration_curves

tests

lists of tests to perform. Each test function should take two parameters - data (data_table containing replicated curves) and significance_level, and have particular output - data frame of variables: Test (name of a test which should be displayed in the final result), State_1, State_2 (biological states of interest), Test_statistic, P_value, Significant_difference (the same as p_value <= significance_level), Time (character, "continuous" or "categorical"), Transformation (character, transformation that is used for exposure), AIC, logLik. For example see test_houde.

significance_level

significance level that will be used for testing. See tests

summarized

logical. Indicates whether the power should be calculated. Default TRUE.

Value

list of data.tables with test result, optionally summarized with power.

See Also

test_houde, test_semiparametric, test_hdx_analyzer, test_memhdx_model

Examples


theo_spectra_pf_100 <- 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)

theo_spectra_pf_200 <- simulate_theoretical_spectra(sequence = "LVRKDLQN",
                                                    charge = c(3, 5),
                                                    protection_factor = 200,
                                                    times = c(0.167, 5),
                                                    pH = 7.5,
                                                    temperature = 15,
                                                    n_molecules = 500,
                                                    time_step_const = 1,
                                                    use_markov = TRUE)

theo_spectra_two_states <- rbind(theo_spectra_pf_100, theo_spectra_pf_200)

deut_curves_p_states <- get_noisy_deuteration_curves(theo_spectra_two_states,
                                                     n_replicates = 4,
                                                     n_experiments = 2,
                                                     compare_pairs = TRUE,
                                                     reference = "all")
calculate_hdx_power(deut_curves_p_states,
                    tests = list(test_houde),
                    summarized = TRUE)


hadexversum/powerHDX documentation built on Aug. 31, 2022, 7:47 p.m.