get_gen_estimates: Investigate Generative Model Comparisons

Description Usage Arguments Value Examples

View source: R/gen_model.R

Description

Given a generative model of the type we propose, and an alternate version (saturated "S", sample-independent "US", gene-independent "UG" or gene/variant interaction independent "UI"), either produces the estimated observations on the training dataset or calculates residual deviance between models.

Usage

1
2
3
4
5
6
7
8
get_gen_estimates(
  training_data,
  gen_model,
  alt_gen_model = NULL,
  alt_model_type = "S",
  gene_lengths = NULL,
  calculate_deviance = FALSE
)

Arguments

training_data

(list) Likely the 'train' component of a call to get_mutation_tables().

gen_model

(list) A generative model - result of a call to fit_gen_model*().

alt_gen_model

(list) An alternative generative model.

alt_model_type

(character) One of "S" (saturated), "US" (sample-independent), "UG", (gene-independent), "UI" (gene/variant-interaction independent).

gene_lengths

(dataframe) A gene lengths data frame.

calculate_deviance

(logical) If TRUE, returns residual deviance statistics. If FALSE, returns training data predictions.

Value

If calculate_deviance = FALSE:

A list with two entries, est_mut_vec and alt_est_mut_vec, each of length n_samples x n_genes x n_mut_types, giving expected mutation value for each combination of sample, gene and variant type in the training dataset under the two models being compared.

If calculate_deviance = TRUE:

A list with two entries, deviance and df, corresponding to the residual deviance and residual degrees of freedom between the two models on the training set.

Examples

1
2
3
4
5
sat_dev <- get_gen_estimates(training_data = example_tables$train,
                                       gen_model = example_gen_model,
                                       alt_model_type = "S",
                                       gene_lengths = example_maf_data$gene_lengths,
                                       calculate_deviance = TRUE)

ICBioMark documentation built on Nov. 15, 2021, 5:09 p.m.