get_p function

Construct Optimisation Parameters.

Construct Optimisation Parameters.

An internal function. From the learned generative model and training data, produces a vector of weights p to be used in the subsequent group lasso optimisation, alongside a biomarker-dependent normalisation quantity p_norm.

get_p(gen_model, training_matrix, marker_mut_types, gene_lengths)

Arguments

  • gen_model: (list) A generative mutation model, fitted by fit_gen_model().
  • training_matrix: (sparse matrix) A sparse matrix of mutations in the training dataset, produced by get_mutation_tables().
  • marker_mut_types: (character) A character vector listing which mutation types (of the set specified in the generative model attribute 'names') constitute the biomarker in question.
  • gene_lengths: (dataframe) A table with two columns: Hugo_Symbol and max_cds, providing the lengths of the genes to be modelled.

Returns

A list with three entries:

  • A vector p, with an entry corresponding to each combination of gene and mutation type specified in the generative model fitted. Each component is a non-negative value corresponding to a weighting p to be supplied to a group lasso optimisation.
  • A numeric p_norm, giving the factor between p_gs and phi_0gs (see paper for details).
  • A vector biomarker_columns, detailing which of the elements of p correspond to gene/mutation type combinations contributing to the biomarker in question.

Examples

p <- get_p(example_gen_model, example_tables$train$matrix, marker_mut_types = c("I"), gene_lengths = example_maf_data$gene_lengths) print(p$p[1:5]) print(p$p_norm) print(p$bc[1:5])
  • Maintainer: Jacob R. Bradley
  • License: MIT + file LICENSE
  • Last published: 2021-11-15

Useful links