layoutVertexByAttr: A graph layout function, which groups vertices by attribute.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotPath.R

Description

This function generates a layout for igraph objects, keeping vertices with the same attribute (ex: in the same pathway, etc) close to each other.

Usage

1
2
layoutVertexByAttr(graph, attr.name, cluster.strength = 1,
  layout = layout.auto)

Arguments

graph

An annotated igraph object.

attr.name

The attribute name by which vertices are laid out.

cluster.strength

A number indicating tie strengths between vertices with the same attribute. The larger it is, the closer the vertices will be.

layout

A layout function, ideally a force-directed layout fuction, such as layout_with_fr and layout_with_kk.

Value

A two-column matrix indicating the x and y postions of vertices.

Author(s)

Ahmed Mohamed

See Also

Other Plotting methods: colorVertexByAttr, plotAllNetworks, plotClassifierROC, plotClusterMatrix, plotCytoscapeGML, plotNetwork, plotPathClassifier, plotPaths

Examples

1
2
3
4
5
6
  data("ex_kgml_sig")
  v.layout <- layoutVertexByAttr(ex_kgml_sig, "pathway")
  plotNetwork(ex_kgml_sig, vertex.color="pathway", layout=v.layout)

  v.layout <- layoutVertexByAttr(ex_kgml_sig, "pathway", cluster.strength=5)
  plotNetwork(ex_kgml_sig, vertex.color="pathway", layout=v.layout)

NetPathMiner documentation built on Nov. 8, 2020, 8:20 p.m.