Performs active subnetwork search and filters identified active subnetworks before returning final subnetworks.

get_active_subnetworks(
  significant_genes,
  network,
  score_context,
  score_quan_thr = 0.8,
  sig_gene_thr = 0.02,
  search_method = "GR",
  seed_for_stochastic_methods = 1234,
  verbose = FALSE,
  start_with_all_positives = FALSE,
  gene_init_prob = 0.1,
  sa_initial_temp = 1,
  sa_final_temp = 0.01,
  sa_iterations = 10000,
  ga_population_size = 400,
  ga_iterations = 200,
  ga_crossover_rate = 1,
  ga_mutation_rate = 0,
  gr_max_depth = 1,
  gr_search_depth = 1,
  gr_overlap_threshold = 0.5,
  gr_subnetwork_num = 1000
)

Arguments

significant_genes

vector of significant genes for the experiment

network

Prebuilt network object as returned by build_network(), built once by active_snw_enrichment_wrapper and passed to every iteration to avoid redundant PIN file I/O.

score_context

Prebuilt score context as returned by build_score_context(), built once by active_snw_enrichment_wrapper and passed to every iteration to avoid redundant Monte-Carlo calibration.

score_quan_thr

active subnetwork score quantile threshold. Must be between 0 and 1 or set to -1 for not filtering. (Default = 0.8)

sig_gene_thr

threshold for the minimum proportion of significant genes in the subnetwork (Default = 0.02) If the number of genes to use as threshold is calculated to be < 2 (e.g. 50 signif. genes x 0.01 = 0.5), the threshold number is set to 2

search_method

algorithm to use when performing active subnetwork search. Options are greedy search (GR), simulated annealing (SA) or genetic algorithm (GA) for the search (default = 'GR').

seed_for_stochastic_methods

seed for reproducibility while running active subnetwork search

verbose

boolean value indicating whether to print messages (default=FALSE)

start_with_all_positives

if TRUE: in GA, adds an individual with all positive nodes. In SA, initializes candidate solution with all positive nodes. (default = FALSE)

gene_init_prob

For SA and GA, probability of adding a gene in initial solution (default = 0.1)

sa_initial_temp

Initial temperature for SA (default = 1.0)

sa_final_temp

Final temperature for SA (default = 0.01)

sa_iterations

Iteration number for SA (default = 10000)

ga_population_size

Population size for GA (default = 400)

ga_iterations

Iteration number for GA (default = 200)

ga_crossover_rate

Applies crossover with the given probability in GA (default = 1, i.e. always perform crossover)

ga_mutation_rate

For GA, applies mutation with given mutation rate (default = 0, i.e. mutation off)

gr_max_depth

Sets max depth in greedy search, 0 for no limit (default = 1)

gr_search_depth

Search depth in greedy search (default = 1)

gr_overlap_threshold

Overlap threshold for results of greedy search (default = 0.5)

gr_subnetwork_num

Number of subnetworks to be presented in the results (default = 1000)

Value

A list of genes in every identified active subnetwork that has a score greater than the `score_quan_thr`th quantile and that has at least `sig_gene_thr` affected genes.

Examples

# \donttest{
experiment_df <- example_pathfindR_input[1:15, c(1, 3)]
colnames(experiment_df) <- c("gene", "pvalue")
pin_path <- return_pin_path("KEGG")
network <- build_network(pin_path)
score_context <- build_score_context(
  network,
  experiment_df,
  list(p_for_nonsignificant = 0.5, seed = 1234L)
)
GR_snws <- get_active_subnetworks(
  significant_genes = experiment_df$gene,
  network = network,
  score_context = score_context
)
#> Found 2 active subnetworks
#> 
# }