View source: R/compress_same_children.R
compress_same_children | R Documentation |
This function compresses a network by merging nodes that have the same children. The input network is represented as a data frame with three columns: source, target, and sign of interaction. The function returns a list containing the compressed network, node signatures, and duplicated signatures.
compress_same_children(df, sig_input, metab_input)
df |
A data frame representing the network with three columns: source, target, and sign of interaction. |
sig_input |
A list of input node signatures to be considered for the merging process. |
metab_input |
A list of input metabolic signatures to be considered for the merging process. |
A list containing the following elements:
compressed_network |
A data frame representing the compressed network. |
node_signatures |
A list of signatures of nodes in the network after the merging process. |
duplicated_signatures |
A list of duplicated signatures in the network after the merging process. |
# Create a sample network
df <- data.frame(source = c("A", "A", "B", "B"),
target = c("C", "D", "C", "D"),
sign_of_interaction = c(1, 1, 1, 1))
# Define input node and metabolic signatures
sig_input <- list()
metab_input <- list()
# Compress the network
result <- compress_same_children(df, sig_input, metab_input)
compressed_network <- result$compressed_network
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.