match_modules: Match modules of different ancestral networks across time.

View source: R/modules.R

match_modulesR Documentation

Match modules of different ancestral networks across time.

Description

This function is called within modules_across_ages() and gives the same name to modules from ancestral networks at different ages that contain the same symbiont species or their parental species.

Usage

match_modules(summary_networks, unmatched_modules, tree)

Arguments

summary_networks

List of reconstructed summary networks for each age.

unmatched_modules

A data frame outputted from modules_from_summary_networks() containing: $name of the network node (hosts and symbionts), $age of the network, $original_module assigned to the node, and $type of the node (either "symbiont" or "host).

tree

The phylogeny of the symbiont clade (e.g. parasite, herbivore), a phylo object.

Value

A list of two elements: 1) a data frame containing the module information for each node at each network; 2) a data frame of correspondence between the original and the matched module names for each network.

Examples

## Not run: 
unmatched_modules <- modules_from_summary_networks(summary_networks)
matched_modules <- match_modules(summary_networks, unmatched_modules[[1]], tree)

## End(Not run)

maribraga/evolnets documentation built on Feb. 3, 2025, 6:46 p.m.