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
)vector of significant genes for the experiment
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.
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.
active subnetwork score quantile threshold. Must be between 0 and 1 or set to -1 for not filtering. (Default = 0.8)
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
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 reproducibility while running active subnetwork search
boolean value indicating whether to print messages (default=FALSE)
if TRUE: in GA, adds an individual with all positive nodes. In SA, initializes candidate solution with all positive nodes. (default = FALSE)
For SA and GA, probability of adding a gene in initial solution (default = 0.1)
Initial temperature for SA (default = 1.0)
Final temperature for SA (default = 0.01)
Iteration number for SA (default = 10000)
Population size for GA (default = 400)
Iteration number for GA (default = 200)
Applies crossover with the given probability in GA (default = 1, i.e. always perform crossover)
For GA, applies mutation with given mutation rate (default = 0, i.e. mutation off)
Sets max depth in greedy search, 0 for no limit (default = 1)
Search depth in greedy search (default = 1)
Overlap threshold for results of greedy search (default = 0.5)
Number of subnetworks to be presented in the results (default = 1000)
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.
# \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
#>
# }