mkNetwork: Create network data from association results.

View source: R/func__networkAnalyser__mkNetwork.R

mkNetworkR Documentation

Create network data from association results.

Description

This function generates edge and node tables for a network. A user may print its output as an edge file and a node file for network construction.

Usage

mkNetwork(
  assoc = NULL,
  name.x = "x",
  name.y = "y",
  edge.attr = NULL,
  node.x.attr = NULL,
  node.y.attr = NULL,
  node.attr.names = "node",
  id = ""
)

Arguments

assoc

A data frame from which the network is created. It may be pre-filtered for some criteria by users.

name.x

Column name (character) for the explanatory variable X.

name.y

Column name (character) for the response variable Y.

edge.attr

A character vector of column names for edge attributes.

node.x.attr

A character vector of column names for node attributes of X.

node.y.attr

A character vector of column names for node attributes of Y. Vectors node.x.attr and node.y.attr must have the same length.

node.attr.names

A character vector for column names of the final data frame of nodes. It should have one more name (the "name" column for node names) than do the vectors node.x.attr and node.y.attr.

id

(optional) Network name

Value

G A Graph object having three slots: id, E and V. E: a data frame for edges and their attributes; V, a data frame for nodes and their attributes; id, an optional parameter for the network name.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

assoc <- findPhysLink(...)
nwk <- mkNetwork(assoc = assoc[["assoc"]], name.x = "x", name.y = "y",
edge.attr = c("beta", "score", "m", "s_d"), node.y.attr = "n_y",
node.x.attr = "n_x", node.attr.names = c("allele", "n"), id = "linkage")


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