support_for_modules | R Documentation |
Validate modules from summary networks by calculating the frequency with which pairs of nodes are placed in the same module in networks sampled across MCMC
support_for_modules(
mod_samples,
modules_across_ages,
threshold = 0.7,
edge_list = TRUE,
include_all = FALSE,
colors = NULL,
module_levels = NULL,
axis_text = FALSE
)
mod_samples |
Data frame produced by |
modules_across_ages |
Data frame containing the module information for the summary network.
A |
threshold |
Minimum frequency with which two nodes are placed in the same module to consider it supported. Only pairs with frequency higher than this threshold are plotted with the color of the module from the summary network. |
edge_list |
Logical. Whether to return a list of edge lists or a list of matrices of pairwise frequency. |
include_all |
Logical. Include all nodes or only those present at the time slice? |
colors |
Optional. Vector of module colors in the plot. |
module_levels |
Optional. Order of modules in the color vector. |
axis_text |
Logical. Plot taxon names? |
A list containing:
plot
: A plot of pairwise frequency with which the two nodes are placed in the same module in the ancestral network for each time slice in ages
. Cells in the diagonal show how often a host is sampled in a network (symbionts are always present);
pairwise_membership
: A list of edge lists or matrices with the pairwise frequencies at each time slice;
mean_support
: A list of mean and geometric mean pairwise frequency for each module at each time slice.
## Not run:
ages <- c(60, 50, 40, 0)
at_ages <- posterior_at_ages(history, ages, tree, host_tree)
weighted_net_50 <- get_summary_network(at_ages, pt = 0.5, weighted = TRUE)
all_mod <- modules_across_ages(weighted_net_50, tree)
# find modules for each sampled network
mod_samples <- modules_from_samples(at_ages)
# calculate support
support <- support_for_modules(mod_samples, all_mod)
support$plot
support$means
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.