Searches a molecular interaction network for connected subnetworks of genes that are jointly enriched for low experimental p-values ("active modules"). Gene p-values are converted to z-scores, subnetwork scores are calibrated against a Monte-Carlo background, and one of three search strategies is used to find high-scoring connected subnetworks.
active_subnetwork_search(
network,
score_context,
method = c("GR", "SA", "GA"),
params,
verbose = FALSE
)A network list as returned by build_network().
A score context list as returned by build_score_context().
Search strategy: "GR" (greedy, the default),
"SA" (simulated annealing) or "GA" (genetic algorithm).
A fully-formed params list controlling the search, as built
by get_active_subnetworks().
Logical; emit progress messages.
A list of subnetwork objects sorted by score descending, each with
elements nodes (character vector of gene names) and score.
The list is empty when no positive-scoring subnetwork is found.
get_active_subnetworks which builds network,
score_context and params and calls this function.
if (FALSE) { # \dontrun{
# Write a minimal SIF file
sif <- data.frame(
source = c("A", "A", "B", "C", "D"),
type = "interacts",
target = c("B", "C", "C", "D", "E")
)
sif_path <- tempfile(fileext = ".sif")
write.table(sif, sif_path,
sep = "\t", row.names = FALSE, col.names = FALSE,
quote = FALSE
)
experiment <- data.frame(
gene = c("A", "B", "C", "D", "E"),
pvalue = c(0.001, 0.002, 0.001, 0.5, 0.6)
)
params <- list(
start_with_all_positives = FALSE,
gene_init_prob = 0.1,
p_for_nonsignificant = 0.5,
sa_initial_temp = 1.0,
sa_final_temp = 0.01,
sa_iterations = 10000L,
ga_population_size = 400L,
ga_iterations = 200L,
ga_crossover_rate = 1,
ga_mutation_rate = 0,
gr_max_depth = 1L,
gr_search_depth = 1L,
gr_overlap_threshold = 0.5,
gr_subnetwork_num = 1000,
seed = 1234L
)
network <- build_network(sif_path)
sc <- build_score_context(network, experiment, params)
snws <- active_subnetwork_search(network, sc, method = "GR", params = params)
} # }