compileGraphs: Compile graphs in a GraphSet object into a single network...

View source: R/func__networkAnalyser__compileGraphs.R

compileGraphsR Documentation

Compile graphs in a GraphSet object into a single network while retaining separation between individual graphs.

Description

This function pools graphs in a Graph object into a single network while keeping individual graphs separated. It is particularly useful when a user wants to display cliques or other kinds of clusters in a single view (such as in Cytoscape). The Graph object is produced by the function extractSubgraphs.

This function does not behave like the Cytoscape utility "merge networks". Specifically, it keeps the separation between graphs through appending a cluster ID to each node name so that the node shared by different graphs become distinguishable. It adds a label column to save the node names. In Cytoscape, for example, the user can choose this label column as node labels. Notice the first two columns, namely, node1 and node2, correspond to allele names in the third and fourth columns, respectively. Therefore, to make a directed network in Cytoscape, the source and target columns are specified based on the third and fourth columns.

Usage

compileGraphs(graphs, edge.attr = NULL, node.attr = NULL, id = "")

Arguments

graphs

A Graph object created using the function extractSubgraphs.

edge.attr

A character vector of column names for edge attributes.

node.attr

A character vector of column names for node attributes.

id

A name (character) for the output network object (default: "").

Author(s)

Yu Wan (wanyuac@126.com)

Examples

g <- compileGraphs(graphs = clusters, edge.attr = c("beta", "score"),
node.attr = c("n", "class"), id = "cliques")


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.